[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1Y2QRs-0001q5-6u@gondolin.me.apana.org.au>
Date: Sun, 21 Dec 2014 07:16:24 +1100
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Eric Dumazet <eric.dumazet@...il.com>,
David Miller <davem@...emloft.net>, david.vrabel@...rix.com,
netdev@...r.kernel.org, xen-devel@...ts.xenproject.org,
konrad.wilk@...cle.com, boris.ostrovsky@...cle.com,
edumazet@...gle.com
Subject: [PATCH 3/4] net: Always poll at least one device in net_rx_action
We should only perform the softnet_break check after we have polled
at least one device in net_rx_action. Otherwise a zero or negative
setting of netdev_budget can lock up the whole system.
Signed-off-by: Herbert Xu <herbert@...dor.apana.org.au>
---
net/core/dev.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 4a9c424..22b0fb2 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4634,16 +4634,15 @@ static void net_rx_action(struct softirq_action *h)
while (!list_empty(&list)) {
struct napi_struct *n;
+ n = list_first_entry(&list, struct napi_struct, poll_list);
+ budget -= napi_poll(n, &repoll);
+
/* If softirq window is exhausted then punt.
* Allow this to run for 2 jiffies since which will allow
* an average latency of 1.5/HZ.
*/
if (unlikely(budget <= 0 || time_after_eq(jiffies, time_limit)))
goto softnet_break;
-
-
- n = list_first_entry(&list, struct napi_struct, poll_list);
- budget -= napi_poll(n, &repoll);
}
if (!sd_has_rps_ipi_waiting(sd) &&
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists