Skip to contentSkip to conversation

ifb: goto resched directly if error happens and dp->tq isn't empty

PATCH In review Changli Gao 3 participants 3 messages Dec 5, 2010 – Dec 8, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ifb: goto resched directly if error happens and dp->tq isn't empty

If we break the loop when there are still skbs in tq and no skb in rq, the skbs will be left in txq until new skbs are enqueued into rq. In rare cases, no new skb is queued, then these skbs will stay in rq forever.

After this patch, if tq isn't empty when we break the loop, we goto resched directly.

---
 drivers/net/ifb.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/net/ifb.c +2 -0
index ab9f675..fe337bd 100644
@@ -104,6 +104,8 @@ static void ri_tasklet(unsigned long dev)
 			rcu_read_unlock();
 			dev_kfree_skb(skb);
 			stats->tx_dropped++;
+			if (skb_queue_len(&dp->tq) != 0)
+				goto resched;
 			break;
 		}
 		rcu_read_unlock();
#1 lore raw
Quoted 9 lines · Changli Gao

If we break the loop when there are still skbs in tq and no skb in rq, the skbs will be left in txq until new skbs are enqueued into rq. In rare cases, no new skb is queued, then these skbs will stay in rq forever.

After this patch, if tq isn't empty when we break the loop, we goto resched directly.

Dave, this goes to stable as well.

cheers,
jamal

maintainer
#2 lore raw

From: jamal <[email protected]>
Date: Sun, 05 Dec 2010 09:25:44 -0500

Quoted 6 lines · Changli Gao
Quoted 5 lines

If we break the loop when there are still skbs in tq and no skb in rq, the skbs will be left in txq until new skbs are enqueued into rq. In rare cases, no new skb is queued, then these skbs will stay in rq forever.

Quoted 8 lines
Quoted 4 lines

After this patch, if tq isn't empty when we break the loop, we goto resched directly.

Dave, this goes to stable as well.

Applied and queued up for -stable, thanks.