From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7B670A0C40 for ; Fri, 11 Jun 2021 09:20:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 74AE14014F; Fri, 11 Jun 2021 09:20:19 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 628764014F for ; Fri, 11 Jun 2021 09:20:17 +0200 (CEST) IronPort-SDR: wuWSV41QkiU5rnExdk2v+HCv8xgIwcKS8IlGb7DgManKRvshfhZ6Akr7P0ShiZ5tQSndy6tIj3 H8TfxNgaFMdg== X-IronPort-AV: E=McAfee;i="6200,9189,10011"; a="291108198" X-IronPort-AV: E=Sophos;i="5.83,265,1616482800"; d="scan'208";a="291108198" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2021 00:20:16 -0700 IronPort-SDR: xFmaKctztxfWogtp2HfeJJUZhrAsx0CBIWQNe1x+OyFXA9uuj3Etnp0GQ3MReF53aJSTEOTCD1 W3B0K8CzppSg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,265,1616482800"; d="scan'208";a="553333221" Received: from npg-dpdk-haiyue-1.sh.intel.com ([10.67.118.197]) by fmsmga001.fm.intel.com with ESMTP; 11 Jun 2021 00:20:14 -0700 From: Haiyue Wang To: stable@dpdk.org Cc: bluca@debian.org, xuemingl@nvidia.com, thomas@monjalon.net, christian.ehrhardt@canonical.com, ktraynor@redhat.com, qi.z.zhang@intel.com, Michal Swiatkowski , Haiyue Wang , Qiming Yang Date: Fri, 11 Jun 2021 14:58:16 +0800 Message-Id: <20210611065825.47678-10-haiyue.wang@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210611065825.47678-1-haiyue.wang@intel.com> References: <20210611065825.47678-1-haiyue.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] =?utf-8?q?=5BPATCH=C2=A020=2E11_v1_09/18=5D_net/ic?= =?utf-8?q?e/base=3A_change_protocol_ID_for_VLAN_in_DVM?= X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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" From: Qi Zhang [ upstream commit 8d7bb8d500b1ccdeb30668516064337faa20b364 ] Protocol id for first vlan in Double VLAN Mode (DVM) should be ICE_VLAN_OF_HW = 16, but for Single VLAN Mode (SVM) this should be ICE_VLAN_OL_HW = 17. Change protocol id in type to id translation array for outer vlan to 17 when DVM is enabled, which means the driver, package, and firmware support DVM. Signed-off-by: Michal Swiatkowski Signed-off-by: Haiyue Wang Signed-off-by: Qi Zhang Acked-by: Qiming Yang --- drivers/net/ice/base/ice_flex_pipe.c | 3 +++ drivers/net/ice/base/ice_switch.c | 19 ++++++++++++++++++- drivers/net/ice/base/ice_switch.h | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c index 058694653a..a92c2b8494 100644 --- a/drivers/net/ice/base/ice_flex_pipe.c +++ b/drivers/net/ice/base/ice_flex_pipe.c @@ -1166,6 +1166,9 @@ ice_download_pkg(struct ice_hw *hw, struct ice_seg *ice_seg) ice_cache_vlan_mode(hw); + if (ice_is_dvm_ena(hw)) + ice_change_proto_id_to_dvm(); + return status; } diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index df8319a7e7..55bfc3e6c5 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -6127,7 +6127,7 @@ static const struct ice_prot_ext_tbl_entry ice_prot_ext[ICE_PROTOCOL_LAST] = { * following policy. */ -static const struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = { +static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = { { ICE_MAC_OFOS, ICE_MAC_OFOS_HW }, { ICE_MAC_IL, ICE_MAC_IL_HW }, { ICE_ETYPE_OL, ICE_ETYPE_OL_HW }, @@ -6232,6 +6232,23 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts, return ICE_MAX_NUM_RECIPES; } +/** + * ice_change_proto_id_to_dvm - change proto id in prot_id_tbl + * + * As protocol id for outer vlan is different in dvm and svm, if dvm is + * supported protocol array record for outer vlan has to be modified to + * reflect the value proper for DVM. + */ +void ice_change_proto_id_to_dvm(void) +{ + u8 i; + + for (i = 0; i < ARRAY_SIZE(ice_prot_id_tbl); i++) + if (ice_prot_id_tbl[i].type == ICE_VLAN_OFOS && + ice_prot_id_tbl[i].protocol_id != ICE_VLAN_OF_HW) + ice_prot_id_tbl[i].protocol_id = ICE_VLAN_OF_HW; +} + /** * ice_prot_type_to_id - get protocol ID from protocol type * @type: protocol type diff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h index 78e6be35a9..dd50820430 100644 --- a/drivers/net/ice/base/ice_switch.h +++ b/drivers/net/ice/base/ice_switch.h @@ -536,4 +536,5 @@ bool ice_is_prof_rule(enum ice_sw_tunnel_type type); enum ice_status ice_update_recipe_lkup_idx(struct ice_hw *hw, struct ice_update_recipe_lkup_idx_params *params); +void ice_change_proto_id_to_dvm(void); #endif /* _ICE_SWITCH_H_ */ -- 2.32.0