diff options
author | Eric Dumazet <edumazet@google.com> | 2014-10-08 08:19:27 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-08 16:08:04 -0400 |
commit | 535114539bb2c081b6680cb5a34be17e7b45df37 (patch) | |
tree | f23c322826074ddd2eb0cbb84104210996746570 /drivers/net/ethernet/mellanox | |
parent | 709c48b39ecf11a81f3820c13a828c330fd832b9 (diff) |
net: add netdev_txq_bql_{enqueue, complete}_prefetchw() helpers
Add two helpers so that drivers do not have to care of BQL being
available or not.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Jim Davis <jim.epost@gmail.com>
Fixes: 29d40c903247 ("net/mlx4_en: Use prefetch in tx path")
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_tx.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c index 8726a4aee5a7..34c137878545 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c @@ -392,7 +392,8 @@ static bool mlx4_en_process_tx_cq(struct net_device *dev, if (!priv->port_up) return true; - prefetchw(&ring->tx_queue->dql.limit); + netdev_txq_bql_complete_prefetchw(ring->tx_queue); + index = cons_index & size_mask; cqe = mlx4_en_get_cqe(buf, index, priv->cqe_size) + factor; last_nr_txbb = ACCESS_ONCE(ring->last_nr_txbb); @@ -737,7 +738,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) vlan_tag = vlan_tx_tag_get(skb); - prefetchw(&ring->tx_queue->dql); + netdev_txq_bql_enqueue_prefetchw(ring->tx_queue); /* Track current inflight packets for performance analysis */ AVG_PERF_COUNTER(priv->pstats.inflight_avg, |