summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViacheslav Ovsiienko <viacheslavo@mellanox.com>2019-10-14 15:39:14 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-20 15:43:28 +0100
commiteabfc776b329797b1a5516c3ffb101a181255a52 (patch)
tree4428e174a64eb03584cffe5cd558352aa7b5b02b
parent5d5f71574b3045920b2f9318d5607e5bfdb29974 (diff)
downloaddpdk-next-net-intel-eabfc776b329797b1a5516c3ffb101a181255a52.zip
dpdk-next-net-intel-eabfc776b329797b1a5516c3ffb101a181255a52.tar.gz
dpdk-next-net-intel-eabfc776b329797b1a5516c3ffb101a181255a52.tar.xz
net/mlx5: fix Tx packets statistics
The transmitter packets counter was not updated correctly in the loop inside the tx_burst routines. Fixes: f32a3f5216a3 ("net/mlx5: fix completion queue overflow for large burst") Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
-rw-r--r--drivers/net/mlx5/mlx5_rxtx.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 10d0ca1..20c1946 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -4568,7 +4568,7 @@ send_loop:
loc.wqe_free = txq->wqe_s -
(uint16_t)(txq->wqe_ci - txq->wqe_pi);
if (unlikely(!loc.elts_free || !loc.wqe_free))
- return loc.pkts_sent;
+ goto burst_exit;
for (;;) {
/*
* Fetch the packet from array. Usually this is
@@ -4735,7 +4735,7 @@ enter_send_single:
assert(MLX5_TXOFF_CONFIG(INLINE) || loc.pkts_sent >= loc.pkts_copy);
/* Take a shortcut if nothing is sent. */
if (unlikely(loc.pkts_sent == loc.pkts_loop))
- return loc.pkts_sent;
+ goto burst_exit;
/*
* Ring QP doorbell immediately after WQE building completion
* to improve latencies. The pure software related data treatment
@@ -4758,10 +4758,6 @@ enter_send_single:
mlx5_tx_copy_elts(txq, pkts + loc.pkts_copy, part, olx);
loc.pkts_copy = loc.pkts_sent;
}
-#ifdef MLX5_PMD_SOFT_COUNTERS
- /* Increment sent packets counter. */
- txq->stats.opackets += loc.pkts_sent;
-#endif
assert(txq->elts_s >= (uint16_t)(txq->elts_head - txq->elts_tail));
assert(txq->wqe_s >= (uint16_t)(txq->wqe_ci - txq->wqe_pi));
if (pkts_n > loc.pkts_sent) {
@@ -4772,6 +4768,11 @@ enter_send_single:
*/
goto send_loop;
}
+burst_exit:
+#ifdef MLX5_PMD_SOFT_COUNTERS
+ /* Increment sent packets counter. */
+ txq->stats.opackets += loc.pkts_sent;
+#endif
return loc.pkts_sent;
}