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 57070A00BE; Tue, 28 Apr 2020 08:50:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3A9201D41A; Tue, 28 Apr 2020 08:50:52 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id A6AEC1D15E for ; Tue, 28 Apr 2020 08:50:49 +0200 (CEST) IronPort-SDR: ceiKdKKAAfbewFULFtD2KwXkTl+Bj6jeyobkDumS/hP1HzrPS1VF3C907DGn2orO+LhE2gFWXO 3RQHakh330ow== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2020 23:50:48 -0700 IronPort-SDR: YpU68B5+XjvZBWhFPhnfBwgDSmfoIuYahVGpggWrBqmnFKnpwSEc60VKE2SVWLD2u/+USa8bkK qg4VXw7BpYUw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,327,1583222400"; d="scan'208";a="249091051" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga008.fm.intel.com with ESMTP; 27 Apr 2020 23:50:48 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 27 Apr 2020 23:50:47 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.55) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 27 Apr 2020 23:50:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jZzJF3f5Iffc4UnaMTFnjwkR5DDD42wHor/W05lerHInhN4nezPPyfdwQi6D2rLzUyyzwQxn63CNOyF+CiWoBc/sUrvtacHpaVps9Ju0isE0YcmE401XcQB/46SOuCMRYmB3u7KJFJ8MLHZQJUNz4cb/3MiBylITuCVhxiVa9DAyLF+GqlSVHzXaWGr+GPK8HxJ/3/uXmESCG810JmrSPC27KpA4rc1VZhJTuqqv+3lEAzyYrvP0ePYQy56h9yVYAwegwBZ0XgR3BG7jsQ1goDMLZ2TcUoRHcEqNNFOcdqwTGQ6bETPPdXXhN0dPNobCyk+2FyjxsF+Hm0trwTN/eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tWINb8vzmQUTa0kSrnuoxvEa+h77S5AbTHqvZaFdGvw=; b=kCyGaomZpN35oso7zKS8H4uKXdIrv7ONkBQQ46xq3kbe61qGOJVosJEjow7bqcIwsB43XawQk/O7PVDH/qO3Gx3m17wJ3tXGxpecrnE3IuNPpA96dBi7oqykxb27UnJ5UhxqlQFduLl/idjlEhQRoL572zp4yJ5ZpN5d6CHtcDvSUxXd5O2VHc7utiVwj2oUkqV5GtVTpWcXyJlV7YfnVchWmaVUyPLmIK8sfd24H55AlRxKtisx9bHgugcswJ3qcq8dhZISvE6Wu7OIrJYo7kTKf/eETIy+LDbyMq2Db7PKCUATN4hrhQXSsPxm5wGw7NsLljxjNQOirM4mzo2PUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tWINb8vzmQUTa0kSrnuoxvEa+h77S5AbTHqvZaFdGvw=; b=QznbV8yiL2xFhf6Bjk6PyiTsaSKHKPl76YePQwOnBvdlBkxWUM5SycKMk4Wf9+7NNWAA5oLTq+0is1LkCYYaU4Q+e4wSaPvfya7XpTec40Gqegl0zH8tVw29oxgqhgtDP7W4gmtw8j3J5iiMQ0pH+hV3ZlKRl4SAXlHjtFIIECI= Received: from MWHPR11MB1391.namprd11.prod.outlook.com (2603:10b6:300:23::15) by MWHPR11MB1245.namprd11.prod.outlook.com (2603:10b6:300:28::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Tue, 28 Apr 2020 06:49:52 +0000 Received: from MWHPR11MB1391.namprd11.prod.outlook.com ([fe80::c809:34b4:173b:d211]) by MWHPR11MB1391.namprd11.prod.outlook.com ([fe80::c809:34b4:173b:d211%7]) with mapi id 15.20.2937.023; Tue, 28 Apr 2020 06:49:51 +0000 From: "Zhao1, Wei" To: "dev@dpdk.org" CC: "Zhang, Qi Z" , "Fu, Qi" Thread-Topic: [PATCH] net/ice/base: fix bm mask set and find switch recipe method Thread-Index: AQHWHSiXiMEq833EXUqlSkS9HOR+HKiOF/PQ Date: Tue, 28 Apr 2020 06:49:51 +0000 Message-ID: References: <20200428062211.4216-1-wei.zhao1@intel.com> In-Reply-To: <20200428062211.4216-1-wei.zhao1@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGViMDg4NmItMjZmYS00ZGMyLTk0NTYtMjBlZjA4YWM3ZjdjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoib0MyVGNFR2I0ZHBmMlA0ajU5NGdSc1Q0SUJ1Z1B6dFBrOWgyVE9tU0lFekRaeDIrNlpOanduSU5uMmI5MkxrQSJ9 dlp-version: 11.0.600.7 dlp-product: dlpe-windows x-ctpclassification: CTP_NT dlp-reaction: no-action authentication-results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=intel.com; x-originating-ip: [134.191.221.116] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 543427fe-eaa7-4a13-a638-08d7eb405a2b x-ms-traffictypediagnostic: MWHPR11MB1245: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 0387D64A71 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1391.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(376002)(396003)(346002)(136003)(366004)(39860400002)(55016002)(54906003)(53546011)(26005)(9686003)(107886003)(186003)(316002)(6506007)(7696005)(5660300002)(66476007)(52536014)(71200400001)(478600001)(6916009)(66946007)(8676002)(8936002)(4326008)(81156014)(64756008)(86362001)(66446008)(66556008)(33656002)(2906002)(76116006); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RH3oMUBK4bRPkpIjxDMulguPcZ/3P28rckkIEgNQezGhxjV6BuyoavijlYz8Bc7Idb4X5LziXTc2YTHllOEjxX2ylqZdO5sZGMM461mzqRLOkUN25W+SC/69Aqmqs8xgCnCPgvr2tNErmg921ZyvQaMj5DdKnH9ZdS10FoiPoGpPPG5HTX9xIqi6UCrjOvHGn5kzTuBwGk9y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vS2qldzKGqqY+adJnqxmKMjv Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 543427fe-eaa7-4a13-a638-08d7eb405a2b X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Apr 2020 06:49:51.8819 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 7oIxck1p8vroGKNH12ChZsi43vYFihvpnWz1tVxZePQIbDDCT51rcZdcwyrpcHYjU9irBfpyJei4XDYusBQQAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1245 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] 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" Add fuqi > -----Original Message----- > From: Zhao1, Wei > Sent: Tuesday, April 28, 2020 2:22 PM > To: dev@dpdk.org > Cc: Zhang, Qi Z ; Zhao1, Wei > Subject: [PATCH] net/ice/base: fix bm mask set and find switch recipe met= hod >=20 > When we download a switch rule for ipv6 with esp payload "eth / ipv6 / es= p spi > is 1 / end actions queue index 2 / end" >=20 > if we don't add bm bit set check for tun_type, then a packet of > ipv4 with esp payload >=20 > "sendp([Ether(dst=3D"00:00:00:00:01:00")/IP(proto=3D50)/ESP(spi=3D1)/ > ("X"*480)], iface=3D"ens5f0", count=3D10)" >=20 > 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 sw= itch > rule download function ice_aq_sw_rules(). >=20 > "eth / ipv4 / esp spi is 1 / end actions queue index 5 / end" >=20 > "eth / ipv6 / esp spi is 1 / end actions queue index 2 / end" >=20 > Signed-off-by: Wei Zhao > --- > drivers/net/ice/base/ice_switch.c | 15 ++++++++++----- > drivers/net/ice/base/ice_switch.h | 2 ++ > 2 files changed, 12 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/net/ice/base/ice_switch.c > b/drivers/net/ice/base/ice_switch.c > index e64b03136..7d5d57938 100644 > --- a/drivers/net/ice/base/ice_switch.c > +++ b/drivers/net/ice/base/ice_switch.c > @@ -5278,11 +5278,8 @@ 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 =3D=3D recp[i].tun_type && found) > - return i; /* Return the recipe ID */ > - else if (!ice_is_prof_rule(tun_type) && found) > - return i; /* Return the recipe ID */ > + if (tun_type =3D=3D recp[i].tun_type && found) > + return i; > } > } > return ICE_MAX_NUM_RECIPES; > @@ -5998,9 +5995,11 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, > struct ice_adv_rule_info *rinfo, > prof_type =3D 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: > @@ -6029,6 +6028,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 =3D 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) >=20 > /* 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