netdev
[Top] [All Lists]

RE: [PATCH] make tg3 NAPI support configurable

To: "Robert Olsson" <Robert.Olsson@xxxxxxxxxxx>, "Jeff Garzik" <jgarzik@xxxxxxxxx>
Subject: RE: [PATCH] make tg3 NAPI support configurable
From: "Feldman, Scott" <scott.feldman@xxxxxxxxx>
Date: Tue, 13 Jan 2004 16:23:27 -0800
Cc: "Greg Banks" <gnb@xxxxxxxxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxx>, "Linux Network Development list" <netdev@xxxxxxxxxxx>, <jchapman@xxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
Thread-index: AcPaCQLBGAMgflYFToKkT6HVZbQ6NgAK2AtQ
Thread-topic: [PATCH] make tg3 NAPI support configurable
> I was thinking of a variant JC [jchapman@xxxxxxxxxxx] 
> 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;
}


<Prev in Thread] Current Thread [Next in Thread>