Subject: Re: [PATCH net v4 4/4] tg3: Fix tx_pending checks for tg3_tso_bug

From: Prashant Sreedharan <[email-masked]>
Date: Thu, 28 Aug 2014 20:24:28 -0700

>  
> -	for (i = 0; i < tp->irq_max; i++)
> -		tp->napi[i].tx_pending = ering->tx_pending;
> +	dev->gso_max_segs = TG3_TX_SEG_PER_DESC(ering->tx_pending - 1);
> +	for (i = 0; i < tp->irq_max; i++) {
> +		struct tg3_napi *tnapi = &tp->napi[i];
> +
> +		tnapi->tx_pending = ering->tx_pending;
> +		if (netif_tx_queue_stopped(netdev_get_tx_queue(dev, i)) &&

Need to limit the number of TX queues to tp->txq_cnt instead of
tp->irq_max as txq_cnt can be less than irq_max.

netif_set_real_num_tx_queues(tp->dev, tp->txq_cnt);

> +		    tnapi->wakeup_thresh >= ering->tx_pending)
> +			tnapi->wakeup_thresh = MAX_SKB_FRAGS + 1;
> +	}
>