Search Linux Wireless

Re: [PATCH v2] mac80211: detect driver tx bugs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sunday, 15 of June 2008, Johannes Berg wrote:
> When a driver rejects a frame in it's ->tx() callback, it must also
> stop queues, otherwise mac80211 can go into a loop here. Detect this
> situation and abort the loop after five retries, warning about the
> driver bug.
> 
> Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>

The patch forks for me nicely. :-)

I'm now able to hibernate the box without turning off the b43 wireless.

Thanks a lot,
Rafael


> ---
> v2: Michael suggested to use WARN_ON_ONCE instead
> 
>  net/mac80211/tx.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> --- everything.orig/net/mac80211/tx.c	2008-06-15 14:19:10.000000000 +0200
> +++ everything/net/mac80211/tx.c	2008-06-15 14:53:52.000000000 +0200
> @@ -1091,7 +1091,7 @@ static int ieee80211_tx(struct net_devic
>  	struct ieee80211_tx_data tx;
>  	ieee80211_tx_result res = TX_DROP, res_prepare;
>  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
> -	int ret, i;
> +	int ret, i, retries = 0;
>  	u16 queue;
>  
>  	queue = skb_get_queue_mapping(skb);
> @@ -1189,6 +1189,13 @@ retry:
>  		 */
>  		if (!__netif_subqueue_stopped(local->mdev, queue)) {
>  			clear_bit(queue, local->queues_pending);
> +			retries++;
> +			/*
> +			 * Driver bug, it's rejecting packets but
> +			 * not stopping queues.
> +			 */
> +			if (WARN_ON_ONCE(retries > 5))
> +				goto drop;
>  			goto retry;
>  		}
>  		store->skb = skb;
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux