Re: [PATCH RFC]: napi_struct V4
From: David Miller <davem@davemloft.net>
Date: 2007-07-31 00:25:46
From: David Miller <davem@davemloft.net>
Date: 2007-07-31 00:25:46
From: "Michael Chan" <mchan@broadcom.com> Date: Thu, 26 Jul 2007 14:38:09 -0700
If the driver wants a simple solution, it can do what you did in the
patch: wrap the tx cleanup code with netif_tx_lock() and
netif_tx_unlock().
If a NAPI driver wants to be more clever, it can do something such as
this in tg3's poll_controller:
if (netif_rx_schedule_prep(dev, &tp->napi)) {
tg3_tx(tp);
netif_poll_enable(tp->napi);
}Thanks Michael, that's a good suggestion and would work. In thinking about this some more over the weekend I've decided that my plan to rip out RX support from netpoll is a bit too ambitious. Therefore, for the time being, I'm going to add a special driver function for netpoll that will allow it to ask the driver to invoke ->poll() over all the NAPI structs assosciated with the netdev.