From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EB0C9A0518 for ; Fri, 24 Jul 2020 14:01:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E28CC1BFE3; Fri, 24 Jul 2020 14:01:32 +0200 (CEST) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by dpdk.org (Postfix) with ESMTP id 3E8341C037 for ; Fri, 24 Jul 2020 14:01:32 +0200 (CEST) Received: by mail-wm1-f65.google.com with SMTP id k20so383570wmi.5 for ; Fri, 24 Jul 2020 05:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2a4IKRsiggKifVM+T4oX/o9KSiBWthuK4V67Tz7xV9U=; b=V3DQOfuY5eSmXuhy+j00lkuwwQF1GWJ18W2bQzT3Y83Xvp5hi5+IzfPkv28LGmIHeO S+og7HDPTmgTEcGShQErS8L3VlmNA6mwNJjAxUwAsBZrDmDLatSNSIG1Co5FBcTMIGab 7LPws+eT59YzveinD2W9Tv9Kw1J42pYLgnrMImjCMiOINb37d0ZnYCml7WCYeoacknj+ s2XkrvCBWPjum8LHEbM5Q6tEyAF5k0KM+6nMKol9zpYjmOUuQZU4k4+T7ABNZopxebzY cQZ0bYbhQJG/x6XqAMEFLHKMAo0hlbwYOe8ZmCsvpy0YBTJ8lCv3AQXo/xyjW+G1bYYa rVEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2a4IKRsiggKifVM+T4oX/o9KSiBWthuK4V67Tz7xV9U=; b=cE88crUo63Ej7mZBcTqait3mQXFI33u+6+ye3130qETehSJR3XZSo4X1+pN2ayH7gI uWYzSRCNhyWbbIxKK/7Qo1zAQnSq15E5HVI+uhC39rGQWtieEcAHaHsRd+wxZJoVeLSh o3h35IYjJdBk2d90FVmJTnpvIDMLfCZHrfk0PsoQnlnYOzeNxZj2awle5myJ6X4kqp2H GQJIo6WxABvrOz/C9/pxkbbFfoNrmDsNpicA735+tbNLmZLQde3FQZ1UH1ooia4hyZcD Yq00V8Ech2DLIaSa6KX/XdsrQrC2tO9C0Mde2imaCahK2hiiT7BxFfge5T038Lf3jqXf Pj4g== X-Gm-Message-State: AOAM5316pFuSnhwlSvP9egoYTaborSMfH74X0NTT1UCngoZ4d42iBcG3 raYr8OOoWCFBIEjGu4sgu/mI9O3z2mI= X-Google-Smtp-Source: ABdhPJyP14bLHwBekRX+4EZynzK9iQiy6qQqNIY4ilZjnVn2lLt30/x937uNmekR/SnduPlwC3DTCQ== X-Received: by 2002:a7b:c2a1:: with SMTP id c1mr921762wmk.89.1595592091996; Fri, 24 Jul 2020 05:01:31 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id d14sm1060787wre.44.2020.07.24.05.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:01:31 -0700 (PDT) From: luca.boccassi@gmail.com To: Chengchang Tang Cc: Wei Hu , dpdk stable Date: Fri, 24 Jul 2020 12:57:37 +0100 Message-Id: <20200724120030.1863487-19-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix VLAN strip configuration when setting PVID' has been queued to stable release 19.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/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 c9e3e5fd3661202efe9859ad75498c55d35868e4 Mon Sep 17 00:00:00 2001 From: Chengchang Tang Date: Wed, 3 Jun 2020 17:31:59 +0800 Subject: [PATCH] net/hns3: fix VLAN strip configuration when setting PVID [ upstream commit 4c623ca40013c58d73aec67717583e3ee1cb45e3 ] Currently, based on hns3 PF device, hardware will strip 2 vlan tags when ULP calls rte_eth_dev_set_vlan_pvid API function to set a PVID whether vlan strip related offload is turned on by calling rte_eth_dev_configure or rte_eth_dev_set_vlan_offload API function. When receiving a QinQ packet with the pvid tag, if ULP does not configure the vlan strip by the method mentioned above, a layer of vlan tag will be lost to ULP, which is not the expected result. It is supposed to configure the vlan strip according to the upper level process's configuration. Fixes: 411d23b9eafb ("net/hns3: support VLAN") Signed-off-by: Chengchang Tang Signed-off-by: Wei Hu (Xavier) --- drivers/net/hns3/hns3_ethdev.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index f2b0fd704..e7eeb7875 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -823,25 +823,28 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns, } static int -hns3_en_rx_strip_all(struct hns3_adapter *hns, int on) +hns3_en_pvid_strip(struct hns3_adapter *hns, int on) { + struct hns3_rx_vtag_cfg *old_cfg = &hns->pf.vtag_config.rx_vcfg; struct hns3_rx_vtag_cfg rx_vlan_cfg; - struct hns3_hw *hw = &hns->hw; bool rx_strip_en; int ret; - rx_strip_en = on ? true : false; - rx_vlan_cfg.strip_tag1_en = rx_strip_en; - rx_vlan_cfg.strip_tag2_en = rx_strip_en; + rx_strip_en = old_cfg->rx_vlan_offload_en ? true : false; + if (on) { + rx_vlan_cfg.strip_tag1_en = rx_strip_en; + rx_vlan_cfg.strip_tag2_en = true; + } else { + rx_vlan_cfg.strip_tag1_en = false; + rx_vlan_cfg.strip_tag2_en = rx_strip_en; + } rx_vlan_cfg.vlan1_vlan_prionly = false; rx_vlan_cfg.vlan2_vlan_prionly = false; - rx_vlan_cfg.rx_vlan_offload_en = rx_strip_en; + rx_vlan_cfg.rx_vlan_offload_en = old_cfg->rx_vlan_offload_en; ret = hns3_set_vlan_rx_offload_cfg(hns, &rx_vlan_cfg); - if (ret) { - hns3_err(hw, "enable strip rx failed, ret =%d", ret); + if (ret) return ret; - } hns3_update_rx_offload_cfg(hns, &rx_vlan_cfg); return ret; @@ -868,13 +871,15 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) HNS3_PORT_BASE_VLAN_DISABLE; ret = hns3_vlan_txvlan_cfg(hns, port_base_vlan_state, pvid); if (ret) { - hns3_err(hw, "Failed to config tx vlan, ret =%d", ret); + hns3_err(hw, "failed to config tx vlan for pvid, ret = %d", + ret); return ret; } - ret = hns3_en_rx_strip_all(hns, on); + ret = hns3_en_pvid_strip(hns, on); if (ret) { - hns3_err(hw, "Failed to config rx vlan strip, ret =%d", ret); + hns3_err(hw, "failed to config rx vlan strip for pvid, " + "ret = %d", ret); return ret; } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:49.352013441 +0100 +++ 0019-net-hns3-fix-VLAN-strip-configuration-when-setting-P.patch 2020-07-24 12:53:48.199004820 +0100 @@ -1,8 +1,10 @@ -From 4c623ca40013c58d73aec67717583e3ee1cb45e3 Mon Sep 17 00:00:00 2001 +From c9e3e5fd3661202efe9859ad75498c55d35868e4 Mon Sep 17 00:00:00 2001 From: Chengchang Tang Date: Wed, 3 Jun 2020 17:31:59 +0800 Subject: [PATCH] net/hns3: fix VLAN strip configuration when setting PVID +[ upstream commit 4c623ca40013c58d73aec67717583e3ee1cb45e3 ] + Currently, based on hns3 PF device, hardware will strip 2 vlan tags when ULP calls rte_eth_dev_set_vlan_pvid API function to set a PVID whether vlan strip related offload is turned on by calling rte_eth_dev_configure @@ -16,7 +18,6 @@ process's configuration. Fixes: 411d23b9eafb ("net/hns3: support VLAN") -Cc: stable@dpdk.org Signed-off-by: Chengchang Tang Signed-off-by: Wei Hu (Xavier) @@ -25,10 +26,10 @@ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c -index 4030bd32a..244a3b827 100644 +index f2b0fd704..e7eeb7875 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c -@@ -832,25 +832,28 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns, +@@ -823,25 +823,28 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns, } static int @@ -66,7 +67,7 @@ hns3_update_rx_offload_cfg(hns, &rx_vlan_cfg); return ret; -@@ -877,13 +880,15 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) +@@ -868,13 +871,15 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) HNS3_PORT_BASE_VLAN_DISABLE; ret = hns3_vlan_txvlan_cfg(hns, port_base_vlan_state, pvid); if (ret) {