Skip to contentSkip to conversation

app/testpmd: revert setting MTU explicitly after configure

PATCH In review Ferruh Yigit 2 participants 3 messages Nov 16, 2020 – Nov 20, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd: revert setting MTU explicitly after configure

Setting MTU after each 'rte_eth_dev_configure()' prevents using "--max-pkt-len=N" parameter and "port config all max-pkt-len #" command

This is breaking DTS scatter test case which is using "--max-pkt-len=9000" testpmd parameter.

Reverting workaround to recover the DTS testcase.

Fixes 1c21ee95cf52 ("app/testpmd: fix MTU after device configure")
---
 app/test-pmd/testpmd.c | 19 -------------------
 1 file changed, 19 deletions(-)
app/test-pmd/testpmd.c +0 -19
index 48e9647fc7..33fc0fddf5 100644
@@ -2537,8 +2537,6 @@ start_port(portid_t pid)
 		}
 
 		if (port->need_reconfig > 0) {
-			uint16_t mtu = RTE_ETHER_MTU;
-
 			port->need_reconfig = 0;
 
 			if (flow_isolate_all) {
@@ -2572,23 +2570,6 @@ start_port(portid_t pid)
 				port->need_reconfig = 1;
 				return -1;
 			}
-
-			/*
-			 * Workaround for rte_eth_dev_configure(), max_rx_pkt_len
-			 * set MTU wrong for the PMDs that have frame overhead
-			 * bigger than RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN.
-			 * For a PMD that has 26 bytes overhead, rte_eth_dev_configure()
-			 * can set MTU to max 1492, not to expected 1500 bytes.
-			 * Using rte_eth_dev_set_mtu() to be able to set MTU correctly,
-			 * default MTU value is 1500.
-			 */
-			diag = rte_eth_dev_get_mtu(pi, &mtu);
-			if (diag)
-				printf("Failed to get MTU for port %d\n", pi);
-			diag = rte_eth_dev_set_mtu(pi, mtu);
-			if (diag != 0 && diag != -ENOTSUP)
-				printf("Failed to set MTU to %u for port %d\n",
-						mtu, pi);
 		}
 		if (port->need_reconfig_queues > 0) {
 			port->need_reconfig_queues = 0;
Signature · 1 line
2.26.2
Tested-by on v1 1/1
#1 lore raw

Thanks.

Regards,
Chen Bo

Quoted 73 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ferruh Yigit
Sent: November 17, 2020 3:04
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Zhang, Qi Z <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: Yigit, Ferruh <[email protected]>; [email protected]; [email protected]
Subject: [dpdk-dev] [PATCH] app/testpmd: revert setting MTU explicitly after configure

Setting MTU after each 'rte_eth_dev_configure()' prevents using "--max- pkt-len=N" parameter and "port config all max-pkt-len #" command

This is breaking DTS scatter test case which is using "--max-pkt-len=9000" testpmd parameter.

Reverting workaround to recover the DTS testcase.

Fixes 1c21ee95cf52 ("app/testpmd: fix MTU after device configure")
---
 app/test-pmd/testpmd.c | 19 -------------------
 1 file changed, 19 deletions(-)
app/test-pmd/testpmd.c index renamed from app/test-pmd/testpmd.c +0 -0

48e9647fc7..33fc0fddf5 100644

app/test-pmd/testpmd.c +0 -5
@@ -2537,8 +2537,6 @@ start_port(portid_t pid)
 		}
 
 		if (port->need_reconfig > 0) {
-			uint16_t mtu = RTE_ETHER_MTU;
-
 			port->need_reconfig = 0;
 
 			if (flow_isolate_all) {
@@ -2572,23 +2570,6 @@ start_port(portid_t pid)
 				port->need_reconfig = 1;
 				return -1;
 			}
-
-			/*
-			 * Workaround for rte_eth_dev_configure(),

max_rx_pkt_len

app/test-pmd/testpmd.c +0 -1
-			 * set MTU wrong for the PMDs that have frame

overhead

app/test-pmd/testpmd.c +0 -1
-			 * bigger than RTE_ETHER_HDR_LEN +

RTE_ETHER_CRC_LEN.

app/test-pmd/testpmd.c +0 -1
-			 * For a PMD that has 26 bytes overhead,

rte_eth_dev_configure()

app/test-pmd/testpmd.c +0 -1
-			 * can set MTU to max 1492, not to expected 1500

bytes.

app/test-pmd/testpmd.c +0 -1
-			 * Using rte_eth_dev_set_mtu() to be able to set

MTU correctly,

app/test-pmd/testpmd.c +0 -8
-			 * default MTU value is 1500.
-			 */
-			diag = rte_eth_dev_get_mtu(pi, &mtu);
-			if (diag)
-				printf("Failed to get MTU for port %d\n", pi);
-			diag = rte_eth_dev_set_mtu(pi, mtu);
-			if (diag != 0 && diag != -ENOTSUP)
-				printf("Failed to set MTU to %u for

port %d\n",

app/test-pmd/testpmd.c +0 -2
-						mtu, pi);
 		}
 		if (port->need_reconfig_queues > 0) {
 			port->need_reconfig_queues = 0;
--

2.26.2

author Applied
#2 lore raw
Quoted 18 lines · BoX C
Quoted 18 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ferruh Yigit
Sent: November 17, 2020 3:04
To: Lu, Wenzhuo <[email protected]>; Xing, Beilei <[email protected]>; Iremonger, Bernard <[email protected]>; Zhang, Qi Z <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: Yigit, Ferruh <[email protected]>; [email protected]; [email protected]
Subject: [dpdk-dev] [PATCH] app/testpmd: revert setting MTU explicitly after configure

Setting MTU after each 'rte_eth_dev_configure()' prevents using "--max- pkt-len=N" parameter and "port config all max-pkt-len #" command

This is breaking DTS scatter test case which is using "--max-pkt-len=9000" testpmd parameter.

Quoted 9 lines
Quoted 6 lines

Reverting workaround to recover the DTS testcase.

Fixes 1c21ee95cf52 ("app/testpmd: fix MTU after device configure")

Thanks.

Applied to dpdk-next-net/main, thanks.