Commit fc96256c authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net/mlx4_en: fix spurious timestamping callbacks

When multiple skb are TX-completed in a row, we might incorrectly keep
a timestamp of a prior skb and cause extra work.

Fixes: ec693d47 ("net/mlx4_en: Add HW timestamping (TS) support")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Reviewed-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9f5db535
...@@ -405,7 +405,6 @@ static bool mlx4_en_process_tx_cq(struct net_device *dev, ...@@ -405,7 +405,6 @@ static bool mlx4_en_process_tx_cq(struct net_device *dev,
u32 packets = 0; u32 packets = 0;
u32 bytes = 0; u32 bytes = 0;
int factor = priv->cqe_factor; int factor = priv->cqe_factor;
u64 timestamp = 0;
int done = 0; int done = 0;
int budget = priv->tx_work_limit; int budget = priv->tx_work_limit;
u32 last_nr_txbb; u32 last_nr_txbb;
...@@ -445,9 +444,12 @@ static bool mlx4_en_process_tx_cq(struct net_device *dev, ...@@ -445,9 +444,12 @@ static bool mlx4_en_process_tx_cq(struct net_device *dev,
new_index = be16_to_cpu(cqe->wqe_index) & size_mask; new_index = be16_to_cpu(cqe->wqe_index) & size_mask;
do { do {
u64 timestamp = 0;
txbbs_skipped += last_nr_txbb; txbbs_skipped += last_nr_txbb;
ring_index = (ring_index + last_nr_txbb) & size_mask; ring_index = (ring_index + last_nr_txbb) & size_mask;
if (ring->tx_info[ring_index].ts_requested)
if (unlikely(ring->tx_info[ring_index].ts_requested))
timestamp = mlx4_en_get_cqe_ts(cqe); timestamp = mlx4_en_get_cqe_ts(cqe);
/* free next descriptor */ /* free next descriptor */
......
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