From patchwork Tue Aug 3 08:38:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenjun Wu X-Patchwork-Id: 96598 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 12142A0C41; Tue, 3 Aug 2021 10:59:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B8E2041225; Tue, 3 Aug 2021 10:57:35 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 8832C411C3 for ; Tue, 3 Aug 2021 10:57:17 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10064"; a="211764422" X-IronPort-AV: E=Sophos;i="5.84,291,1620716400"; d="scan'208";a="211764422" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2021 01:57:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,291,1620716400"; d="scan'208";a="479396687" Received: from wuwenjun.sh.intel.com ([10.67.110.197]) by fmsmga008.fm.intel.com with ESMTP; 03 Aug 2021 01:57:12 -0700 From: Wenjun Wu To: dev@dpdk.org Date: Tue, 3 Aug 2021 16:38:14 +0800 Message-Id: <20210803083817.1243796-20-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210803083817.1243796-1-wenjun1.wu@intel.com> References: <20210803083817.1243796-1-wenjun1.wu@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 19/22] net/ice: update QinQ switch filter handling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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: Haiyue Wang [ upstream commit 23ea199b732bf54861aaea49e52c1089334b29ae ] The hardware outer/inner VLAN protocol types are now updated to map to new interface VLAN protocol types, so update the application to use new VLAN protocol types when the rte_flow is QinQ filter type. Signed-off-by: Haiyue Wang Acked-by: Qi Zhang --- drivers/net/ice/ice_switch_filter.c | 36 ++++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c index 7e4f041a68..455123ee06 100644 --- a/drivers/net/ice/ice_switch_filter.c +++ b/drivers/net/ice/ice_switch_filter.c @@ -558,12 +558,17 @@ ice_switch_inset_get(const struct rte_flow_item pattern[], bool profile_rule = 0; bool nvgre_valid = 0; bool vxlan_valid = 0; + bool qinq_valid = 0; bool ipv6_valid = 0; bool ipv4_valid = 0; bool udp_valid = 0; bool tcp_valid = 0; uint16_t j, t = 0; + if (*tun_type == ICE_SW_TUN_AND_NON_TUN_QINQ || + *tun_type == ICE_NON_TUN_QINQ) + qinq_valid = 1; + for (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) { if (item->last) { @@ -1101,22 +1106,25 @@ ice_switch_inset_get(const struct rte_flow_item pattern[], return 0; } - if (!outer_vlan_valid && - (*tun_type == ICE_SW_TUN_AND_NON_TUN_QINQ || - *tun_type == ICE_NON_TUN_QINQ)) - outer_vlan_valid = 1; - else if (!inner_vlan_valid && - (*tun_type == ICE_SW_TUN_AND_NON_TUN_QINQ || - *tun_type == ICE_NON_TUN_QINQ)) - inner_vlan_valid = 1; - else if (!inner_vlan_valid) - inner_vlan_valid = 1; + if (qinq_valid) { + if (!outer_vlan_valid) + outer_vlan_valid = 1; + else + inner_vlan_valid = 1; + } if (vlan_spec && vlan_mask) { - if (outer_vlan_valid && !inner_vlan_valid) { - list[t].type = ICE_VLAN_EX; - input_set |= ICE_INSET_VLAN_OUTER; - } else if (inner_vlan_valid) { + if (qinq_valid) { + if (!inner_vlan_valid) { + list[t].type = ICE_VLAN_EX; + input_set |= + ICE_INSET_VLAN_OUTER; + } else { + list[t].type = ICE_VLAN_IN; + input_set |= + ICE_INSET_VLAN_INNER; + } + } else { list[t].type = ICE_VLAN_OFOS; input_set |= ICE_INSET_VLAN_INNER; }