[dpdk-stable] patch 'app/testpmd: fix port id check in Tx VLAN command' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Oct 28 11:44:04 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/30/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 ca5779171268ff3d969e2df74252bf69090652a4 Mon Sep 17 00:00:00 2001
From: Chengchang Tang <tangchengchang at huawei.com>
Date: Fri, 25 Sep 2020 20:47:14 +0800
Subject: [PATCH] app/testpmd: fix port id check in Tx VLAN command

[ upstream commit b428e71775e43acc7b074c82b0d9e08f401dde6b ]

To set Tx vlan offloads, it is required to stop port firstly. But before
checking whether the port is stopped, the port id entered by the user
is not checked for validity. When the port id is illegal, it would lead
to a segmentation fault since it attempts to access a member of
non-existent port.

This patch adds verification of port id in tx vlan offloads and remove
duplicated check.

Fixes: 597f9fafe13b ("app/testpmd: convert to new Tx offloads API")

Signed-off-by: Chengchang Tang <tangchengchang 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/cmdline.c | 9 +++++++++
 app/test-pmd/config.c  | 6 ------
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 2d18b6caf2..f522b599b7 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -4168,6 +4168,9 @@ cmd_tx_vlan_set_parsed(void *parsed_result,
 {
 	struct cmd_tx_vlan_set_result *res = parsed_result;
 
+	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+		return;
+
 	if (!port_is_stopped(res->port_id)) {
 		printf("Please stop port %d first\n", res->port_id);
 		return;
@@ -4222,6 +4225,9 @@ cmd_tx_vlan_set_qinq_parsed(void *parsed_result,
 {
 	struct cmd_tx_vlan_set_qinq_result *res = parsed_result;
 
+	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+		return;
+
 	if (!port_is_stopped(res->port_id)) {
 		printf("Please stop port %d first\n", res->port_id);
 		return;
@@ -4335,6 +4341,9 @@ cmd_tx_vlan_reset_parsed(void *parsed_result,
 {
 	struct cmd_tx_vlan_reset_result *res = parsed_result;
 
+	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+		return;
+
 	if (!port_is_stopped(res->port_id)) {
 		printf("Please stop port %d first\n", res->port_id);
 		return;
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 726a263421..01c984d025 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -3235,8 +3235,6 @@ tx_vlan_set(portid_t port_id, uint16_t vlan_id)
 	struct rte_eth_dev_info dev_info;
 	int ret;
 
-	if (port_id_is_invalid(port_id, ENABLED_WARN))
-		return;
 	if (vlan_id_is_invalid(vlan_id))
 		return;
 
@@ -3267,8 +3265,6 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer)
 	struct rte_eth_dev_info dev_info;
 	int ret;
 
-	if (port_id_is_invalid(port_id, ENABLED_WARN))
-		return;
 	if (vlan_id_is_invalid(vlan_id))
 		return;
 	if (vlan_id_is_invalid(vlan_id_outer))
@@ -3294,8 +3290,6 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer)
 void
 tx_vlan_reset(portid_t port_id)
 {
-	if (port_id_is_invalid(port_id, ENABLED_WARN))
-		return;
 	ports[port_id].dev_conf.txmode.offloads &=
 				~(DEV_TX_OFFLOAD_VLAN_INSERT |
 				  DEV_TX_OFFLOAD_QINQ_INSERT);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:14.408825386 +0000
+++ 0085-app-testpmd-fix-port-id-check-in-Tx-VLAN-command.patch	2020-10-28 10:35:11.620831731 +0000
@@ -1,8 +1,10 @@
-From b428e71775e43acc7b074c82b0d9e08f401dde6b Mon Sep 17 00:00:00 2001
+From ca5779171268ff3d969e2df74252bf69090652a4 Mon Sep 17 00:00:00 2001
 From: Chengchang Tang <tangchengchang at huawei.com>
 Date: Fri, 25 Sep 2020 20:47:14 +0800
 Subject: [PATCH] app/testpmd: fix port id check in Tx VLAN command
 
+[ upstream commit b428e71775e43acc7b074c82b0d9e08f401dde6b ]
+
 To set Tx vlan offloads, it is required to stop port firstly. But before
 checking whether the port is stopped, the port id entered by the user
 is not checked for validity. When the port id is illegal, it would lead
@@ -13,7 +15,6 @@
 duplicated check.
 
 Fixes: 597f9fafe13b ("app/testpmd: convert to new Tx offloads API")
-Cc: stable at dpdk.org
 
 Signed-off-by: Chengchang Tang <tangchengchang at huawei.com>
 Signed-off-by: Wei Hu (Xavier) <xavier.huwei at huawei.com>
@@ -24,10 +25,10 @@
  2 files changed, 9 insertions(+), 6 deletions(-)
 
 diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
-index 08e123fe69..524c75b267 100644
+index 2d18b6caf2..f522b599b7 100644
 --- a/app/test-pmd/cmdline.c
 +++ b/app/test-pmd/cmdline.c
-@@ -4294,6 +4294,9 @@ cmd_tx_vlan_set_parsed(void *parsed_result,
+@@ -4168,6 +4168,9 @@ cmd_tx_vlan_set_parsed(void *parsed_result,
  {
  	struct cmd_tx_vlan_set_result *res = parsed_result;
  
@@ -37,7 +38,7 @@
  	if (!port_is_stopped(res->port_id)) {
  		printf("Please stop port %d first\n", res->port_id);
  		return;
-@@ -4348,6 +4351,9 @@ cmd_tx_vlan_set_qinq_parsed(void *parsed_result,
+@@ -4222,6 +4225,9 @@ cmd_tx_vlan_set_qinq_parsed(void *parsed_result,
  {
  	struct cmd_tx_vlan_set_qinq_result *res = parsed_result;
  
@@ -47,7 +48,7 @@
  	if (!port_is_stopped(res->port_id)) {
  		printf("Please stop port %d first\n", res->port_id);
  		return;
-@@ -4461,6 +4467,9 @@ cmd_tx_vlan_reset_parsed(void *parsed_result,
+@@ -4335,6 +4341,9 @@ cmd_tx_vlan_reset_parsed(void *parsed_result,
  {
  	struct cmd_tx_vlan_reset_result *res = parsed_result;
  
@@ -58,10 +59,10 @@
  		printf("Please stop port %d first\n", res->port_id);
  		return;
 diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
-index 17a6efed24..03bf26bc94 100644
+index 726a263421..01c984d025 100644
 --- a/app/test-pmd/config.c
 +++ b/app/test-pmd/config.c
-@@ -3664,8 +3664,6 @@ tx_vlan_set(portid_t port_id, uint16_t vlan_id)
+@@ -3235,8 +3235,6 @@ tx_vlan_set(portid_t port_id, uint16_t vlan_id)
  	struct rte_eth_dev_info dev_info;
  	int ret;
  
@@ -70,7 +71,7 @@
  	if (vlan_id_is_invalid(vlan_id))
  		return;
  
-@@ -3696,8 +3694,6 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer)
+@@ -3267,8 +3265,6 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer)
  	struct rte_eth_dev_info dev_info;
  	int ret;
  
@@ -79,7 +80,7 @@
  	if (vlan_id_is_invalid(vlan_id))
  		return;
  	if (vlan_id_is_invalid(vlan_id_outer))
-@@ -3723,8 +3719,6 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer)
+@@ -3294,8 +3290,6 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer)
  void
  tx_vlan_reset(portid_t port_id)
  {


More information about the stable mailing list