From: Shannon Nelson <shannon.nelson@amd.com>
To: <netdev@vger.kernel.org>, <davem@davemloft.net>,
<kuba@kernel.org>, <edumazet@google.com>, <pabeni@redhat.com>
Cc: <brett.creeley@amd.com>, <drivers@pensando.io>,
Shannon Nelson <shannon.nelson@amd.com>
Subject: [PATCH v2 net-next 01/10] ionic: minimal work with 0 budget
Date: Wed, 7 Feb 2024 16:57:16 -0800 [thread overview]
Message-ID: <20240208005725.65134-2-shannon.nelson@amd.com> (raw)
In-Reply-To: <20240208005725.65134-1-shannon.nelson@amd.com>
We should be doing as little as possible besides freeing Tx
space when our napi routines are called with budget of 0, so
jump out before doing anything besides Tx cleaning.
See commit afbed3f74830 ("net/mlx5e: do as little as possible in napi poll when budget is 0")
for more info.
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
---
drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
index 54cd96b035d6..6f4776759863 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
@@ -579,6 +579,9 @@ int ionic_tx_napi(struct napi_struct *napi, int budget)
work_done = ionic_cq_service(cq, budget,
ionic_tx_service, NULL, NULL);
+ if (unlikely(!budget))
+ return budget;
+
if (work_done < budget && napi_complete_done(napi, work_done)) {
ionic_dim_update(qcq, IONIC_LIF_F_TX_DIM_INTR);
flags |= IONIC_INTR_CRED_UNMASK;
@@ -607,6 +610,9 @@ int ionic_rx_napi(struct napi_struct *napi, int budget)
u32 work_done = 0;
u32 flags = 0;
+ if (unlikely(!budget))
+ return budget;
+
lif = cq->bound_q->lif;
idev = &lif->ionic->idev;
@@ -656,6 +662,9 @@ int ionic_txrx_napi(struct napi_struct *napi, int budget)
tx_work_done = ionic_cq_service(txcq, IONIC_TX_BUDGET_DEFAULT,
ionic_tx_service, NULL, NULL);
+ if (unlikely(!budget))
+ return budget;
+
rx_work_done = ionic_cq_service(rxcq, budget,
ionic_rx_service, NULL, NULL);
--
2.17.1
next prev parent reply other threads:[~2024-02-08 0:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-08 0:57 [PATCH v2 net-next 00/10] ionic: add XDP support Shannon Nelson
2024-02-08 0:57 ` Shannon Nelson [this message]
2024-02-09 22:09 ` [PATCH v2 net-next 01/10] ionic: minimal work with 0 budget Jakub Kicinski
2024-02-09 23:33 ` Nelson, Shannon
2024-02-08 0:57 ` [PATCH v2 net-next 02/10] ionic: set adminq irq affinity Shannon Nelson
2024-02-08 0:57 ` [PATCH v2 net-next 03/10] ionic: add helpers for accessing buffer info Shannon Nelson
2024-02-08 0:57 ` [PATCH v2 net-next 04/10] ionic: use dma range APIs Shannon Nelson
2024-02-08 0:57 ` [PATCH v2 net-next 05/10] ionic: add initial framework for XDP support Shannon Nelson
2024-02-08 0:57 ` [PATCH v2 net-next 06/10] ionic: Add XDP packet headroom Shannon Nelson
2024-02-08 0:57 ` [PATCH v2 net-next 07/10] ionic: Add XDP_TX support Shannon Nelson
2024-02-08 0:57 ` [PATCH v2 net-next 08/10] ionic: Add XDP_REDIRECT support Shannon Nelson
2024-02-08 0:57 ` [PATCH v2 net-next 09/10] ionic: add ndo_xdp_xmit Shannon Nelson
2024-02-08 0:57 ` [PATCH v2 net-next 10/10] ionic: implement xdp frags support Shannon Nelson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240208005725.65134-2-shannon.nelson@amd.com \
--to=shannon.nelson@amd.com \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=drivers@pensando.io \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).