e1000 poll behavior
Subsystems (2)
Is there any advantage in exiting NAPI polled state as soon as possible with the work_done < work_to_do test? Why not stay in polled mode until no rx or tx work is done, i.e. only exit polled state if work_done is zero? When the system is congested, it is common for work_done < work_to_do to be true, which keeps interrupts enabled and just makes the situation worse.
When working on e100 a while ago, I found better and more consistent pps numbers by staying in polled mode until the interface went idle. See current e100 code. Unfortunately I don't have e1000 hardware to test if the same is true for e1000.
/james
Quoted 35 lines · Robert Olsson
Quoted 9 lines · Martin Josefsson
What about the case where
tx_cleanedis true but (work_done< >work_to_do) is true. Then the statement is false and we continue, later we return (work_done>=work_to_do) which equals 0 (not seen in patch). We are not allowed to return 0 when still onpoll_list. That will sort of continue polling in a degraded way (no increase in quota) but will screw up device refcounting badly.That final return must be changed into "return 1;"
Ohoh thanks yes...
net/e1000/e1000_main.c renamed from net/e1000/e1000_main.c.orig +3
-3@@ -2179,15 +2179,15 @@ *budget -= work_done; netdev->quota -= work_done; -/* if no Rx and Tx cleanup work was done, exit the polling mode */ -if (!tx_cleaned || (work_done < work_to_do) || +/* if no Tx and not enough Rx work done, exit the polling mode */ +if ((!tx_cleaned && (work_done < work_to_do)) || !netif_running (netdev)) {netif_rx_complete (netdev);e1000_irq_enable (adapter);return 0 ; } - return (work_done >= work_to_do); + return 1; }#endif
Quoted 4 lines · [email protected] writes:
Is there any advantage in exiting NAPI polled state as soon as possible with the
work_done<work_to_dotest? Why not stay in polled mode until no rx or tx work is done, i.e. only exit polled state ifwork_doneis zero?
Yes it's a variant.
Quoted 4 lines
When working on e100 a while ago, I found better and more consistent pps numbers by staying in polled mode until the interface went idle. See current e100 code. Unfortunately I don't have e1000 hardware to test if the same is true for e1000.
I'll try this with the forwarding setup when I got a chance but I'll think server-like setups are more interesting to test.
--ro