Re: [PATCH net-next 2/2] bnx2x: use the default NAPI weight
From: David Miller <davem@davemloft.net>
Date: 2013-03-06 19:59:49
From: Eric Dumazet <redacted> Date: Tue, 05 Mar 2013 23:03:18 -0800
On Tue, 2013-03-05 at 23:37 -0500, David Miller wrote:quoted
Thanks for the explanation. Since you haven't completely resolved the issues you were running into I'll target this to net-next for now.Thanks David An other issue is the spin_trylock() attempted in net_tx_action() It seems we can miss a qdisc_run(), and have to wait the following NET_TX softirq(s) to send more data. NET_RX being interleaved, we can have to wait a long time (not mentioning other softirq handlers like RCU ...) I might be too tired right now, but cant see the reason of the trylock. qdisc lock is already BH safe, so we should do a spinlock
...
quoted hunk ↗ jump to hunk
@@ -3201,22 +3201,11 @@ static void net_tx_action(struct softirq_action *h) head = head->next_sched; root_lock = qdisc_lock(q); - if (spin_trylock(root_lock)) { - smp_mb__before_clear_bit(); - clear_bit(__QDISC_STATE_SCHED, - &q->state); - qdisc_run(q); - spin_unlock(root_lock);
I think this trylock is intentional, but not to deal with BH safeness, but rather to allow another cpu already processing the qdisc to continue doing so. I think this is what Jamal's amazing flash animations back at netconf in Toronto were all about :-) Herbert Xu and Jamal have touched upon this issue several times in the past.