app/testpmd: revert setting MTU explicitly after configure

Message ID 20201116190355.3390447-1-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series app/testpmd: revert setting MTU explicitly after configure |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Ferruh Yigit Nov. 16, 2020, 7:03 p.m. UTC
  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")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test-pmd/testpmd.c | 19 -------------------
 1 file changed, 19 deletions(-)
  

Comments

Chen, BoX C Nov. 20, 2020, 1:51 a.m. UTC | #1
Tested-by: Chen, BoX C <BoX.C.Chen@intel.com>
Thanks.

Regards,
Chen Bo

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Ferruh Yigit
> Sent: November 17, 2020 3:04
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; dev@dpdk.org; stable@dpdk.org
> 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
>  app/test-pmd/testpmd.c | 19 -------------------
>  1 file changed, 19 deletions(-)
> 
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> 48e9647fc7..33fc0fddf5 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -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;
> --
> 2.26.2
  
Ferruh Yigit Nov. 20, 2020, 12:07 p.m. UTC | #2
On 11/20/2020 1:51 AM, Chen, BoX C wrote:

> 
>> -----Original Message-----
>> From: dev <dev-bounces@dpdk.org> On Behalf Of Ferruh Yigit
>> Sent: November 17, 2020 3:04
>> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Xing, Beilei
>> <beilei.xing@intel.com>; Iremonger, Bernard
>> <bernard.iremonger@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
>> Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
>> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; dev@dpdk.org; stable@dpdk.org
>> 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")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
 > Tested-by: Chen, BoX C <BoX.C.Chen@intel.com>
 > Thanks.
 >

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

Patch

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 48e9647fc7..33fc0fddf5 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -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;