]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
net: netsec: remove loops in napi Rx process
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Wed, 19 Jun 2019 10:04:01 +0000 (13:04 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Jun 2019 14:28:20 +0000 (10:28 -0400)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/socionext/netsec.c

index a10ef700f16d2ae10e7ab6cd6be7dde28889d1cb..48fd7448b513fb9604e2b27b77e402f5d543c96e 100644 (file)
@@ -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;