patch 'examples/dma: fix Tx drop statistics' has been queued to stable release 20.11.6

Xueming Li xuemingl at nvidia.com
Tue Jun 21 10:02:50 CEST 2022


Hi,

FYI, your patch has been queued to stable release 20.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/14a272633109c98fe5c1fdf47385c45b974561e9

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 14a272633109c98fe5c1fdf47385c45b974561e9 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen at huawei.com>
Date: Sun, 24 Apr 2022 14:07:40 +0800
Subject: [PATCH] examples/dma: fix Tx drop statistics
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 7d3cb76fba200e1649842319facb932d9a05467d ]

The Tx drop statistic was designed to be collected by
rte_eth_dev_tx_buffer mechanism, but the application uses
rte_eth_tx_burst to send packets and this lead the Tx drop statistic
was not collected.

This patch removes rte_eth_dev_tx_buffer mechanism to fix the problem.

Fixes: 632bcd9b5d4f ("examples/ioat: print statistics")

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Kevin Laatz <kevin.laatz at intel.com>
---
 examples/ioat/ioatfwd.c | 27 +++++----------------------
 1 file changed, 5 insertions(+), 22 deletions(-)

diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c
index 4bf37642dc..e30df8118a 100644
--- a/examples/ioat/ioatfwd.c
+++ b/examples/ioat/ioatfwd.c
@@ -103,7 +103,6 @@ static volatile bool force_quit;
 /* ethernet addresses of ports */
 static struct rte_ether_addr ioat_ports_eth_addr[RTE_MAX_ETHPORTS];
 
-static struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
 struct rte_mempool *ioat_pktmbuf_pool;
 
 /* Print out statistics for one port. */
@@ -478,11 +477,14 @@ ioat_tx_port(struct rxtx_port_config *tx_config)
 
 		port_statistics.tx[tx_config->rxtx_port] += nb_tx;
 
-		/* Free any unsent packets. */
-		if (unlikely(nb_tx < nb_dq))
+		if (unlikely(nb_tx < nb_dq)) {
+			port_statistics.tx_dropped[tx_config->rxtx_port] +=
+				(nb_dq - nb_tx);
+			/* Free any unsent packets. */
 			rte_mempool_put_bulk(ioat_pktmbuf_pool,
 			(void *)&mbufs_dst[nb_tx],
 				nb_dq - nb_tx);
+		}
 	}
 }
 
@@ -873,25 +875,6 @@ port_init(uint16_t portid, struct rte_mempool *mbuf_pool, uint16_t nb_queues)
 			"rte_eth_tx_queue_setup:err=%d,port=%u\n",
 			ret, portid);
 
-	/* Initialize TX buffers */
-	tx_buffer[portid] = rte_zmalloc_socket("tx_buffer",
-			RTE_ETH_TX_BUFFER_SIZE(MAX_PKT_BURST), 0,
-			rte_eth_dev_socket_id(portid));
-	if (tx_buffer[portid] == NULL)
-		rte_exit(EXIT_FAILURE,
-			"Cannot allocate buffer for tx on port %u\n",
-			portid);
-
-	rte_eth_tx_buffer_init(tx_buffer[portid], MAX_PKT_BURST);
-
-	ret = rte_eth_tx_buffer_set_err_callback(tx_buffer[portid],
-		rte_eth_tx_buffer_count_callback,
-		&port_statistics.tx_dropped[portid]);
-	if (ret < 0)
-		rte_exit(EXIT_FAILURE,
-			"Cannot set error callback for tx buffer on port %u\n",
-			portid);
-
 	/* Start device */
 	ret = rte_eth_dev_start(portid);
 	if (ret < 0)
-- 
2.35.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-21 15:37:53.863814577 +0800
+++ 0104-examples-dma-fix-Tx-drop-statistics.patch	2022-06-21 15:37:49.221118569 +0800
@@ -1 +1 @@
-From 7d3cb76fba200e1649842319facb932d9a05467d Mon Sep 17 00:00:00 2001
+From 14a272633109c98fe5c1fdf47385c45b974561e9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 7d3cb76fba200e1649842319facb932d9a05467d ]
@@ -14 +16,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
- examples/dma/dmafwd.c | 27 +++++----------------------
+ examples/ioat/ioatfwd.c | 27 +++++----------------------
@@ -23,5 +25,5 @@
-diff --git a/examples/dma/dmafwd.c b/examples/dma/dmafwd.c
-index a03ca05129..dd576bcf77 100644
---- a/examples/dma/dmafwd.c
-+++ b/examples/dma/dmafwd.c
-@@ -122,7 +122,6 @@ static uint32_t max_frame_size;
+diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c
+index 4bf37642dc..e30df8118a 100644
+--- a/examples/ioat/ioatfwd.c
++++ b/examples/ioat/ioatfwd.c
+@@ -103,7 +103,6 @@ static volatile bool force_quit;
@@ -29 +31 @@
- static struct rte_ether_addr dma_ports_eth_addr[RTE_MAX_ETHPORTS];
+ static struct rte_ether_addr ioat_ports_eth_addr[RTE_MAX_ETHPORTS];
@@ -32 +34 @@
- struct rte_mempool *dma_pktmbuf_pool;
+ struct rte_mempool *ioat_pktmbuf_pool;
@@ -35 +37 @@
-@@ -484,10 +483,13 @@ dma_tx_port(struct rxtx_port_config *tx_config)
+@@ -478,11 +477,14 @@ ioat_tx_port(struct rxtx_port_config *tx_config)
@@ -45,2 +47,3 @@
- 			rte_mempool_put_bulk(dma_pktmbuf_pool,
- 			(void *)&mbufs[nb_tx], nb_dq - nb_tx);
+ 			rte_mempool_put_bulk(ioat_pktmbuf_pool,
+ 			(void *)&mbufs_dst[nb_tx],
+ 				nb_dq - nb_tx);
@@ -50,2 +53,2 @@
- /* >8 End of transmitting packets from dmadev. */
-@@ -970,25 +972,6 @@ port_init(uint16_t portid, struct rte_mempool *mbuf_pool, uint16_t nb_queues)
+ 
+@@ -873,25 +875,6 @@ port_init(uint16_t portid, struct rte_mempool *mbuf_pool, uint16_t nb_queues)
@@ -74 +77 @@
- 	/* Start device. 8< */
+ 	/* Start device */


More information about the stable mailing list