netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [RFC] net: napi fix
@ 2007-12-12 17:29 Andrew Gallatin
  2007-12-12 17:38 ` David Miller
  0 siblings, 1 reply; 30+ messages in thread
From: Andrew Gallatin @ 2007-12-12 17:29 UTC (permalink / raw)
  To: David Miller
  Cc: joonwpark81, netdev, linux-kernel, jgarzik, Stephen Hemminger

[I apologize for loosing threading, I'm replying from the archives]

 > The problem is that the driver is doing a NAPI completion and
 > re-enabling chip interrupts with work_done == weight, and that is
 > illegal.

The only time at least myri10ge will do this is due to
the !netif_running(netdev) check.   Eg, from myri10ge's poll:

	work_done = myri10ge_clean_rx_done(mgp, budget);

	if (work_done < budget || !netif_running(netdev)) {
		netif_rx_complete(netdev, napi);
		put_be32(htonl(3), mgp->irq_claim);
	}

Is the netif_running() check even required? Is this just
a bad way to solve a race with running NAPI at down() time
that would be better solved by putting a napi_synchronize()
in the driver's down() routine?

I'd rather fix this right than add another check to a
questionable code path.

Thanks,

Drew

^ permalink raw reply	[flat|nested] 30+ messages in thread
* [PATCH 6/7] : tehuti Fix possible causing oops of net_rx_action
@ 2007-12-12  4:01 Joonwoo Park
  2007-12-12  5:39 ` Stephen Hemminger
  0 siblings, 1 reply; 30+ messages in thread
From: Joonwoo Park @ 2007-12-12  4:01 UTC (permalink / raw)
  To: netdev, linux-kernel; +Cc: jgarzik, baum, andy

[NETDEV]: tehuti Fix possible causing oops of net_rx_action

Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
---
 drivers/net/tehuti.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
index 21230c9..955e749 100644
--- a/drivers/net/tehuti.c
+++ b/drivers/net/tehuti.c
@@ -305,6 +305,8 @@ static int bdx_poll(struct napi_struct *napi, int budget)
 
 		netif_rx_complete(dev, napi);
 		bdx_enable_interrupts(priv);
+		if (unlikely(work_done == napi->weight))
+			return work_done - 1;
 	}
 	return work_done;
 }
---


^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2007-12-20 11:22 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-12 17:29 [RFC] net: napi fix Andrew Gallatin
2007-12-12 17:38 ` David Miller
2007-12-12 17:40   ` Andrew Gallatin
2007-12-12 18:41   ` Kok, Auke
2007-12-13  7:41     ` Joonwoo Park
2007-12-13 14:13       ` Andrew Gallatin
2007-12-13 14:19         ` David Miller
2007-12-13 16:45           ` Kok, Auke
2007-12-13 18:22           ` Stephen Hemminger
2007-12-13 19:02             ` Andrew Gallatin
2007-12-13 19:09               ` David Miller
2007-12-13 19:35                 ` Stephen Hemminger
2007-12-13 20:38                   ` David Miller
2007-12-14  2:06         ` Joonwoo Park
2007-12-13 13:49     ` Jarek Poplawski
2007-12-13 13:50       ` David Miller
2007-12-13 14:14         ` Jarek Poplawski
2007-12-13 20:16         ` Jarek Poplawski
2007-12-13 20:37           ` David Miller
2007-12-13 20:41             ` Stephen Hemminger
2007-12-13 21:55               ` Jarek Poplawski
2007-12-13 22:28             ` Jarek Poplawski
2007-12-13 22:34               ` David Miller
2007-12-13 22:58                 ` Jarek Poplawski
2007-12-20  9:52   ` Robert Olsson
2007-12-20 11:22     ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2007-12-12  4:01 [PATCH 6/7] : tehuti Fix possible causing oops of net_rx_action Joonwoo Park
2007-12-12  5:39 ` Stephen Hemminger
2007-12-12  5:46   ` [RFC] net: napi fix Stephen Hemminger
2007-12-12  6:05     ` Joonwoo Park
2007-12-12 15:22       ` David Miller
2007-12-12 15:21     ` David Miller

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).