Skip to content

Commit

Permalink
app/testpmd: revert setting MTU explicitly after configure
Browse files Browse the repository at this point in the history
[ upstream commit 56f0534 ]

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: 1c21ee9 ("app/testpmd: fix MTU after device configure")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Bo Chen <box.c.chen@intel.com>
  • Loading branch information
Ferruh Yigit authored and bluca committed Nov 24, 2020
1 parent 6de0c15 commit bdc1ebe
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions app/test-pmd/testpmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2334,8 +2334,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) {
Expand Down Expand Up @@ -2369,23 +2367,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;
Expand Down

0 comments on commit bdc1ebe

Please sign in to comment.