DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix transmitted packets statistics counter
@ 2019-10-14 15:39 Viacheslav Ovsiienko
  2019-10-20  7:54 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Viacheslav Ovsiienko @ 2019-10-14 15:39 UTC (permalink / raw)
  To: dev; +Cc: matan, rasland, stable

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>
---
 drivers/net/mlx5/mlx5_rxtx.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index f23708c..184fe9d 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -4568,7 +4568,7 @@ enum mlx5_txcmp_code {
 	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 @@ enum mlx5_txcmp_code {
 	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 @@ enum mlx5_txcmp_code {
 		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 @@ enum mlx5_txcmp_code {
 		 */
 		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;
 }
 
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: fix transmitted packets statistics counter
  2019-10-14 15:39 [dpdk-dev] [PATCH] net/mlx5: fix transmitted packets statistics counter Viacheslav Ovsiienko
@ 2019-10-20  7:54 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2019-10-20  7:54 UTC (permalink / raw)
  To: Slava Ovsiienko, dev; +Cc: Matan Azrad, stable

Hi,

> -----Original Message-----
> From: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> Sent: Monday, October 14, 2019 6:39 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@mellanox.com>; Raslan Darawsheh
> <rasland@mellanox.com>; stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix transmitted packets statistics counter
> 
> 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>


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-20  7:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-14 15:39 [dpdk-dev] [PATCH] net/mlx5: fix transmitted packets statistics counter Viacheslav Ovsiienko
2019-10-20  7:54 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).