[dpdk-stable] patch 'app/testpmd: update Rx offload after setting MTU' has been queued to stable release 19.11.1
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Feb 17 18:45:36 CET 2020
Hi,
FYI, your patch has been queued to stable release 19.11.1
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/19/20. 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.
Thanks.
Luca Boccassi
---
>From 97293db4409daeac55b1f5f019eea30f47e97d6c Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei at huawei.com>
Date: Thu, 13 Feb 2020 09:57:43 +0800
Subject: [PATCH] app/testpmd: update Rx offload after setting MTU
[ upstream commit 150c9ac2df13b1ab1a0ad723f74004346d8ecd65 ]
Currently, Rx offload capabilities and max_rx_pkt_len in the struct
variable named rte_port are not updated after setting mtu successfully
in port_mtu_set function by 'port config mtu <port_id> <value>' command.
This may lead to reconfig mtu to the initial value in the driver when
recalling rte_eth_dev_configure API interface.
This patch updates Rx offload capabilities and max_rx_pkt_len after
setting mtu successfully when configuring mtu.
Fixes: ae03d0d18adf ("app/testpmd: command to configure MTU")
Signed-off-by: Huisong Li <lihuisong at huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
app/test-pmd/config.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 8c86217796..62e547be09 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1216,7 +1216,9 @@ void
port_mtu_set(portid_t port_id, uint16_t mtu)
{
int diag;
+ struct rte_port *rte_port = &ports[port_id];
struct rte_eth_dev_info dev_info;
+ uint16_t eth_overhead;
int ret;
if (port_id_is_invalid(port_id, ENABLED_WARN))
@@ -1232,8 +1234,25 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
return;
}
diag = rte_eth_dev_set_mtu(port_id, mtu);
- if (diag == 0)
+ if (diag == 0 &&
+ dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME) {
+ /*
+ * Ether overhead in driver is equal to the difference of
+ * max_rx_pktlen and max_mtu in rte_eth_dev_info when the
+ * device supports jumbo frame.
+ */
+ eth_overhead = dev_info.max_rx_pktlen - dev_info.max_mtu;
+ if (mtu > RTE_ETHER_MAX_LEN - eth_overhead) {
+ rte_port->dev_conf.rxmode.offloads |=
+ DEV_RX_OFFLOAD_JUMBO_FRAME;
+ rte_port->dev_conf.rxmode.max_rx_pkt_len =
+ mtu + eth_overhead;
+ } else
+ rte_port->dev_conf.rxmode.offloads &=
+ ~DEV_RX_OFFLOAD_JUMBO_FRAME;
+
return;
+ }
printf("Set MTU failed. diag=%d\n", diag);
}
--
2.20.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2020-02-17 17:00:16.538346827 +0000
+++ 0044-app-testpmd-update-Rx-offload-after-setting-MTU.patch 2020-02-17 17:00:15.367951305 +0000
@@ -1,8 +1,10 @@
-From 150c9ac2df13b1ab1a0ad723f74004346d8ecd65 Mon Sep 17 00:00:00 2001
+From 97293db4409daeac55b1f5f019eea30f47e97d6c Mon Sep 17 00:00:00 2001
From: "Wei Hu (Xavier)" <xavier.huwei at huawei.com>
Date: Thu, 13 Feb 2020 09:57:43 +0800
Subject: [PATCH] app/testpmd: update Rx offload after setting MTU
+[ upstream commit 150c9ac2df13b1ab1a0ad723f74004346d8ecd65 ]
+
Currently, Rx offload capabilities and max_rx_pkt_len in the struct
variable named rte_port are not updated after setting mtu successfully
in port_mtu_set function by 'port config mtu <port_id> <value>' command.
@@ -13,7 +15,6 @@
setting mtu successfully when configuring mtu.
Fixes: ae03d0d18adf ("app/testpmd: command to configure MTU")
-Cc: stable at dpdk.org
Signed-off-by: Huisong Li <lihuisong at huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
@@ -23,10 +24,10 @@
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
-index f9c55a2260..9d95202233 100644
+index 8c86217796..62e547be09 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
-@@ -1215,7 +1215,9 @@ void
+@@ -1216,7 +1216,9 @@ void
port_mtu_set(portid_t port_id, uint16_t mtu)
{
int diag;
@@ -36,7 +37,7 @@
int ret;
if (port_id_is_invalid(port_id, ENABLED_WARN))
-@@ -1231,8 +1233,25 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
+@@ -1232,8 +1234,25 @@ port_mtu_set(portid_t port_id, uint16_t mtu)
return;
}
diag = rte_eth_dev_set_mtu(port_id, mtu);
More information about the stable
mailing list