Re: [RFC] HOWTO use NAPI to reduce TX interrupts

From: David Miller
Date: Mon Aug 21 2006 - 19:53:29 EST


From: linas@xxxxxxxxxxxxxx (Linas Vepstas)
Date: Mon, 21 Aug 2006 18:52:44 -0500

> Under what circumstance does one turn TX interrupts back on?
> I couldn't quite figure that out.

Don't touch interrupts until both RX and TX queue work is
fullydepleted. You seem to have this notion that RX and TX interrupts
are seperate. They aren't, even if your device can generate those
events individually. Whatever interrupt you get, you shut down all
interrupt sources and schedule the ->poll(). Then ->poll() does
something like:

all_tx_completion_work();
ret = as_much_rx_work_as_budget_and_quota_allows();
if (!ret)
reenable_interrupts_and_complet_napi_poll();

You always run the TX completion work fully, then you do the RX work
within the quota/budget.

See the tg3 driver for details, really...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/