DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix MTU configuration before device start
@ 2021-10-24 16:42 Andrew Rybchenko
  2021-10-25 18:06 ` Ajit Khaparde
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Rybchenko @ 2021-10-24 16:42 UTC (permalink / raw)
  To: Xiaoyun Li, Rosen Xu, Ajit Khaparde, Ferruh Yigit,
	Konstantin Ananyev, Ivan Ilchenko
  Cc: dev

There is no point to do rte_eth_dev_mtu_set() before configure since
set MTU value is overwritten on configure anyway. So, setting of MTU
before configure is rejected now on ethdev level.

If testpmd is going to do configure (e.g. just after testpmd start
with disabled devices start up or any configuration changes in stopped
state which require reconfigure), just save requested MTU in device
config to be applied on reconfigure.

Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length")
Fixes: be0433cf953c ("ethdev: forbid MTU set before device configure")

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 app/test-pmd/config.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index a18871d461..3b97164302 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1241,10 +1241,12 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 
-	diag = rte_eth_dev_set_mtu(port_id, mtu);
-	if (diag != 0) {
-		fprintf(stderr, "Set MTU failed. diag=%d\n", diag);
-		return;
+	if (port->need_reconfig == 0) {
+		diag = rte_eth_dev_set_mtu(port_id, mtu);
+		if (diag != 0) {
+			fprintf(stderr, "Set MTU failed. diag=%d\n", diag);
+			return;
+		}
 	}
 
 	port->dev_conf.rxmode.mtu = mtu;
-- 
2.30.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-10  7:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-24 16:42 [dpdk-dev] [PATCH] app/testpmd: fix MTU configuration before device start Andrew Rybchenko
2021-10-25 18:06 ` Ajit Khaparde
2021-10-28 18:23   ` Ferruh Yigit
2021-11-02  2:37     ` Jiang, YuX
2021-11-10  7:23       ` Jiang, YuX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).