Re: [PATCH] mac80211: rewrite fragmentation code

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <herbert@...>
Cc: <mb@...>, <johannes@...>, <linux-wireless@...>, <netdev@...>, <ron.rindjunsky@...>, <tomasw@...>, <ivdoorn@...>, <peter.p.waskiewicz.jr@...>
Date: Wednesday, May 7, 2008 - 11:26 pm

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu, 8 May 2008 11:22:08 +0800


Right, and this is why drivers choose a TX wakeup threshold such
that they can accept an arbitrarily sized TSO frame.

For example, from drivers/net/tg3.c's ->hard_start_xmit():

	if (unlikely(tg3_tx_avail(tp) <= (MAX_SKB_FRAGS + 1))) {
		netif_stop_queue(dev);
		if (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH(tp))
			netif_wake_queue(tp->dev);
	}

The driver is responsible for stopping the queue _before_ it
enters a state where there is not enough space in the queue
to accept a packet.

This is why most drivers make the following kind of BUG check
at the start of their ->hard_start_xmit()

	if (unlikely(tg3_tx_avail(tp) <= (skb_shinfo(skb)->nr_frags + 1))) {
		if (!netif_queue_stopped(dev)) {
			netif_stop_queue(dev);

			/* This is a hard error, log it. */
			printk(KERN_ERR PFX "%s: BUG! Tx Ring full when "
			       "queue awake!\n", dev->name);
		}
		return NETDEV_TX_BUSY;
	}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC/RFT 3/4] mac80211: use GSO for fragmentation, Johannes Berg, (Wed Apr 30, 8:40 am)
Re: [RFC/RFT 3/4] mac80211: use GSO for fragmentation, Johannes Berg, (Wed May 7, 4:50 am)
[PATCH] mac80211: rewrite fragmentation code, Johannes Berg, (Wed May 7, 7:22 am)
Re: [PATCH] mac80211: rewrite fragmentation code, Herbert Xu, (Wed May 7, 7:41 am)
Re: [PATCH] mac80211: rewrite fragmentation code, Johannes Berg, (Wed May 7, 7:52 am)
Re: [PATCH] mac80211: rewrite fragmentation code, Herbert Xu, (Wed May 7, 9:05 am)
Re: [PATCH] mac80211: rewrite fragmentation code, Johannes Berg, (Wed May 7, 3:19 pm)
Re: [PATCH] mac80211: rewrite fragmentation code, Michael Buesch, (Wed May 7, 9:48 am)
Re: [PATCH] mac80211: rewrite fragmentation code, Herbert Xu, (Wed May 7, 11:22 pm)
Re: [PATCH] mac80211: rewrite fragmentation code, Michael Buesch, (Thu May 8, 9:00 am)
Re: [PATCH] mac80211: rewrite fragmentation code, Herbert Xu, (Thu May 8, 9:08 am)
Re: [PATCH] mac80211: rewrite fragmentation code, Michael Buesch, (Thu May 8, 9:13 am)
Re: [PATCH] mac80211: rewrite fragmentation code, Herbert Xu, (Thu May 8, 9:32 am)
Re: [PATCH] mac80211: rewrite fragmentation code, Michael Buesch, (Thu May 8, 9:15 am)
Re: [PATCH] mac80211: rewrite fragmentation code, David Miller, (Wed May 7, 11:26 pm)
Re: [PATCH] mac80211: rewrite fragmentation code, Rusty Russell, (Thu May 15, 10:01 pm)
Re: [PATCH] mac80211: rewrite fragmentation code, David Miller, (Fri May 16, 12:58 am)
Re: [PATCH] mac80211: rewrite fragmentation code, Rusty Russell, (Fri May 16, 6:32 am)
Re: [PATCH] mac80211: rewrite fragmentation code, David Miller, (Fri May 16, 3:40 pm)
Re: [PATCH] mac80211: rewrite fragmentation code, Rusty Russell, (Sun May 18, 11:08 pm)
Re: [PATCH] mac80211: rewrite fragmentation code, David Miller, (Mon May 19, 3:03 am)
Re: [PATCH] mac80211: rewrite fragmentation code, Herbert Xu, (Fri May 16, 8:15 am)
Re: [PATCH] mac80211: rewrite fragmentation code, Johannes Berg, (Fri May 16, 6:38 am)
Re: [PATCH] mac80211: rewrite fragmentation code, Herbert Xu, (Thu May 15, 11:28 pm)
Re: [PATCH] mac80211: rewrite fragmentation code, Johannes Berg, (Thu May 8, 5:00 am)