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 C4CF2A00BE; Wed, 29 Apr 2020 12:16:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A88DC1D933; Wed, 29 Apr 2020 12:16:18 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 266E51D67C for ; Wed, 29 Apr 2020 12:16:16 +0200 (CEST) IronPort-SDR: ESBT/37waLQUsgSEifQ+kXdPxjUgF3UxSUugj2bHQvnL76pHqzuK/3F3M3AwAVe5GQoN69SvXn JVL3DA9EBRPw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 03:16:16 -0700 IronPort-SDR: pU7+/wJw6xQI/xaPAAG6SVLemRijqnZLhhwb3P1lxG8QRuvmUhdPtGC4cMxYv7BpIYLKz2yLPe 6HYqikAyqbyg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,331,1583222400"; d="scan'208";a="261389680" Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132]) by orsmga006.jf.intel.com with ESMTP; 29 Apr 2020 03:16:15 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX105.amr.corp.intel.com (10.22.225.132) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 03:16:15 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 29 Apr 2020 03:16:15 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 29 Apr 2020 03:16:15 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.170) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Apr 2020 03:16:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ChgrQmR6Bg2E1m0qHSgmXa+06LQthfAa86+DbbCpdwRABNONKrUQOzNV1RYNjpTtG6x4qLiKFma5YxP8cK2heqmcLpmeKpnFkwG5ehmAPeFkbxNGqVL4TyeKUfJMBFGLWcE23ihxHvj/kQZ9mzh3cvIpuuE9nfKFJ1bwRzJXGWGUCLxsFzur5Lfx2MxR2SBliaAw0JUj/Woqk+dCxPqyj32ESmgWXRh15f12FZmy8ZGZEy78BBzSBAzxqivlUDdm8tOY2W1RPLtRlDltBNeIsKgtyLz/6J/3gOh+Qo9biRK96D8BcmYHGpWrgXT+/NMGNtv5K2KTkFauveJrhJBrrQ== 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=yUFAwtkVMVPeS8w24US5JQNracGu3LzVymVr5+hHbkA=; b=aFUrUS8fx+WFTGzuEh4bX7ZBvm5OBOeeR2z6t/Gi1awVovEdcSsuMrf5S+nZJcpNCL7ppsv0Qu4ZwILa47InaEzS0+vsPafMA46SltT+0OgQ6bMQWNbjJt2lpjkulkWyUO/SwM3F3sO7A/VmjUjZmDRCl58a3xkyNptgrq7V+MjnL9yjDoPXERY/TlM7+lMgHtZ9LIAAjXRlWcbiX+/wUeJtRzxgy52DTwuXI1XTs/Y16zT7Z+2sB9WezRuyj32PZmd7NhQdRnn53ig+BeSPrYgzf28YCjOudGFHuvzU56zZbTfEfRffgXAIXmsGAyHgKPpVZZiahGe2dilaTPINWQ== 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=yUFAwtkVMVPeS8w24US5JQNracGu3LzVymVr5+hHbkA=; b=JTi2sAvDIfYODgJ6aKuOgvJtuQhv0wmYHyfAMc52oWSM1o6nvW7lTRkr91jVdvcE5Pyax0PQsoDOkiY/2IlkEAKl2dFEghvfvVasi13IzB+hrqaeCSGuHgPsBCe4ofkjWMUoIzINKZ/v/ydoF9GuHtja3+8NeB2RUsDVyCQi17c= Received: from MN2PR11MB3566.namprd11.prod.outlook.com (2603:10b6:208:ec::12) by MN2PR11MB4461.namprd11.prod.outlook.com (2603:10b6:208:192::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Wed, 29 Apr 2020 10:16:13 +0000 Received: from MN2PR11MB3566.namprd11.prod.outlook.com ([fe80::211c:e0f7:1e47:57e1]) by MN2PR11MB3566.namprd11.prod.outlook.com ([fe80::211c:e0f7:1e47:57e1%6]) with mapi id 15.20.2937.028; Wed, 29 Apr 2020 10:16:13 +0000 From: "Fu, Qi" To: "Zhao1, Wei" , "dev@dpdk.org" CC: "Zhang, Qi Z" Thread-Topic: [PATCH] net/ice/base: fix bm mask set and find switch recipe method Thread-Index: AQHWHSk4mEOolxrjQ0qONjQPnYhtzKiP47aQ Date: Wed, 29 Apr 2020 10:16:13 +0000 Message-ID: References: <20200428062211.4216-1-wei.zhao1@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.52.196] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c35c2243-8c4f-4d61-b1db-08d7ec2658b6 x-ms-traffictypediagnostic: MN2PR11MB4461: 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: 03883BD916 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB3566.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(366004)(376002)(136003)(39860400002)(396003)(346002)(4326008)(5660300002)(478600001)(2906002)(186003)(53546011)(76116006)(71200400001)(107886003)(7696005)(6506007)(55016002)(66446008)(66556008)(66946007)(86362001)(66476007)(33656002)(8676002)(110136005)(64756008)(8936002)(26005)(316002)(9686003)(52536014); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Npckc7rBxtwyhWKAFQD3ou/yMls5w+7M7/urCXQSSo33O4V7QwfOZ+qPulYHqlxa9og5uQ9/rPMT+mjb7FmRwddym2rvhD3BvIy6aduoO3mkAXrQ8c795rWYQwkKMyDYu2nFfMWOBZJ/wMozcAuleughQiXUCtEgXrBFDD7yZmaUovLFYDAg9Rbhhbten8dnexI88jgeYSvRuo81OV30yrSN4W/730/QPtkDaU5z2ALmvgcilCxynnMv3cqdRr7DubkvWVXORFxQVcU3iDS2dKRN46jvetXAaJbK4/Urgi17UESHlQjRX9V4mjGf8OWtfglbbvOkiuGl/8qaPWgQnpfxLGTtsfSJ6kTR1QjsBVFgjgyacu9XF4OdS4iGo7YS2XCYyaCNmwzwWgKQlXr7taqNquTcutZn/n/CvAiYFYrsWXRZujW7+2KaiJLcyOgO x-ms-exchange-antispam-messagedata: jp2TePRcRoLUQvNGrQ6VHTcfJof4MGNcoT03B49/853awijeLtqQtINygdZ9DF6vAi20Y2RTb2GjRy3eBqWi84wgAqqkU1HqqeajnTJzFPxJjQuN4Ghfu+hiWp3tZn2UqvBp2Pl+m79bdCcBBXjukIzZeaqaW6ov+aGUMa+2hqra4wnTRQmbliGQ3vY0y+yhnhltR/RmkXHI1qNMJKGICHqrrAXBJG6k5wf3kAjpm/l2bOOS2w5AumVymNiPQuEeMd7ddq2is2BHz8WMEDqkNvRMqnjjVbv8irAjNi/8V+jUrcOu2PhllbDGiKTO2teZd2+kVi96XFuWyGmBXU/PMK7cH+xN6f5FJi4hR2xO7x5/2misGDx1d46x4g0FXldykBH95WXYRcenMk8NM7AdVnE/OOMvKPDsbajddZxxfSuypTqcEEqFkh7lZ4ZTlOcIncShVm8xLmhiXKzDKeRp4f5Pv/sXj6DeH3ZC5Mhj/xUoGiXWOblCaq1U+Bkd0K7uqT0CnTRpt7swj/9YfUIJR3mshkCyLkKw0Iy03MwFq4jDdvgzWXQuRaj2eZIEHeAFS+OoWczaKx7rl1guWlBdwLs9aK1nriFZMz0WjKiJCrbHeV7euDxRaXzsyLhyzbnEjyVHy7/ouNXIWcyROJvY0SwsiPG/I0/oATv6fpZYSNLxlOjg7RtVEbI0kAaRyFKZfd9xsof08QfWqZ2WSUiuueDxNZEp7yPdArIoid+3yuSQkWhoXnL5uUG58aS9V+/VPfFVSKxNPFeN62psbDesAqsCAqWgmoTF6k8zdDo8u98= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c35c2243-8c4f-4d61-b1db-08d7ec2658b6 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2020 10:16:13.6475 (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: 98ubr0lxW+H7xfSl5YErVfTtXykeFKOjMBTP+a25fCEk5nmsZyOQhlhuzMfu6Qgd X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4461 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" Tested-by: Fu, Qi > -----Original Message----- > From: Zhao1, Wei > Sent: Tuesday, April 28, 2020 2:50 PM > To: dev@dpdk.org > Cc: Zhang, Qi Z ; Fu, Qi > Subject: RE: [PATCH] net/ice/base: fix bm mask set and find switch recipe > method >=20 > Add fuqi >=20 > > -----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 > > method > > > > 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=3D"00:00:00:00:01:00")/IP(proto=3D50)/ESP(spi=3D1)/ > > ("X"*480)], iface=3D"ens5f0", count=3D10)" > > > > 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" > > > > 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(-) > > > > 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) > > > > /* 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