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 8FAB1A0352; Wed, 6 May 2020 07:25:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF0991D668; Wed, 6 May 2020 07:25:34 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 53D331D665 for ; Wed, 6 May 2020 07:25:32 +0200 (CEST) IronPort-SDR: F9xI3lwYPVDEOTjIIg2qlxlGjcZ8cJa58neeoy9+YHUFYSrWNUK7HND5JBPzWBzBvO5o7jdsj4 7jX6gO7r+2hw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2020 22:25:31 -0700 IronPort-SDR: kX6uDFuiu+T68VDJ2V+oKmiKd0MlJutbRkEr/laNQDuJ5fdiXF0sWwp6FlxQJi3Bu7CiGODkb0 961I4wSq1ojg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,357,1583222400"; d="scan'208";a="263430063" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.116.183]) by orsmga006.jf.intel.com with ESMTP; 05 May 2020 22:25:30 -0700 Date: Wed, 6 May 2020 13:17:47 +0800 From: Ye Xiaolong To: Wei Zhao Cc: dev@dpdk.org, qi.fu@intel.com, qi.z.zhang@intel.com Message-ID: <20200506051747.GB71070@intel.com> References: <20200428062211.4216-1-wei.zhao1@intel.com> <20200429084227.26124-1-wei.zhao1@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200429084227.26124-1-wei.zhao1@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v2] net/ice/base: fix bm mask set and find switch recipe method X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" On 04/29, Wei Zhao wrote: >When we download a switch rule for ipv6 with esp payload >"eth / ipv6 / esp spi is 1 / end actions queue index 2 / end" > >if we don't add bm bit set check for tun_type, then a packet of >ipv4 with esp payload > >"sendp([Ether(dst="00:00:00:00:01:00")/IP(proto=50)/ESP(spi=1)/ >("X"*480)], iface="ens5f0", count=10)" > >will also go to queue index 2. And also, we need to do tun_type >check, or the second rule of following can not be download because >of rejection from switch rule download function ice_aq_sw_rules(). > >"eth / ipv4 / esp spi is 1 / end actions queue index 5 / end" > >"eth / ipv6 / esp spi is 1 / end actions queue index 2 / end" > >Fixes: 4f11962fce84 ("net/ice/base: support AH ESP and NAT-T on switch") >Fixes: 99d8ba79efbe ("net/ice/base: force switch to use different recipe") > >Signed-off-by: Wei Zhao >--- > drivers/net/ice/base/ice_switch.c | 13 +++++++++---- > drivers/net/ice/base/ice_switch.h | 2 ++ > 2 files changed, 11 insertions(+), 4 deletions(-) > >diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c >index 957142a10..f3d52d2dc 100644 >--- a/drivers/net/ice/base/ice_switch.c >+++ b/drivers/net/ice/base/ice_switch.c >@@ -5285,10 +5285,7 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts, > /* If for "i"th recipe the found was never set to false > * then it means we found our match > */ >- if (ice_is_prof_rule(tun_type) && >- tun_type == recp[i].tun_type && found) >- return i; /* Return the recipe ID */ >- else if (!ice_is_prof_rule(tun_type) && found) >+ if (tun_type == recp[i].tun_type && found) > return i; /* Return the recipe ID */ > } > } >@@ -6005,9 +6002,11 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo, > prof_type = ICE_PROF_TUN_PPPOE; > break; > case ICE_SW_TUN_PROFID_IPV6_ESP: >+ case ICE_SW_TUN_IPV6_ESP: > ice_set_bit(ICE_PROFID_IPV6_ESP, bm); > return; > case ICE_SW_TUN_PROFID_IPV6_AH: >+ case ICE_SW_TUN_IPV6_AH: > ice_set_bit(ICE_PROFID_IPV6_AH, bm); > return; > case ICE_SW_TUN_PROFID_MAC_IPV6_L2TPV3: >@@ -6036,6 +6035,12 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo, > case ICE_SW_TUN_IPV4_L2TPV3: > ice_set_bit(ICE_PROFID_MAC_IPV4_L2TPV3, bm); > return; >+ case ICE_SW_TUN_IPV4_ESP: >+ ice_set_bit(ICE_PROFID_IPV4_ESP, bm); >+ return; >+ case ICE_SW_TUN_IPV4_AH: >+ ice_set_bit(ICE_PROFID_IPV4_AH, bm); >+ return; > case ICE_SW_TUN_AND_NON_TUN: > default: > prof_type = ICE_PROF_ALL; >diff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h >index 09dc1f236..6bb742d2f 100644 >--- a/drivers/net/ice/base/ice_switch.h >+++ b/drivers/net/ice/base/ice_switch.h >@@ -16,7 +16,9 @@ > #define ICE_FLTR_TX_RX (ICE_FLTR_RX | ICE_FLTR_TX) > > /* Switch Profile IDs for Profile related switch rules */ >+#define ICE_PROFID_IPV4_ESP 71 > #define ICE_PROFID_IPV6_ESP 72 >+#define ICE_PROFID_IPV4_AH 73 > #define ICE_PROFID_IPV6_AH 74 > #define ICE_PROFID_IPV4_NAT_T 75 > #define ICE_PROFID_IPV6_NAT_T 76 >-- >2.19.1 > Applied to dpdk-next-net-intel, Thanks.