Commit 10b3ad8c authored by David S. Miller's avatar David S. Miller

net: Do txq_trans_update() in netdev_start_xmit()

That way we don't have to audit every call site to make sure it is
doing this properly.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dace1b54
...@@ -192,8 +192,10 @@ static netdev_tx_t dlci_transmit(struct sk_buff *skb, struct net_device *dev) ...@@ -192,8 +192,10 @@ static netdev_tx_t dlci_transmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct dlci_local *dlp = netdev_priv(dev); struct dlci_local *dlp = netdev_priv(dev);
if (skb) if (skb) {
netdev_start_xmit(skb, dlp->slave); struct netdev_queue *txq = skb_get_tx_queue(dev, skb);
netdev_start_xmit(skb, dlp->slave, txq);
}
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
......
...@@ -3437,11 +3437,17 @@ static inline netdev_tx_t __netdev_start_xmit(const struct net_device_ops *ops, ...@@ -3437,11 +3437,17 @@ static inline netdev_tx_t __netdev_start_xmit(const struct net_device_ops *ops,
return ops->ndo_start_xmit(skb, dev); return ops->ndo_start_xmit(skb, dev);
} }
static inline netdev_tx_t netdev_start_xmit(struct sk_buff *skb, struct net_device *dev) static inline netdev_tx_t netdev_start_xmit(struct sk_buff *skb, struct net_device *dev,
struct netdev_queue *txq)
{ {
const struct net_device_ops *ops = dev->netdev_ops; const struct net_device_ops *ops = dev->netdev_ops;
int rc;
return __netdev_start_xmit(ops, skb, dev); rc = __netdev_start_xmit(ops, skb, dev);
if (rc == NETDEV_TX_OK)
txq_trans_update(txq);
return rc;
} }
int netdev_class_create_file_ns(struct class_attribute *class_attr, int netdev_class_create_file_ns(struct class_attribute *class_attr,
......
...@@ -2666,10 +2666,8 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, ...@@ -2666,10 +2666,8 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
skb_len = skb->len; skb_len = skb->len;
trace_net_dev_start_xmit(skb, dev); trace_net_dev_start_xmit(skb, dev);
rc = netdev_start_xmit(skb, dev); rc = netdev_start_xmit(skb, dev, txq);
trace_net_dev_xmit(skb, rc, dev, skb_len); trace_net_dev_xmit(skb, rc, dev, skb_len);
if (rc == NETDEV_TX_OK)
txq_trans_update(txq);
return rc; return rc;
} }
...@@ -2685,7 +2683,7 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, ...@@ -2685,7 +2683,7 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
skb_len = nskb->len; skb_len = nskb->len;
trace_net_dev_start_xmit(nskb, dev); trace_net_dev_start_xmit(nskb, dev);
rc = netdev_start_xmit(nskb, dev); rc = netdev_start_xmit(nskb, dev, txq);
trace_net_dev_xmit(nskb, rc, dev, skb_len); trace_net_dev_xmit(nskb, rc, dev, skb_len);
if (unlikely(rc != NETDEV_TX_OK)) { if (unlikely(rc != NETDEV_TX_OK)) {
if (rc & ~NETDEV_TX_MASK) if (rc & ~NETDEV_TX_MASK)
...@@ -2694,7 +2692,6 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, ...@@ -2694,7 +2692,6 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
skb->next = nskb; skb->next = nskb;
return rc; return rc;
} }
txq_trans_update(txq);
if (unlikely(netif_xmit_stopped(txq) && skb->next)) if (unlikely(netif_xmit_stopped(txq) && skb->next))
return NETDEV_TX_BUSY; return NETDEV_TX_BUSY;
} while (skb->next); } while (skb->next);
......
...@@ -91,9 +91,7 @@ static int netpoll_start_xmit(struct sk_buff *skb, struct net_device *dev, ...@@ -91,9 +91,7 @@ static int netpoll_start_xmit(struct sk_buff *skb, struct net_device *dev,
skb->vlan_tci = 0; skb->vlan_tci = 0;
} }
status = netdev_start_xmit(skb, dev); status = netdev_start_xmit(skb, dev, txq);
if (status == NETDEV_TX_OK)
txq_trans_update(txq);
out: out:
return status; return status;
......
...@@ -3335,11 +3335,10 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev) ...@@ -3335,11 +3335,10 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
goto unlock; goto unlock;
} }
atomic_inc(&(pkt_dev->skb->users)); atomic_inc(&(pkt_dev->skb->users));
ret = netdev_start_xmit(pkt_dev->skb, odev); ret = netdev_start_xmit(pkt_dev->skb, odev, txq);
switch (ret) { switch (ret) {
case NETDEV_TX_OK: case NETDEV_TX_OK:
txq_trans_update(txq);
pkt_dev->last_ok = 1; pkt_dev->last_ok = 1;
pkt_dev->sofar++; pkt_dev->sofar++;
pkt_dev->seq_num++; pkt_dev->seq_num++;
......
...@@ -258,11 +258,8 @@ static int packet_direct_xmit(struct sk_buff *skb) ...@@ -258,11 +258,8 @@ static int packet_direct_xmit(struct sk_buff *skb)
local_bh_disable(); local_bh_disable();
HARD_TX_LOCK(dev, txq, smp_processor_id()); HARD_TX_LOCK(dev, txq, smp_processor_id());
if (!netif_xmit_frozen_or_drv_stopped(txq)) { if (!netif_xmit_frozen_or_drv_stopped(txq))
ret = netdev_start_xmit(skb, dev); ret = netdev_start_xmit(skb, dev, txq);
if (ret == NETDEV_TX_OK)
txq_trans_update(txq);
}
HARD_TX_UNLOCK(dev, txq); HARD_TX_UNLOCK(dev, txq);
local_bh_enable(); local_bh_enable();
......
...@@ -316,8 +316,7 @@ static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -316,8 +316,7 @@ static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev)
unsigned int length = qdisc_pkt_len(skb); unsigned int length = qdisc_pkt_len(skb);
if (!netif_xmit_frozen_or_stopped(slave_txq) && if (!netif_xmit_frozen_or_stopped(slave_txq) &&
netdev_start_xmit(skb, slave) == NETDEV_TX_OK) { netdev_start_xmit(skb, slave, slave_txq) == NETDEV_TX_OK) {
txq_trans_update(slave_txq);
__netif_tx_unlock(slave_txq); __netif_tx_unlock(slave_txq);
master->slaves = NEXT_SLAVE(q); master->slaves = NEXT_SLAVE(q);
netif_wake_queue(dev); netif_wake_queue(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment