netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: jaswinder.singh@linaro.org
Cc: netdev@vger.kernel.org, ard.biesheuvel@linaro.org,
	masahisa.kojima@linaro.org, davem@davemloft.net,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>
Subject: [net-next, PATCH 2/2, v2] net: netsec: remove loops in napi Rx process
Date: Wed, 19 Jun 2019 13:04:01 +0300	[thread overview]
Message-ID: <1560938641-16778-2-git-send-email-ilias.apalodimas@linaro.org> (raw)
In-Reply-To: <1560938641-16778-1-git-send-email-ilias.apalodimas@linaro.org>

netsec_process_rx was running in a loop trying to process as many packets
as possible before re-enabling interrupts. With the recent DMA changes
this is not needed anymore as we manage to consume all the budget without
looping over the function.
Since it has no performance penalty let's remove that and simplify the Rx
path a bit

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 drivers/net/ethernet/socionext/netsec.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
index a10ef700f16d..48fd7448b513 100644
--- a/drivers/net/ethernet/socionext/netsec.c
+++ b/drivers/net/ethernet/socionext/netsec.c
@@ -820,19 +820,12 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget)
 static int netsec_napi_poll(struct napi_struct *napi, int budget)
 {
 	struct netsec_priv *priv;
-	int rx, done, todo;
+	int done;
 
 	priv = container_of(napi, struct netsec_priv, napi);
 
 	netsec_process_tx(priv);
-
-	todo = budget;
-	do {
-		rx = netsec_process_rx(priv, todo);
-		todo -= rx;
-	} while (rx);
-
-	done = budget - todo;
+	done = netsec_process_rx(priv, budget);
 
 	if (done < budget && napi_complete_done(napi, done)) {
 		unsigned long flags;
-- 
2.20.1


  reply	other threads:[~2019-06-19 10:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 10:04 [net-next, PATCH 1/2, v2] net: netsec: initialize tx ring on ndo_open Ilias Apalodimas
2019-06-19 10:04 ` Ilias Apalodimas [this message]
2019-06-19 14:29   ` [net-next, PATCH 2/2, v2] net: netsec: remove loops in napi Rx process David Miller
2019-06-19 14:28 ` [net-next, PATCH 1/2, v2] net: netsec: initialize tx ring on ndo_open David Miller

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=1560938641-16778-2-git-send-email-ilias.apalodimas@linaro.org \
    --to=ilias.apalodimas@linaro.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=davem@davemloft.net \
    --cc=jaswinder.singh@linaro.org \
    --cc=masahisa.kojima@linaro.org \
    --cc=netdev@vger.kernel.org \
    /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).