Re: [PATCH net v4 4/4] tg3: Fix tx_pending checks for tg3_tso_bug
From: Prashant Sreedharan <hidden>
Date: 2014-08-29 02:54:17
Also in:
lkml
From: Prashant Sreedharan <hidden>
Date: 2014-08-29 02:54:17
Also in:
lkml
if (netif_running(dev)) {@@ -12346,8 +12380,15 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e if (tg3_flag(tp, JUMBO_RING_ENABLE)) tp->rx_jumbo_pending = ering->rx_jumbo_pending; - 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)) && + tnapi->wakeup_thresh >= ering->tx_pending) + tnapi->wakeup_thresh = MAX_SKB_FRAGS + 1;
To maintain consistency wakeup_thresh can be set to TG3_TX_WAKEUP_THRESH similar to other parts of the code, except the special handling of tg3_tso_bug() estimate.
+ } if (netif_running(dev)) { tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);@@ -17822,6 +17863,7 @@ static int tg3_init_one(struct pci_dev *pdev, else sndmbx += 0xc; }