From: Paul Barker <paul.barker.ct@bp.renesas.com>
To: Sergey Shtylyov <s.shtylyov@omp.ru>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Paul Barker <paul.barker.ct@bp.renesas.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH net-next 6/8] net: ravb: Align GbEth poll function with NAPI docs
Date: Wed, 31 Jan 2024 17:05:20 +0000 [thread overview]
Message-ID: <20240131170523.30048-7-paul.barker.ct@bp.renesas.com> (raw)
In-Reply-To: <20240131170523.30048-1-paul.barker.ct@bp.renesas.com>
Call napi_complete_done() in accordance with the documentation in
`Documentation/networking/napi.rst`.
Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
---
drivers/net/ethernet/renesas/ravb_main.c | 26 ++++++++++--------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index a90e70b25875..c3a5e4bb61f9 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1363,23 +1363,19 @@ static int ravb_poll_gbeth(struct napi_struct *napi, int budget)
if (priv->rx_fifo_errors != ndev->stats.rx_fifo_errors)
ndev->stats.rx_fifo_errors = priv->rx_fifo_errors;
- if (work_done == budget)
- goto out;
-
- napi_complete(napi);
-
- /* Re-enable RX/TX interrupts */
- spin_lock_irqsave(&priv->lock, flags);
- if (!info->irq_en_dis) {
- ravb_modify(ndev, RIC0, mask, mask);
- ravb_modify(ndev, TIC, mask, mask);
- } else {
- ravb_write(ndev, mask, RIE0);
- ravb_write(ndev, mask, TIE);
+ if (work_done < budget && napi_complete_done(napi, work_done)) {
+ /* Re-enable RX/TX interrupts */
+ spin_lock_irqsave(&priv->lock, flags);
+ if (!info->irq_en_dis) {
+ ravb_modify(ndev, RIC0, mask, mask);
+ ravb_modify(ndev, TIC, mask, mask);
+ } else {
+ ravb_write(ndev, mask, RIE0);
+ ravb_write(ndev, mask, TIE);
+ }
+ spin_unlock_irqrestore(&priv->lock, flags);
}
- spin_unlock_irqrestore(&priv->lock, flags);
-out:
return work_done;
}
--
2.39.2
next prev parent reply other threads:[~2024-01-31 17:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 17:05 [PATCH net-next 0/8] Improve GbEth performance on Renesas RZ/G2L and related SoCs Paul Barker
2024-01-31 17:05 ` [PATCH net-next 1/8] net: ravb: Split R-Car & GbEth poll functions Paul Barker
2024-01-31 17:05 ` [PATCH net-next 2/8] net: ravb: Simplify GbEth poll & receive functions Paul Barker
2024-01-31 17:05 ` [PATCH net-next 3/8] net: ravb: Count packets in GbEth RX (not descriptors) Paul Barker
2024-01-31 17:05 ` [PATCH net-next 4/8] net: ravb: Always process TX descriptor ring in GbEth poll Paul Barker
2024-01-31 17:05 ` [PATCH net-next 5/8] net: ravb: Always update error counters Paul Barker
2024-01-31 17:05 ` Paul Barker [this message]
2024-01-31 17:05 ` [PATCH net-next 7/8] net: ravb: Enable SW IRQ Coalescing for GbEth Paul Barker
2024-01-31 17:05 ` [PATCH net-next 8/8] net: ravb: Use NAPI threaded mode on 1-core CPUs with GbEth IP Paul Barker
2024-01-31 18:26 ` [PATCH net-next 0/8] Improve GbEth performance on Renesas RZ/G2L and related SoCs Andrew Lunn
2024-02-02 9:39 ` Paul Barker
2024-02-02 13:30 ` Andrew Lunn
2024-02-01 19:22 ` Sergey Shtylyov
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=20240131170523.30048-7-paul.barker.ct@bp.renesas.com \
--to=paul.barker.ct@bp.renesas.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=s.shtylyov@omp.ru \
--cc=wsa+renesas@sang-engineering.com \
--cc=yoshihiro.shimoda.uh@renesas.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
all inboxes | Powered by JetHome®