diff options
author | Prashant Sreedharan <prashant@broadcom.com> | 2014-10-13 09:21:42 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-14 15:59:37 -0400 |
commit | 2c7c9ea429ba30fe506747b7da110e2212d8fefa (patch) | |
tree | 1df0acea19971b65dfc9b963b7ed99467e930dad /drivers/net/ethernet/broadcom/tg3.c | |
parent | f76936d07c4eeb36d8dbb64ebd30ab46ff85d9f7 (diff) | |
download | linux-stable-2c7c9ea429ba30fe506747b7da110e2212d8fefa.tar.gz linux-stable-2c7c9ea429ba30fe506747b7da110e2212d8fefa.tar.bz2 linux-stable-2c7c9ea429ba30fe506747b7da110e2212d8fefa.zip |
tg3: Add skb->xmit_more support
Ring TX doorbell only if xmit_more is not set or the queue is stopped.
Suggested-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Prashant Sreedharan <prashant@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/tg3.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index ba499489969a..dbb41c1923e6 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -8099,9 +8099,6 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) /* Sync BD data before updating mailbox */ wmb(); - /* Packets are ready, update Tx producer idx local and on card. */ - tw32_tx_mbox(tnapi->prodmbox, entry); - tnapi->tx_prod = entry; if (unlikely(tg3_tx_avail(tnapi) <= (MAX_SKB_FRAGS + 1))) { netif_tx_stop_queue(txq); @@ -8116,7 +8113,12 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) netif_tx_wake_queue(txq); } - mmiowb(); + if (!skb->xmit_more || netif_xmit_stopped(txq)) { + /* Packets are ready, update Tx producer idx on card. */ + tw32_tx_mbox(tnapi->prodmbox, entry); + mmiowb(); + } + return NETDEV_TX_OK; dma_error: |