From patchwork Thu Aug 20 01:42:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wei Hu (Xavier)" X-Patchwork-Id: 75724 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CC65DA04AF; Thu, 20 Aug 2020 03:42:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D66F01C0B4; Thu, 20 Aug 2020 03:42:52 +0200 (CEST) Received: from mail.chinasoftinc.com (unknown [114.113.233.8]) by dpdk.org (Postfix) with ESMTP id BA96CAAD5 for ; Thu, 20 Aug 2020 03:42:50 +0200 (CEST) Received: from localhost.localdomain (65.49.108.226) by INCCAS001.ito.icss (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Thu, 20 Aug 2020 09:42:46 +0800 From: "Wei Hu (Xavier)" To: Wenzhuo Lu , Beilei Xing , Bernard Iremonger , Shahaf Shuler CC: , Date: Thu, 20 Aug 2020 09:42:02 +0800 Message-ID: <20200820014204.25035-3-huwei013@chinasoftinc.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200820014204.25035-1-huwei013@chinasoftinc.com> References: <20200818120254.72792-1-huwei013@chinasoftinc.com> <20200820014204.25035-1-huwei013@chinasoftinc.com> MIME-Version: 1.0 X-Originating-IP: [65.49.108.226] Subject: [dpdk-dev] [PATCH v2 2/4] app/testpmd: fix VLAN offload configuration when config fail X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Chengchang Tang 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 Signed-off-by: Wei Hu (Xavier) Reviewed-by: Ferruh Yigit --- 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 30bee3324..6e8e05ab1 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; }