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 099E5A0518 for ; Fri, 24 Jul 2020 14:01:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 024031BFE3; Fri, 24 Jul 2020 14:01:35 +0200 (CEST) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 04C851C032 for ; Fri, 24 Jul 2020 14:01:34 +0200 (CEST) Received: by mail-wr1-f66.google.com with SMTP id a14so8079731wra.5 for ; Fri, 24 Jul 2020 05:01:34 -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=oYDCR5FTbxhyKOYHGffZcz0qJZ/lyhxRHLdaP0mBvnc=; b=kgYKq/Fq24cNsdri9uSmfIs+3NY//FDGWrgahS8Ith9vmgibtMRd7ps3VaOk0j1UNt Db1JLEkkKN4OQMoqSCnAWfpG5NuIKMkHb4cWL2nPNtlAf1p6Jh/KAXxs2OKgfUDydRNm MOpE4mhfeBAsBTKPo0Y+2BECdEznAF3Pfq/ezDHSRIOyZfT4Lrwc2An/pkj+7jTjzhx9 uGntoCY3RC719EU68SWhL3Mm/cRrZsIqmUw20oOmO07u7tXPAPV7GdVtDvwbU3kXjSjF An4IHyZGVoXJ/2si7G5y1gRY4fR/tAtMZslYFXJtyTnraOD+RzRTIB25yNx7yY0FR1XS 337Q== 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=oYDCR5FTbxhyKOYHGffZcz0qJZ/lyhxRHLdaP0mBvnc=; b=rxs50sjkl141NmUQJMMED9umVCyh/490oQACz1ZqXXNaF86ueeQ1maXetK1SCZSgBt 9qeJQ9lHVvoRDz5EO7sw6Rsf47sBVGHK4WnDPVTUrpYH+Jx8PHNth39NNAHpevgtR5tn AUKsSeze0ObE0mCNdsR/NIugDA1n+3AHnCDVWLtYb9hBgZDFrUhttn5Ik7AmTUgisJAu UpeKnPKJmzFmm9CE53zQKK5jKHz/r78tZo2uXqLArCVPWFtPNtibZqnBzMX4KU8hffTW sWhLENqUSJsbWRJSdICTtvBer6X0LIPAWowgDsF2km1+1rWgkwSocPi9ubNNJXEArGYZ SgjA== X-Gm-Message-State: AOAM530+Df/UCS+HJjxo3B2D74YspJ5IL2bXBbUVUCUw643BI/5DH8DN ojAMK0M/qm2B4/vrVzh/F2U= X-Google-Smtp-Source: ABdhPJxlU+F7lOS1ycZCVAET5GHS5pPYV0N1mljbquF7VUiJp64DgHElPcajMKouF60qdqFAZocRfQ== X-Received: by 2002:a5d:6846:: with SMTP id o6mr8446126wrw.370.1595592093609; Fri, 24 Jul 2020 05:01:33 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id w2sm1360933wre.5.2020.07.24.05.01.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:01:32 -0700 (PDT) From: luca.boccassi@gmail.com To: "Wei Hu (Xavier)" Cc: Chengchang Tang , dpdk stable Date: Fri, 24 Jul 2020 12:57:38 +0100 Message-Id: <20200724120030.1863487-20-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 tags reported in Rx' 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 7e6fa0689b7ec6566ab96123deb340c409e0d097 Mon Sep 17 00:00:00 2001 From: "Wei Hu (Xavier)" Date: Wed, 3 Jun 2020 17:32:00 +0800 Subject: [PATCH] net/hns3: fix VLAN tags reported in Rx [ upstream commit e28bc1476558467b2898abab306b2317bada3d78 ] Currently, based on hns3 network engine, driver always reports the incoming packet's VLAN tags to the structure rte_mbuf those are the output parameter pointers in '.rx_pkt_burst' ops implementation function, and never reports PKT_RX_VLAN_STRIPPED flag to the structure rte_mbuf even if Upper Level Process configured hardware strip by calling rte_eth_dev_configure or rte_eth_dev_set_vlan_offload API function. It makes the ULP unable to know the stripping of VLAN. It is supposed to present the stripped flags to the mbuf ol_flags, and report the right VLAN tag. And as hardware constraints, the stripped VLAN tag will always in the Rx descriptor. Even if setting a PVID based on the function, the PVID will be reported to the Rx descriptor. So the driver need to determine which VLAN tag should be reported to output the structure rte_mbuf in '.rx_pkt_burst' ops implementation function named hns3_recv_pkts. Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations") Fixes: 411d23b9eafb ("net/hns3: support VLAN") Signed-off-by: Chengchang Tang Signed-off-by: Wei Hu (Xavier) --- drivers/net/hns3/hns3_ethdev.c | 48 +++++++++++---------------- drivers/net/hns3/hns3_ethdev.h | 15 +++++---- drivers/net/hns3/hns3_rxtx.c | 60 +++++++++++++++++++++++++++++++--- 3 files changed, 83 insertions(+), 40 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index e7eeb7875..f1066c079 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -35,8 +35,6 @@ #define HNS3_DEFAULT_PORT_CONF_QUEUES_NUM 1 #define HNS3_SERVICE_INTERVAL 1000000 /* us */ -#define HNS3_PORT_BASE_VLAN_DISABLE 0 -#define HNS3_PORT_BASE_VLAN_ENABLE 1 #define HNS3_INVLID_PVID 0xFFFF #define HNS3_FILTER_TYPE_VF 0 @@ -303,15 +301,14 @@ static int hns3_restore_vlan_table(struct hns3_adapter *hns) { struct hns3_user_vlan_table *vlan_entry; + struct hns3_hw *hw = &hns->hw; struct hns3_pf *pf = &hns->pf; uint16_t vlan_id; int ret = 0; - if (pf->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_ENABLE) { - ret = hns3_vlan_pvid_configure(hns, pf->port_base_vlan_cfg.pvid, - 1); - return ret; - } + if (hw->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_ENABLE) + return hns3_vlan_pvid_configure(hns, + hw->port_base_vlan_cfg.pvid, 1); LIST_FOREACH(vlan_entry, &pf->vlan_list, next) { if (vlan_entry->hd_tbl_status) { @@ -328,7 +325,7 @@ hns3_restore_vlan_table(struct hns3_adapter *hns) static int hns3_vlan_filter_configure(struct hns3_adapter *hns, uint16_t vlan_id, int on) { - struct hns3_pf *pf = &hns->pf; + struct hns3_hw *hw = &hns->hw; bool writen_to_tbl = false; int ret = 0; @@ -346,7 +343,7 @@ hns3_vlan_filter_configure(struct hns3_adapter *hns, uint16_t vlan_id, int on) * vlan list. The vlan id in vlan list will be writen in vlan filter * table until port base vlan disabled */ - if (pf->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_DISABLE) { + if (hw->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_DISABLE) { ret = hns3_set_port_vlan_filter(hns, vlan_id, on); writen_to_tbl = true; } @@ -500,11 +497,10 @@ static int hns3_en_hw_strip_rxvtag(struct hns3_adapter *hns, bool enable) { struct hns3_rx_vtag_cfg rxvlan_cfg; - struct hns3_pf *pf = &hns->pf; struct hns3_hw *hw = &hns->hw; int ret; - if (pf->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_DISABLE) { + if (hw->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_DISABLE) { rxvlan_cfg.strip_tag1_en = false; rxvlan_cfg.strip_tag2_en = enable; } else { @@ -719,12 +715,12 @@ hns3_vlan_txvlan_cfg(struct hns3_adapter *hns, uint16_t port_base_vlan_state, static void hns3_store_port_base_vlan_info(struct hns3_adapter *hns, uint16_t pvid, int on) { - struct hns3_pf *pf = &hns->pf; + struct hns3_hw *hw = &hns->hw; - pf->port_base_vlan_cfg.state = on ? + hw->port_base_vlan_cfg.state = on ? HNS3_PORT_BASE_VLAN_ENABLE : HNS3_PORT_BASE_VLAN_DISABLE; - pf->port_base_vlan_cfg.pvid = pvid; + hw->port_base_vlan_cfg.pvid = pvid; } static void @@ -768,13 +764,12 @@ static void hns3_remove_all_vlan_table(struct hns3_adapter *hns) { struct hns3_hw *hw = &hns->hw; - struct hns3_pf *pf = &hns->pf; int ret; hns3_rm_all_vlan_table(hns, true); - if (pf->port_base_vlan_cfg.pvid != HNS3_INVLID_PVID) { + if (hw->port_base_vlan_cfg.pvid != HNS3_INVLID_PVID) { ret = hns3_set_port_vlan_filter(hns, - pf->port_base_vlan_cfg.pvid, 0); + hw->port_base_vlan_cfg.pvid, 0); if (ret) { hns3_err(hw, "Failed to remove all vlan table, ret =%d", ret); @@ -788,7 +783,6 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns, uint16_t port_base_vlan_state, uint16_t new_pvid, uint16_t old_pvid) { - struct hns3_pf *pf = &hns->pf; struct hns3_hw *hw = &hns->hw; int ret = 0; @@ -816,7 +810,7 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns, } } - if (new_pvid == pf->port_base_vlan_cfg.pvid) + if (new_pvid == hw->port_base_vlan_cfg.pvid) hns3_add_all_vlan_table(hns); return ret; @@ -853,17 +847,16 @@ hns3_en_pvid_strip(struct hns3_adapter *hns, int on) static int hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) { - struct hns3_pf *pf = &hns->pf; struct hns3_hw *hw = &hns->hw; uint16_t port_base_vlan_state; uint16_t old_pvid; int ret; - if (on == 0 && pvid != pf->port_base_vlan_cfg.pvid) { - if (pf->port_base_vlan_cfg.pvid != HNS3_INVLID_PVID) + if (on == 0 && pvid != hw->port_base_vlan_cfg.pvid) { + if (hw->port_base_vlan_cfg.pvid != HNS3_INVLID_PVID) hns3_warn(hw, "Invalid operation! As current pvid set " "is %u, disable pvid %u is invalid", - pf->port_base_vlan_cfg.pvid, pvid); + hw->port_base_vlan_cfg.pvid, pvid); return 0; } @@ -885,7 +878,7 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) if (pvid == HNS3_INVLID_PVID) goto out; - old_pvid = pf->port_base_vlan_cfg.pvid; + old_pvid = hw->port_base_vlan_cfg.pvid; ret = hns3_update_vlan_filter_entries(hns, port_base_vlan_state, pvid, old_pvid); if (ret) { @@ -921,11 +914,8 @@ hns3_vlan_pvid_set(struct rte_eth_dev *dev, uint16_t pvid, int on) static void init_port_base_vlan_info(struct hns3_hw *hw) { - struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw); - struct hns3_pf *pf = &hns->pf; - - pf->port_base_vlan_cfg.state = HNS3_PORT_BASE_VLAN_DISABLE; - pf->port_base_vlan_cfg.pvid = HNS3_INVLID_PVID; + hw->port_base_vlan_cfg.state = HNS3_PORT_BASE_VLAN_DISABLE; + hw->port_base_vlan_cfg.pvid = HNS3_INVLID_PVID; } static int diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h index cdbfc70b2..e7d9fe0e0 100644 --- a/drivers/net/hns3/hns3_ethdev.h +++ b/drivers/net/hns3/hns3_ethdev.h @@ -161,6 +161,13 @@ struct hns3_fake_queue_data { uint16_t nb_fake_tx_queues; /* Number of fake TX queues. */ }; +#define HNS3_PORT_BASE_VLAN_DISABLE 0 +#define HNS3_PORT_BASE_VLAN_ENABLE 1 +struct hns3_port_base_vlan_config { + uint16_t state; + uint16_t pvid; +}; + /* Primary process maintains driver state in main thread. * * +---------------+ @@ -384,6 +391,8 @@ struct hns3_hw { uint16_t tx_qnum_per_tc; /* TX queue number per TC */ uint32_t flag; + + struct hns3_port_base_vlan_config port_base_vlan_cfg; /* * PMD setup and configuration is not thread safe. Since it is not * performance sensitive, it is better to guarantee thread-safety @@ -413,11 +422,6 @@ struct hns3_user_vlan_table { uint16_t vlan_id; }; -struct hns3_port_base_vlan_config { - uint16_t state; - uint16_t pvid; -}; - /* Vlan tag configuration for RX direction */ struct hns3_rx_vtag_cfg { uint8_t rx_vlan_offload_en; /* Whether enable rx vlan offload */ @@ -493,7 +497,6 @@ struct hns3_pf { bool support_sfp_query; struct hns3_vtag_cfg vtag_config; - struct hns3_port_base_vlan_config port_base_vlan_cfg; LIST_HEAD(vlan_tbl, hns3_user_vlan_table) vlan_list; struct hns3_fdir_info fdir; /* flow director info */ diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index dcaeab267..3251515fe 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -1255,9 +1255,9 @@ rxd_pkt_info_to_pkt_type(uint32_t pkt_info, uint32_t ol_info) static const uint32_t l2table[HNS3_L2TBL_NUM] = { RTE_PTYPE_L2_ETHER, - RTE_PTYPE_L2_ETHER_VLAN, RTE_PTYPE_L2_ETHER_QINQ, - 0 + RTE_PTYPE_L2_ETHER_VLAN, + RTE_PTYPE_L2_ETHER_VLAN }; static const uint32_t l3table[HNS3_L3TBL_NUM] = { @@ -1450,6 +1450,58 @@ hns3_rx_set_cksum_flag(struct rte_mbuf *rxm, uint64_t packet_type, } } +static inline void +hns3_rxd_to_vlan_tci(struct rte_eth_dev *dev, struct rte_mbuf *mb, + uint32_t l234_info, const struct hns3_desc *rxd) +{ +#define HNS3_STRP_STATUS_NUM 0x4 + +#define HNS3_NO_STRP_VLAN_VLD 0x0 +#define HNS3_INNER_STRP_VLAN_VLD 0x1 +#define HNS3_OUTER_STRP_VLAN_VLD 0x2 + struct hns3_adapter *hns = dev->data->dev_private; + struct hns3_hw *hw = &hns->hw; + uint32_t strip_status; + uint32_t report_mode; + + /* + * Since HW limitation, the vlan tag will always be inserted into RX + * descriptor when strip the tag from packet, driver needs to determine + * reporting which tag to mbuf according to the PVID configuration + * and vlan striped status. + */ + static const uint32_t report_type[][HNS3_STRP_STATUS_NUM] = { + { + HNS3_NO_STRP_VLAN_VLD, + HNS3_OUTER_STRP_VLAN_VLD, + HNS3_INNER_STRP_VLAN_VLD, + HNS3_OUTER_STRP_VLAN_VLD + }, + { + HNS3_NO_STRP_VLAN_VLD, + HNS3_NO_STRP_VLAN_VLD, + HNS3_NO_STRP_VLAN_VLD, + HNS3_INNER_STRP_VLAN_VLD + } + }; + strip_status = hns3_get_field(l234_info, HNS3_RXD_STRP_TAGP_M, + HNS3_RXD_STRP_TAGP_S); + report_mode = report_type[hw->port_base_vlan_cfg.state][strip_status]; + switch (report_mode) { + case HNS3_NO_STRP_VLAN_VLD: + mb->vlan_tci = 0; + return; + case HNS3_INNER_STRP_VLAN_VLD: + mb->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED; + mb->vlan_tci = rte_le_to_cpu_16(rxd->rx.vlan_tag); + return; + case HNS3_OUTER_STRP_VLAN_VLD: + mb->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED; + mb->vlan_tci = rte_le_to_cpu_16(rxd->rx.ot_vlan_tag); + return; + } +} + uint16_t hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) { @@ -1625,10 +1677,8 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) hns3_rx_set_cksum_flag(first_seg, first_seg->packet_type, cksum_err); + hns3_rxd_to_vlan_tci(dev, first_seg, l234_info, &rxd); - first_seg->vlan_tci = rte_le_to_cpu_16(rxd.rx.vlan_tag); - first_seg->vlan_tci_outer = - rte_le_to_cpu_16(rxd.rx.ot_vlan_tag); rx_pkts[nb_rx++] = first_seg; first_seg = NULL; continue; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:49.391038171 +0100 +++ 0020-net-hns3-fix-VLAN-tags-reported-in-Rx.patch 2020-07-24 12:53:48.207004969 +0100 @@ -1,8 +1,10 @@ -From e28bc1476558467b2898abab306b2317bada3d78 Mon Sep 17 00:00:00 2001 +From 7e6fa0689b7ec6566ab96123deb340c409e0d097 Mon Sep 17 00:00:00 2001 From: "Wei Hu (Xavier)" Date: Wed, 3 Jun 2020 17:32:00 +0800 Subject: [PATCH] net/hns3: fix VLAN tags reported in Rx +[ upstream commit e28bc1476558467b2898abab306b2317bada3d78 ] + Currently, based on hns3 network engine, driver always reports the incoming packet's VLAN tags to the structure rte_mbuf those are the output parameter pointers in '.rx_pkt_burst' ops implementation @@ -22,18 +24,17 @@ Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations") Fixes: 411d23b9eafb ("net/hns3: support VLAN") -Cc: stable@dpdk.org Signed-off-by: Chengchang Tang Signed-off-by: Wei Hu (Xavier) --- - drivers/net/hns3/hns3_ethdev.c | 44 ++++++++++--------------- + drivers/net/hns3/hns3_ethdev.c | 48 +++++++++++---------------- drivers/net/hns3/hns3_ethdev.h | 15 +++++---- drivers/net/hns3/hns3_rxtx.c | 60 +++++++++++++++++++++++++++++++--- - 3 files changed, 82 insertions(+), 37 deletions(-) + 3 files changed, 83 insertions(+), 40 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c -index 244a3b827..62d87582d 100644 +index e7eeb7875..f1066c079 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -35,8 +35,6 @@ @@ -45,7 +46,7 @@ #define HNS3_INVLID_PVID 0xFFFF #define HNS3_FILTER_TYPE_VF 0 -@@ -313,13 +311,14 @@ static int +@@ -303,15 +301,14 @@ static int hns3_restore_vlan_table(struct hns3_adapter *hns) { struct hns3_user_vlan_table *vlan_entry; @@ -54,15 +55,18 @@ uint16_t vlan_id; int ret = 0; -- if (pf->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_ENABLE) +- if (pf->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_ENABLE) { +- ret = hns3_vlan_pvid_configure(hns, pf->port_base_vlan_cfg.pvid, +- 1); +- return ret; +- } + if (hw->port_base_vlan_cfg.state == HNS3_PORT_BASE_VLAN_ENABLE) - return hns3_vlan_pvid_configure(hns, -- pf->port_base_vlan_cfg.pvid, 1); ++ return hns3_vlan_pvid_configure(hns, + hw->port_base_vlan_cfg.pvid, 1); LIST_FOREACH(vlan_entry, &pf->vlan_list, next) { if (vlan_entry->hd_tbl_status) { -@@ -336,7 +335,7 @@ hns3_restore_vlan_table(struct hns3_adapter *hns) +@@ -328,7 +325,7 @@ hns3_restore_vlan_table(struct hns3_adapter *hns) static int hns3_vlan_filter_configure(struct hns3_adapter *hns, uint16_t vlan_id, int on) { @@ -71,7 +75,7 @@ bool writen_to_tbl = false; int ret = 0; -@@ -354,7 +353,7 @@ hns3_vlan_filter_configure(struct hns3_adapter *hns, uint16_t vlan_id, int on) +@@ -346,7 +343,7 @@ hns3_vlan_filter_configure(struct hns3_adapter *hns, uint16_t vlan_id, int on) * vlan list. The vlan id in vlan list will be writen in vlan filter * table until port base vlan disabled */ @@ -80,7 +84,7 @@ ret = hns3_set_port_vlan_filter(hns, vlan_id, on); writen_to_tbl = true; } -@@ -507,11 +506,10 @@ static int +@@ -500,11 +497,10 @@ static int hns3_en_hw_strip_rxvtag(struct hns3_adapter *hns, bool enable) { struct hns3_rx_vtag_cfg rxvlan_cfg; @@ -93,7 +97,7 @@ rxvlan_cfg.strip_tag1_en = false; rxvlan_cfg.strip_tag2_en = enable; } else { -@@ -728,12 +726,12 @@ hns3_vlan_txvlan_cfg(struct hns3_adapter *hns, uint16_t port_base_vlan_state, +@@ -719,12 +715,12 @@ hns3_vlan_txvlan_cfg(struct hns3_adapter *hns, uint16_t port_base_vlan_state, static void hns3_store_port_base_vlan_info(struct hns3_adapter *hns, uint16_t pvid, int on) { @@ -109,7 +113,7 @@ } static void -@@ -777,13 +775,12 @@ static void +@@ -768,13 +764,12 @@ static void hns3_remove_all_vlan_table(struct hns3_adapter *hns) { struct hns3_hw *hw = &hns->hw; @@ -125,7 +129,7 @@ if (ret) { hns3_err(hw, "Failed to remove all vlan table, ret =%d", ret); -@@ -797,7 +794,6 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns, +@@ -788,7 +783,6 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns, uint16_t port_base_vlan_state, uint16_t new_pvid, uint16_t old_pvid) { @@ -133,7 +137,7 @@ struct hns3_hw *hw = &hns->hw; int ret = 0; -@@ -825,7 +821,7 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns, +@@ -816,7 +810,7 @@ hns3_update_vlan_filter_entries(struct hns3_adapter *hns, } } @@ -142,7 +146,7 @@ hns3_add_all_vlan_table(hns); return ret; -@@ -862,17 +858,16 @@ hns3_en_pvid_strip(struct hns3_adapter *hns, int on) +@@ -853,17 +847,16 @@ hns3_en_pvid_strip(struct hns3_adapter *hns, int on) static int hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) { @@ -163,7 +167,7 @@ return 0; } -@@ -894,7 +889,7 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) +@@ -885,7 +878,7 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) if (pvid == HNS3_INVLID_PVID) goto out; @@ -172,7 +176,7 @@ ret = hns3_update_vlan_filter_entries(hns, port_base_vlan_state, pvid, old_pvid); if (ret) { -@@ -930,11 +925,8 @@ hns3_vlan_pvid_set(struct rte_eth_dev *dev, uint16_t pvid, int on) +@@ -921,11 +914,8 @@ hns3_vlan_pvid_set(struct rte_eth_dev *dev, uint16_t pvid, int on) static void init_port_base_vlan_info(struct hns3_hw *hw) { @@ -187,10 +191,10 @@ static int diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h -index bc458cb44..21412c44c 100644 +index cdbfc70b2..e7d9fe0e0 100644 --- a/drivers/net/hns3/hns3_ethdev.h +++ b/drivers/net/hns3/hns3_ethdev.h -@@ -171,6 +171,13 @@ struct hns3_fake_queue_data { +@@ -161,6 +161,13 @@ struct hns3_fake_queue_data { uint16_t nb_fake_tx_queues; /* Number of fake TX queues. */ }; @@ -204,7 +208,7 @@ /* Primary process maintains driver state in main thread. * * +---------------+ -@@ -395,6 +402,8 @@ struct hns3_hw { +@@ -384,6 +391,8 @@ struct hns3_hw { uint16_t tx_qnum_per_tc; /* TX queue number per TC */ uint32_t flag; @@ -213,7 +217,7 @@ /* * PMD setup and configuration is not thread safe. Since it is not * performance sensitive, it is better to guarantee thread-safety -@@ -424,11 +433,6 @@ struct hns3_user_vlan_table { +@@ -413,11 +422,6 @@ struct hns3_user_vlan_table { uint16_t vlan_id; }; @@ -225,7 +229,7 @@ /* Vlan tag configuration for RX direction */ struct hns3_rx_vtag_cfg { uint8_t rx_vlan_offload_en; /* Whether enable rx vlan offload */ -@@ -504,7 +508,6 @@ struct hns3_pf { +@@ -493,7 +497,6 @@ struct hns3_pf { bool support_sfp_query; struct hns3_vtag_cfg vtag_config; @@ -234,7 +238,7 @@ struct hns3_fdir_info fdir; /* flow director info */ diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c -index 25ba3b820..4341c6d60 100644 +index dcaeab267..3251515fe 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -1255,9 +1255,9 @@ rxd_pkt_info_to_pkt_type(uint32_t pkt_info, uint32_t ol_info)