diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-05-26 01:58:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-26 01:58:01 -0400 |
commit | 08baf561083bc27a953aa087dd8a664bb2b88e8e (patch) | |
tree | 979d92224e21b69368a27bb684b74b3d4d744183 /net/core/dev.c | |
parent | 65ac8851490ec97a96759af729132c96f925a795 (diff) |
net: txq_trans_update() helper
We would like to get rid of netdev->trans_start = jiffies; that about all net
drivers have to use in their start_xmit() function, and use txq->trans_start
instead.
This can be done generically in core network, as suggested by David.
Some devices, (particularly loopback) dont need trans_start update, because
they dont have transmit watchdog. We could add a new device flag, or rely
on fact that txq->tran_start can be updated is txq->xmit_lock_owner is
different than -1. Use a helper function to hide our choice.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 241613f6dd2f..5eb3e48ab31d 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1698,6 +1698,8 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, | |||
1698 | skb->dst = NULL; | 1698 | skb->dst = NULL; |
1699 | } | 1699 | } |
1700 | rc = ops->ndo_start_xmit(skb, dev); | 1700 | rc = ops->ndo_start_xmit(skb, dev); |
1701 | if (rc == 0) | ||
1702 | txq_trans_update(txq); | ||
1701 | /* | 1703 | /* |
1702 | * TODO: if skb_orphan() was called by | 1704 | * TODO: if skb_orphan() was called by |
1703 | * dev->hard_start_xmit() (for example, the unmodified | 1705 | * dev->hard_start_xmit() (for example, the unmodified |
@@ -1727,6 +1729,7 @@ gso: | |||
1727 | skb->next = nskb; | 1729 | skb->next = nskb; |
1728 | return rc; | 1730 | return rc; |
1729 | } | 1731 | } |
1732 | txq_trans_update(txq); | ||
1730 | if (unlikely(netif_tx_queue_stopped(txq) && skb->next)) | 1733 | if (unlikely(netif_tx_queue_stopped(txq) && skb->next)) |
1731 | return NETDEV_TX_BUSY; | 1734 | return NETDEV_TX_BUSY; |
1732 | } while (skb->next); | 1735 | } while (skb->next); |