[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OFD735615D.FB673D0A-ONC1257585.005CB13B-C1257585.005CED95@transmode.se>
Date: Thu, 26 Mar 2009 17:55:02 +0100
From: Joakim Tjernlund <Joakim.Tjernlund@...nsmode.se>
To: Eric Dumazet <dada1@...mosbay.com>
Cc: avorontsov@...mvista.com, leoli@...escale.com,
linuxppc-dev@...abs.org, netdev@...r.kernel.org
Subject: Re: [PATCH 1/2] ucc_geth: Move freeing of TX packets to NAPI context.
Eric Dumazet <dada1@...mosbay.com> wrote on 26/03/2009 15:15:25:
>
> Joakim Tjernlund a écrit :
> > Also set NAPI weight to 64 as this is a common value.
> > This will make the system alot more responsive while
> > ping flooding the ucc_geth ethernet interaface.
> >
> > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@...nsmode.se>
> > ---
> > drivers/net/ucc_geth.c | 32 ++++++++++++--------------------
> > drivers/net/ucc_geth.h | 1 -
> > 2 files changed, 12 insertions(+), 21 deletions(-)
> >
> > diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
> > index 097aed8..7fc91aa 100644
> > --- a/drivers/net/ucc_geth.c
> > +++ b/drivers/net/ucc_geth.c
> > @@ -3214,7 +3214,7 @@ static int ucc_geth_tx(struct net_device *dev,
u8 txQ)
> > dev->stats.tx_packets++;
> >
> > /* Free the sk buffer associated with this TxBD */
> > - dev_kfree_skb_irq(ugeth->
> > + dev_kfree_skb(ugeth->
> > tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]]);
> > ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]] = NULL;
> > ugeth->skb_dirtytx[txQ] =
> > @@ -3248,9 +3248,16 @@ static int ucc_geth_poll(struct napi_struct
*napi, int budget)
>
> > for (i = 0; i < ug_info->numQueuesRx; i++)
> > howmany += ucc_geth_rx(ugeth, i, budget - howmany);
>
> Not related to your patch, but seeing above code, I can understand
> you might have a problem in flood situation : Only first queue(s) are
> depleted, and last one cannot be because howmany >= budget.
>
> This driver might have to remember last queue it handled at previous
> call ucc_geth_poll(), so that all rxqueues have same probability to be
scanned.
>
> j = ug->lastslot;
> for (i = 0; ug_info->numQueuesRx; i++) {
> if (++j >= ug_info->numQueuesRx)
> j = 0;
> howmany += ucc_geth_rx(ugeth, j, budget - howmany);
> if (howmany >= budget)
> break;
> }
> ug->lastslot = j;
yes, or scan the RX queues in prio order. However ATM there is only
one queue so it won't be a problem until one extends the driver with
several queues.
Thanks,
Jocke
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists