[dpdk-stable] patch 'app/testpmd: fix max Rx packet length for VLAN packets' has been queued to stable release 19.11.7

Christian Ehrhardt christian.ehrhardt at canonical.com
Thu Feb 4 12:28:31 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/06/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/a709e6b1df9bd90d7fe7a6f75f1448730b268848

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From a709e6b1df9bd90d7fe7a6f75f1448730b268848 Mon Sep 17 00:00:00 2001
From: Steve Yang <stevex.yang at intel.com>
Date: Mon, 18 Jan 2021 07:04:08 +0000
Subject: [PATCH] app/testpmd: fix max Rx packet length for VLAN packets

[ upstream commit 761c4d66900fd7db6927f57eb610f543cc0908e4 ]

When the max rx packet length is smaller than the sum of mtu size and
ether overhead size, it should be enlarged, otherwise the VLAN packets
will be dropped.

Removed the rx_offloads assignment for jumbo frame during command line
parsing, and set the correct jumbo frame flag if MTU size is larger than
the default value 'RTE_ETHER_MTU' within 'init_config()'.

Fixes: 384161e00627 ("app/testpmd: adjust on the fly VLAN configuration")
Fixes: 35b2d13fd6fd ("net: add rte prefix to ether defines")
Fixes: ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
Fixes: 150c9ac2df13 ("app/testpmd: update Rx offload after setting MTU")

Signed-off-by: Steve Yang <stevex.yang at intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 app/test-pmd/cmdline.c    |  6 ------
 app/test-pmd/config.c     |  2 +-
 app/test-pmd/parameters.c |  7 ++-----
 app/test-pmd/testpmd.c    | 18 ++++++++++++++++++
 4 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 9287fa3ea4..7e1ced7c59 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1983,7 +1983,6 @@ cmd_config_max_pkt_len_parsed(void *parsed_result,
 
 	RTE_ETH_FOREACH_DEV(pid) {
 		struct rte_port *port = &ports[pid];
-		uint64_t rx_offloads = port->dev_conf.rxmode.offloads;
 
 		if (!strcmp(res->name, "max-pkt-len")) {
 			if (res->value < RTE_ETHER_MIN_LEN) {
@@ -1995,11 +1994,6 @@ cmd_config_max_pkt_len_parsed(void *parsed_result,
 				return;
 
 			port->dev_conf.rxmode.max_rx_pkt_len = res->value;
-			if (res->value > RTE_ETHER_MAX_LEN)
-				rx_offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
-			else
-				rx_offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME;
-			port->dev_conf.rxmode.offloads = rx_offloads;
 		} else {
 			printf("Unknown parameter\n");
 			return;
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 5f8905c06a..e14ff42745 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1287,7 +1287,7 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
 		 * device supports jumbo frame.
 		 */
 		eth_overhead = dev_info.max_rx_pktlen - dev_info.max_mtu;
-		if (mtu > RTE_ETHER_MAX_LEN - eth_overhead) {
+		if (mtu > RTE_ETHER_MTU) {
 			rte_port->dev_conf.rxmode.offloads |=
 						DEV_RX_OFFLOAD_JUMBO_FRAME;
 			rte_port->dev_conf.rxmode.max_rx_pkt_len =
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 0eb7844783..a1c08a411a 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -884,12 +884,9 @@ launch_args_parse(int argc, char** argv)
 			}
 			if (!strcmp(lgopts[opt_idx].name, "max-pkt-len")) {
 				n = atoi(optarg);
-				if (n >= RTE_ETHER_MIN_LEN) {
+				if (n >= RTE_ETHER_MIN_LEN)
 					rx_mode.max_rx_pkt_len = (uint32_t) n;
-					if (n > RTE_ETHER_MAX_LEN)
-						rx_offloads |=
-							DEV_RX_OFFLOAD_JUMBO_FRAME;
-				} else
+				else
 					rte_exit(EXIT_FAILURE,
 						 "Invalid max-pkt-len=%d - should be > %d\n",
 						 n, RTE_ETHER_MIN_LEN);
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 8d3b7b2a3b..f93e459ccf 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1301,6 +1301,7 @@ init_config(void)
 	struct rte_gro_param gro_param;
 	uint32_t gso_types;
 	uint16_t data_size;
+	uint16_t eth_overhead;
 	bool warning = 0;
 	int k;
 	int ret;
@@ -1337,6 +1338,23 @@ init_config(void)
 			rte_exit(EXIT_FAILURE,
 				 "rte_eth_dev_info_get() failed\n");
 
+		/* Update the max_rx_pkt_len to have MTU as RTE_ETHER_MTU */
+		if (port->dev_info.max_mtu != UINT16_MAX &&
+		    port->dev_info.max_rx_pktlen > port->dev_info.max_mtu)
+			eth_overhead = port->dev_info.max_rx_pktlen -
+				port->dev_info.max_mtu;
+		else
+			eth_overhead =
+				RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
+
+		if (port->dev_conf.rxmode.max_rx_pkt_len <=
+			(uint32_t)(RTE_ETHER_MTU + eth_overhead))
+			port->dev_conf.rxmode.max_rx_pkt_len =
+					RTE_ETHER_MTU + eth_overhead;
+		else
+			port->dev_conf.rxmode.offloads |=
+					DEV_RX_OFFLOAD_JUMBO_FRAME;
+
 		if (!(port->dev_info.tx_offload_capa &
 		      DEV_TX_OFFLOAD_MBUF_FAST_FREE))
 			port->dev_conf.txmode.offloads &=
-- 
2.30.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-02-04 12:04:30.409753391 +0100
+++ 0056-app-testpmd-fix-max-Rx-packet-length-for-VLAN-packet.patch	2021-02-04 12:04:28.010789709 +0100
@@ -1 +1 @@
-From 761c4d66900fd7db6927f57eb610f543cc0908e4 Mon Sep 17 00:00:00 2001
+From a709e6b1df9bd90d7fe7a6f75f1448730b268848 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 761c4d66900fd7db6927f57eb610f543cc0908e4 ]
+
@@ -18 +19,0 @@
-Cc: stable at dpdk.org
@@ -30 +31 @@
-index 855dbc2dec..89034c8b72 100644
+index 9287fa3ea4..7e1ced7c59 100644
@@ -33 +34 @@
-@@ -1886,7 +1886,6 @@ cmd_config_max_pkt_len_parsed(void *parsed_result,
+@@ -1983,7 +1983,6 @@ cmd_config_max_pkt_len_parsed(void *parsed_result,
@@ -41 +42 @@
-@@ -1898,11 +1897,6 @@ cmd_config_max_pkt_len_parsed(void *parsed_result,
+@@ -1995,11 +1994,6 @@ cmd_config_max_pkt_len_parsed(void *parsed_result,
@@ -54 +55 @@
-index a6a5baa4e1..0e2b9f7d3c 100644
+index 5f8905c06a..e14ff42745 100644
@@ -57 +58 @@
-@@ -1434,7 +1434,7 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
+@@ -1287,7 +1287,7 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
@@ -67 +68 @@
-index 414a0068fb..df5eb10d84 100644
+index 0eb7844783..a1c08a411a 100644
@@ -70 +71 @@
-@@ -834,12 +834,9 @@ launch_args_parse(int argc, char** argv)
+@@ -884,12 +884,9 @@ launch_args_parse(int argc, char** argv)
@@ -86 +87 @@
-index 2b60f6c5d3..c256e719ae 100644
+index 8d3b7b2a3b..f93e459ccf 100644
@@ -89 +90 @@
-@@ -1410,6 +1410,7 @@ init_config(void)
+@@ -1301,6 +1301,7 @@ init_config(void)
@@ -97 +98 @@
-@@ -1446,6 +1447,23 @@ init_config(void)
+@@ -1337,6 +1338,23 @@ init_config(void)


More information about the stable mailing list