patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: <xavier.huwei@foxmail.com>
Cc: <forest.zhouchang@huawei.com>,
	Chengchang Tang <tangchengchang@huawei.com>, <stable@dpdk.org>,
	Wei Hu <xavier.huwei@huawei.com>
Subject: [dpdk-stable] [PATCH v3 2/6] app/testpmd: fix VLAN offload configuration when config fail
Date: Sat, 19 Sep 2020 15:37:10 +0800	[thread overview]
Message-ID: <1600501034-50042-3-git-send-email-humin29@huawei.com> (raw)
In-Reply-To: <1600501034-50042-1-git-send-email-humin29@huawei.com>

From: Chengchang Tang <tangchengchang@huawei.com>

When failing to configure VLAN offloads after the port was started, there
is no need to update the port configuration. Currently, when user
configure an unsupported VLAN offloads and fails, and then restart the
port, it will fails since the configuration has been refreshed.

This patch makes the function return directly insead of refreshing the
configuration when execution fails.

Fixes: 384161e00627 ("app/testpmd: adjust on the fly VLAN configuration")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 app/test-pmd/config.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 2bdec25..4e33208 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -3390,9 +3390,11 @@ vlan_extend_set(portid_t port_id, int on)
 	}
 
 	diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
-	if (diag < 0)
+	if (diag < 0) {
 		printf("rx_vlan_extend_set(port_pi=%d, on=%d) failed "
 	       "diag=%d\n", port_id, on, diag);
+		return;
+	}
 	ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
 }
 
@@ -3417,9 +3419,11 @@ rx_vlan_strip_set(portid_t port_id, int on)
 	}
 
 	diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
-	if (diag < 0)
+	if (diag < 0) {
 		printf("rx_vlan_strip_set(port_pi=%d, on=%d) failed "
 	       "diag=%d\n", port_id, on, diag);
+		return;
+	}
 	ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
 }
 
@@ -3458,9 +3462,11 @@ rx_vlan_filter_set(portid_t port_id, int on)
 	}
 
 	diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
-	if (diag < 0)
+	if (diag < 0) {
 		printf("rx_vlan_filter_set(port_pi=%d, on=%d) failed "
 	       "diag=%d\n", port_id, on, diag);
+		return;
+	}
 	ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
 }
 
@@ -3485,9 +3491,11 @@ rx_vlan_qinq_strip_set(portid_t port_id, int on)
 	}
 
 	diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
-	if (diag < 0)
+	if (diag < 0) {
 		printf("%s(port_pi=%d, on=%d) failed "
 	       "diag=%d\n", __func__, port_id, on, diag);
+		return;
+	}
 	ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
 }
 
-- 
2.7.4


  parent reply	other threads:[~2020-09-19  7:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1600501034-50042-1-git-send-email-humin29@huawei.com>
2020-09-19  7:37 ` [dpdk-stable] [PATCH v3 1/6] app/testpmd: fix missing verification of port id Min Hu (Connor)
2020-09-19  7:37 ` Min Hu (Connor) [this message]
2020-09-19  7:37 ` [dpdk-stable] [PATCH v3 3/6] app/testpmd: remove restriction on txpkts set Min Hu (Connor)
2020-09-19  7:37 ` [dpdk-stable] [PATCH v3 4/6] app/testpmd: fix packet header in txonly mode Min Hu (Connor)
2020-09-19  7:37 ` [dpdk-stable] [PATCH v3 5/6] app/testpmd: fix valid desc id check Min Hu (Connor)
2020-09-19  7:37 ` [dpdk-stable] [PATCH v3 6/6] app/testpmd: fix displaying Rx Tx queues information Min Hu (Connor)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1600501034-50042-3-git-send-email-humin29@huawei.com \
    --to=humin29@huawei.com \
    --cc=forest.zhouchang@huawei.com \
    --cc=stable@dpdk.org \
    --cc=tangchengchang@huawei.com \
    --cc=xavier.huwei@foxmail.com \
    --cc=xavier.huwei@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).