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 50379A0C40 for ; Fri, 11 Jun 2021 09:38:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A7FA41102; Fri, 11 Jun 2021 09:38:27 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 04C0D410F9 for ; Fri, 11 Jun 2021 09:38:25 +0200 (CEST) IronPort-SDR: WeUkZ/f/lwWqR35yGFZoFVzW2FKFkubgjOi9S7RlzV2y6rjfpa1nd6jyNxPAx8j961eZ4nKPxO sWNPRe/AzCPA== X-IronPort-AV: E=McAfee;i="6200,9189,10011"; a="185171387" X-IronPort-AV: E=Sophos;i="5.83,265,1616482800"; d="scan'208";a="185171387" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2021 00:38:25 -0700 IronPort-SDR: hwOLnPoiYJHpg8/WK8Gp7HhUllUYurvjsfXQsdxTMe/QiD6xbqDDAUwSaOlonqZUyFWBtaHiAk ojY5XmTw7woQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,265,1616482800"; d="scan'208";a="483170057" Received: from npg-dpdk-haiyue-1.sh.intel.com ([10.67.118.197]) by orsmga001.jf.intel.com with ESMTP; 11 Jun 2021 00:38:22 -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, haiyue.wang@intel.com, Qiming Yang Date: Fri, 11 Jun 2021 15:15:30 +0800 Message-Id: <20210611071531.48411-19-haiyue.wang@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210611071531.48411-1-haiyue.wang@intel.com> References: <20210611065825.47678-1-haiyue.wang@intel.com> <20210611071531.48411-1-haiyue.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 20.11 v2 18/18] net/ice: update QinQ switch filter handling 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" [ 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 6dfad48694..a66b6ff7e2 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; } -- 2.32.0