RE: [PATCH] make tg3 NAPI support configurable
From: Feldman, Scott <hidden>
Date: 2004-01-14 00:23:27
I was thinking of a variant JC [jchapman@katalix.com] mentioned on this list some time ago. He also sent me the patch for e1000. A test and the patch is below.
JC contributed almost the exact patch for the e100 rewrite and it did
help Tx, but I don't remember how much. JC, do you remember? Here is
the snippet:
static int e100_poll(struct net_device *netdev, int *budget)
{
struct nic *nic = netdev->priv;
unsigned int work_to_do = min(netdev->quota, *budget);
unsigned int work_done = 0;
int tx_cleaned;
e100_rx_clean(nic, &work_done, work_to_do);
tx_cleaned = e100_tx_clean(nic);
/* If no Rx and Tx cleanup work was done, exit polling mode. */
if((!tx_cleaned && (work_done == 0)) || !netif_running(netdev))
{
netif_rx_complete(netdev);
e100_enable_irq(nic);
return 0;
}
*budget -= work_done;
netdev->quota -= work_done;
return 1;
}