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 E04C7A04A6; Wed, 9 Feb 2022 13:21:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A68EE41143; Wed, 9 Feb 2022 13:21:23 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 6AF2840140 for ; Wed, 9 Feb 2022 13:21:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644409282; x=1675945282; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=2S6enZ8Hzu01CKnqPzNcxAatBx+wUwiYk8tMMJqO52I=; b=h4jk30Mt5n8ixN8MEdY2PSvWF9jvbS7i6EleSqDUGELHC/73Ycz2A7NA JG+67ukz7/q1YTZoCpxGZI5/iQ15pyYIoe+PSn2iW4eKdyO53nBX5Pih8 V/5hXLuZo0mjC8G4ckigLuNsqSDmK7zUDr/VpHlK/N0hIDtEeNIZ7RV8U vj44extBQZPB2wGmpvKv7m3ZnKGFuMMPj60LJIqeibjOXwN1ym5fbGgVU WYyvQlniLUkZaj5DgqTI3+SuCpMN51KMTSipDg9nnUsrojQGEo9EI3PxK 6cC0uI+Io96HfY4f3jG559A6fyaFnR/GaQuJc0Zglgizus6SAz7YBK4vF g==; X-IronPort-AV: E=McAfee;i="6200,9189,10252"; a="232757921" X-IronPort-AV: E=Sophos;i="5.88,355,1635231600"; d="scan'208";a="232757921" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 04:21:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,355,1635231600"; d="scan'208";a="525967742" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga007.jf.intel.com with ESMTP; 09 Feb 2022 04:21:21 -0800 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 9 Feb 2022 04:21:21 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Wed, 9 Feb 2022 04:21:21 -0800 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.49) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Wed, 9 Feb 2022 04:21:21 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f2i1YiOdTmES4nQx7/3GKBfjsc3G/i0U7+eVhOQX51MgviJNNTXAn/tt/XDwqIZaQlPltssldnHxz2PH5sJn6CGoAJdJiZyiX/cVegUoCr+GlfhvgEQ+s3vg1csS2fIi+pPwtmFsY/DhATXOI+iJfXtejtB3Qkle78WOWmCKSDlRMre7btH/EqTeQASiBKEzh/SzreKpjz63EgyE4dlSUdTL6ZNXDo3G6NX3c0+BWn2S+FM8m7Wn3dApkIImT1NPaEzD9sUlf80B9uwfbWVufcYUq98pYDvxnmr7ktiUya6ZnXheTkx4TYLJNUYITAuIIrPvQUSCf59RGLIPkfk53w== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iHExY1Zo4VnevzJ87PZYYD6DMkvldG7ZQi81WpBb8iY=; b=iynk8s5kjtYw3LyUmLQTuJuBCW6MxHK3In8yT1nSO2s0bww03W8v8ePhxq69SAdIHSZWW3qgWr3Wza6RwItNWfObq7FW5H2Vqd7bBZLCqovXYBLrF+7BYvZmPml2Vc2Ee6D8CY4a+x5OBp2MFCG55FiELInPDTL/pG2o8H4rR18OM5Szo/+Pmesv97ympQObTC0fe8NK2eCWDGrr9fom/nX9PNrqN+Six9RYhMVXSSr2odNsMeguACdeLps1O3I+wSRlOW5sbn49c24ZLP6B6y0u0w4QmI3gifaaSI/gqlIxKTyOBnZgDZ6sE1KRdIDvl9v4J/l2iyPmODM9q93+iw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DM6PR11MB3098.namprd11.prod.outlook.com (2603:10b6:5:70::11) by DM6PR11MB4171.namprd11.prod.outlook.com (2603:10b6:5:191::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.17; Wed, 9 Feb 2022 12:21:17 +0000 Received: from DM6PR11MB3098.namprd11.prod.outlook.com ([fe80::4c15:87ef:5338:e0fa]) by DM6PR11MB3098.namprd11.prod.outlook.com ([fe80::4c15:87ef:5338:e0fa%4]) with mapi id 15.20.4951.019; Wed, 9 Feb 2022 12:21:17 +0000 From: "Xing, Beilei" To: "Wang, Jie1X" , "dev@dpdk.org" CC: "Yang, SteveX" , "orika@nvidia.com" , "Singh, Aman Deep" , "Yigit, Ferruh" , "thomas@monjalon.net" , "andrew.rybchenko@oktetlabs.ru" , "Wu, Jingjing" , "Zhang, Qi Z" , "olivier.matz@6wind.com" Subject: RE: [PATCH v5 5/6] net/iavf: support L2TPv2 for AVF HASH Thread-Topic: [PATCH v5 5/6] net/iavf: support L2TPv2 for AVF HASH Thread-Index: AQHYHZj1DxSZwtm3CkC02VY2loPcLqyLI68w Date: Wed, 9 Feb 2022 12:21:17 +0000 Message-ID: References: <20220208083849.510136-1-jie1x.wang@intel.com> <20220209093857.79364-1-jie1x.wang@intel.com> <20220209093857.79364-6-jie1x.wang@intel.com> In-Reply-To: <20220209093857.79364-6-jie1x.wang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1cf4dab0-c46b-4485-b7e8-08d9ebc6ac50 x-ms-traffictypediagnostic: DM6PR11MB4171:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:289; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vF8cKW9WHvtXVfIoBEFeD3Nd1MNRYQXDhwoIGofFmr4PVqHmyRxENtMNfgGRATNlBNM4paxVcGgfp10aYa+72FII0J3q/7vF1HNnxknv8bu2S4SKuXkixX2XBQCfYRz/sivO577HoEWMqxe6NA0Vsf80hV2fQyv2sSUV6+H3RUEorPXL2kCzuGkJT9JT+l+P1hjxy7/3o5xTCUxO0wDg4ojGeAJ1WdbiKDWU0nCkoVA7zG2SvXEYaqDXCwU6FKfJ3o2+dC5CwWUpXsFvI9G7CirnozsHNLDIsxp9VwtTISkmChjnsIOA6qxy/lpZ//bkvr+EWG+F8F7AWCLWURkJQH8aYov6NJumfJjuDLvZXaZSusiIJ2T47h1oJnp3QsrlVIMinoucswrjsZX7pbw+poxnBgHWOXqmGbrEgPgjkJMOVTZZj/6UCgIprm6HQQWe4pWxJUmfHOi2aRA8brFy64CDEqi7XtIziNh1aP4Vp14DQZpwawxTbk/+F/zrHbaD+YozFyuIAXtjDugAwNv9vkJaw8uUptIuUcQ7iuy6WZH5gWOotRJv7zzzkwXyvnQHDE9u2ou1QNUNmG1FeLKH92FWbvzrgxKMAoPWJkP8BkEyzifgYyHBOc506Sst7HhtgNSw4X07ghEQhQhPR1OFhsrQpwK7F8fhY650UQvfvoAD8wVz85a4KaDjAid1oJmrzFoF5QMFECwzePIzj6V4kw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3098.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(9686003)(71200400001)(30864003)(55016003)(7696005)(66946007)(53546011)(316002)(508600001)(66556008)(6506007)(2906002)(33656002)(186003)(26005)(76116006)(4326008)(38070700005)(66446008)(86362001)(8676002)(83380400001)(64756008)(110136005)(54906003)(82960400001)(52536014)(66476007)(5660300002)(8936002)(122000001)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?SclKRZtKy+Bvvzpr8ABXFgrr8mnjBWSHsFbC8cpvVvR15Kiuh1i4CEFvuseW?= =?us-ascii?Q?On5xCYtZuBywRp2zN3elcHbEjEl3AAlNJUJtwzRjKd4kWRurdGxGdULsLUli?= =?us-ascii?Q?1zZrOtvDYhLiRF5JxPdigIyC+gTmdY9Ii+C/Vk4VUTGkq3ruUKwykhYR/c0Y?= =?us-ascii?Q?e1XxyEJEmWseR8LrVsq9rtUAGI4Yd7R7kKQWfGFJKQs/nu2JR3I8mELUyg73?= =?us-ascii?Q?tAXex7KfkQZGbAjYf7FMdUw1QHDVsuYYwezwEo70kxTY8oURGgnXAEFGbh+t?= =?us-ascii?Q?27shnZRmYwvFET4wfX6hpcEmQ9EcJF2klARrEO2eKksZcjRR8hBVf2PbdqUE?= =?us-ascii?Q?h2G8ahYj2Vosy0I2tsseR3nq909msCvT55+DbNPFpK2FbzZx8fQIBFaS3bJT?= =?us-ascii?Q?qMg7RjpL3Cxwk27ML8LdH1SPU0rLo2aDyjwhZpyP4hf3Zm9SxWJpZA/oNdhD?= =?us-ascii?Q?N3vY1xUi4SwgX1/+jl+YFdmCr4j8d84PiSIQ2NK1RrsZ/X31ATlPAggJxgJ/?= =?us-ascii?Q?BZvORzMIV0fC8SMRSZMog1AiBQUT2snqkIBB0HOc6fjxGhF6wKA8x7mVPCHN?= =?us-ascii?Q?hMZzGMj6XOhb3PKDdvAaSghyqEN27VatZg+HJE6kBcxI16H/zYiSPZtA9kaa?= =?us-ascii?Q?HerOLT5WXV8lI6pbu/xZn9IHfhheijCbUkm6cbuY/nEDQ83WfAEn0SuEEKr5?= =?us-ascii?Q?zDZjxc+QrJOzPo3fe1FiQtNTWQfrtxEKRig+ppAc/uqBcE3RBwHEWqQH+Jd3?= =?us-ascii?Q?kERREQGJTV9PZSLY/AXSzQojGvsm8fJa8m4TB9/N9T0M/8+9i4DpIRjN5P+Z?= =?us-ascii?Q?ObN1yjnltIoqptuffmBuZONgdM4j5GAvYLmYfAJvMI5wUzi183moO2bnhOZj?= =?us-ascii?Q?hm9gM/mO7KQN754/hh2CahoP9RNzFTtuaDeAgf8GHBwCIkKfcjtJyEhsm0wz?= =?us-ascii?Q?bo+W7pdpDTlNVirQbeQpskgT/DVABCNyXKl9VfY5YD1yvkCRvmAjb9heyO34?= =?us-ascii?Q?/eHAeosIdRXdv3E0R0oPkRamWU9OJSjDNYhtwAauEOJhXOdxY+tLJnHJ3sUg?= =?us-ascii?Q?aV3o0M4t6WX7RLKP5Hux7jl18Ln6+6q4RR8onItJFdPNjxRtzPExqmTXPUBZ?= =?us-ascii?Q?G5wBkhDhoWkRDrcdl7IsFjumtZ4w+Igz0lShrRwYAdBLP86Hm7awJ8gJoSAJ?= =?us-ascii?Q?SP+e8BSSw8ga0WIRsE7zjK3TmyU9QxiB1LZ5EAA8KfoGq+dI12jUr4nrf95T?= =?us-ascii?Q?z/qjLpnd5seaPibvFMUYlmie6cFXCvH4q/eEA/jXiI/kvMqVZJMBnNdoH3UI?= =?us-ascii?Q?k4dCo6JxLN/SNWyUvCQJ+yr9nVQoRvphZkGOiaeJFTReZgK2KGyjZSXONy95?= =?us-ascii?Q?YvS4kwrls97gFWa+7Q4jfosIX52MFIdnzlMMsKF5rPl1hlXQsjV2eYquSLvB?= =?us-ascii?Q?bYZrAZN6YCSpQI9EF6XC7AB774SbIn7tg2OQvOuGBoAghv9q9v8ikHjpEWeI?= =?us-ascii?Q?xI/O10JGDvRl+Z/aqhoR7Y9Ds6pZmt0XPB5uq3nHawHcpZqFydgEsM5ZPpN9?= =?us-ascii?Q?KUHcxtCXfedyExILdyFrkgsKfn3W8I52c5//hCwDuSVBemYqbjP3szmCAgFh?= =?us-ascii?Q?RESBlQC5kBJZStYULSmvV/g=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3098.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1cf4dab0-c46b-4485-b7e8-08d9ebc6ac50 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Feb 2022 12:21:17.5565 (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: HofhvQxty4tRfXJXz7GKvNS3DnmuRnwbUK5dmGpFWUigzrFzJf8hBt818I1jEyfIjGb36WUgbRbnx/gPzMWrYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4171 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Wang, Jie1X > Sent: Wednesday, February 9, 2022 5:39 PM > To: dev@dpdk.org > Cc: Yang, SteveX ; orika@nvidia.com; Singh, Aman > Deep ; Yigit, Ferruh ; > thomas@monjalon.net; andrew.rybchenko@oktetlabs.ru; Wu, Jingjing > ; Xing, Beilei ; Zhang, Qi = Z > ; olivier.matz@6wind.com; Wang, Jie1X > > Subject: [PATCH v5 5/6] net/iavf: support L2TPv2 for AVF HASH >=20 > Add support for PPP over L2TPv2 over UDP protocol and L2TPv2 protocol RSS > hash based on outer MAC src address and L2TPv2 session ID. The commit log and the release notes for RSS/FDIR should be changed, too. >=20 > Patterns are listed below: > eth/ipv4/udp/l2tpv2 > eth/ipv4/udp/l2tpv2/ppp > eth/ipv6/udp/l2tpv2 > eth/ipv6/udp/l2tpv2/ppp >=20 > Signed-off-by: Jie Wang > --- > doc/guides/rel_notes/release_22_03.rst | 5 ++ > drivers/net/iavf/iavf.h | 2 + > drivers/net/iavf/iavf_generic_flow.c | 34 +++++++++++ > drivers/net/iavf/iavf_generic_flow.h | 6 ++ > drivers/net/iavf/iavf_hash.c | 81 ++++++++++++++++++++++++-- > 5 files changed, 124 insertions(+), 4 deletions(-) >=20 > diff --git a/doc/guides/rel_notes/release_22_03.rst > b/doc/guides/rel_notes/release_22_03.rst > index 17c25d899c..37921fc44f 100644 > --- a/doc/guides/rel_notes/release_22_03.rst > +++ b/doc/guides/rel_notes/release_22_03.rst > @@ -83,6 +83,11 @@ New Features > * Added rte_flow support for matching GENEVE packets. > * Added rte_flow support for matching eCPRI packets. >=20 > +* **Updated Intel iavf driver.** > + > + * Added L2TPv2(include PPP over L2TPv2) RSS hash distribute packets > + based on outer MAC src address and L2TPv2 session ID. > + > * **Updated Marvell cnxk crypto PMD.** >=20 > * Added SHA256-HMAC support in lookaside protocol (IPsec) for CN10K. > diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index > 0bb5698583..a01d18e61b 100644 > --- a/drivers/net/iavf/iavf.h > +++ b/drivers/net/iavf/iavf.h > @@ -93,6 +93,8 @@ >=20 > #define IAVF_VLAN_TAG_PCP_OFFSET 13 >=20 > +#define IAVF_L2TPV2_FLAGS_LEN 0x4000 > + > struct iavf_adapter; > struct iavf_rx_queue; > struct iavf_tx_queue; > diff --git a/drivers/net/iavf/iavf_generic_flow.c > b/drivers/net/iavf/iavf_generic_flow.c > index 2befa125ac..1de4187e67 100644 > --- a/drivers/net/iavf/iavf_generic_flow.c > +++ b/drivers/net/iavf/iavf_generic_flow.c > @@ -1611,6 +1611,40 @@ enum rte_flow_item_type > iavf_pattern_eth_ipv6_gre_ipv6_udp[] =3D { > RTE_FLOW_ITEM_TYPE_END, > }; >=20 > +enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[] =3D { > + RTE_FLOW_ITEM_TYPE_ETH, > + RTE_FLOW_ITEM_TYPE_IPV4, > + RTE_FLOW_ITEM_TYPE_UDP, > + RTE_FLOW_ITEM_TYPE_L2TPV2, > + RTE_FLOW_ITEM_TYPE_END, > +}; > + > +enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[] =3D { > + RTE_FLOW_ITEM_TYPE_ETH, > + RTE_FLOW_ITEM_TYPE_IPV4, > + RTE_FLOW_ITEM_TYPE_UDP, > + RTE_FLOW_ITEM_TYPE_L2TPV2, > + RTE_FLOW_ITEM_TYPE_PPP, > + RTE_FLOW_ITEM_TYPE_END, > +}; > + > +enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[] =3D { > + RTE_FLOW_ITEM_TYPE_ETH, > + RTE_FLOW_ITEM_TYPE_IPV6, > + RTE_FLOW_ITEM_TYPE_UDP, > + RTE_FLOW_ITEM_TYPE_L2TPV2, > + RTE_FLOW_ITEM_TYPE_END, > +}; > + > +enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[] =3D { > + RTE_FLOW_ITEM_TYPE_ETH, > + RTE_FLOW_ITEM_TYPE_IPV6, > + RTE_FLOW_ITEM_TYPE_UDP, > + RTE_FLOW_ITEM_TYPE_L2TPV2, > + RTE_FLOW_ITEM_TYPE_PPP, > + RTE_FLOW_ITEM_TYPE_END, > +}; > + > /* PPPoL2TPv2oUDP */ > enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[] =3D = { > RTE_FLOW_ITEM_TYPE_ETH, > diff --git a/drivers/net/iavf/iavf_generic_flow.h > b/drivers/net/iavf/iavf_generic_flow.h > index 3681a96b31..107bbc1a23 100644 > --- a/drivers/net/iavf/iavf_generic_flow.h > +++ b/drivers/net/iavf/iavf_generic_flow.h > @@ -410,6 +410,12 @@ extern enum rte_flow_item_type > iavf_pattern_eth_ipv6_gre_ipv6_tcp[]; > extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_udp[]; > extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[]; >=20 > +/* L2TPv2 */ > +extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2[]; > +extern enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_l2tpv2_ppp[]; > +extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2[]; > +extern enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_l2tpv2_ppp[]; > + > /* PPPoL2TPv2oUDP */ > extern enum rte_flow_item_type > iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4[]; > extern enum rte_flow_item_type > iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6[]; > diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c = index > 5e0888ea68..f35a07653b 100644 > --- a/drivers/net/iavf/iavf_hash.c > +++ b/drivers/net/iavf/iavf_hash.c > @@ -36,6 +36,7 @@ > #define IAVF_PHINT_MID_IPV6 BIT_ULL(8) > /* L2TPv2 */ > #define IAVF_PHINT_L2TPV2 BIT_ULL(9) > +#define IAVF_PHINT_L2TPV2_LEN BIT_ULL(10) >=20 > #define IAVF_PHINT_GTPU_MSK (IAVF_PHINT_GTPU | \ > IAVF_PHINT_GTPU_EH | \ > @@ -167,7 +168,9 @@ iavf_hash_parse_pattern_action(struct iavf_adapter > *ad, > FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_ECPRI_PC_RTC_ID), > {BUFF_NOUSED} } >=20 > #define proto_hdr_l2tpv2 { \ > - VIRTCHNL_PROTO_HDR_L2TPV2, 0, {BUFF_NOUSED} } > + VIRTCHNL_PROTO_HDR_L2TPV2, \ > + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV2_SESS_ID) | \ > + FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_L2TPV2_LEN_SESS_ID), > {BUFF_NOUSED} } >=20 > #define proto_hdr_ppp { \ > VIRTCHNL_PROTO_HDR_PPP, 0, {BUFF_NOUSED} } @@ -392,6 +395,40 > @@ struct virtchnl_proto_hdrs udp_l2tpv2_ppp_ipv6_tcp_tmplt =3D { > proto_hdr_tcp} > }; >=20 > +struct virtchnl_proto_hdrs ipv4_l2tpv2_tmplt =3D { > + TUNNEL_LEVEL_OUTER, 4, > + {proto_hdr_eth, > + proto_hdr_ipv4, > + proto_hdr_udp, > + proto_hdr_l2tpv2} > +}; > + > +struct virtchnl_proto_hdrs ipv6_l2tpv2_tmplt =3D { > + TUNNEL_LEVEL_OUTER, 4, > + {proto_hdr_eth, > + proto_hdr_ipv6, > + proto_hdr_udp, > + proto_hdr_l2tpv2} > +}; > + > +struct virtchnl_proto_hdrs ipv4_l2tpv2_ppp_tmplt =3D { > + TUNNEL_LEVEL_OUTER, 5, > + {proto_hdr_eth, > + proto_hdr_ipv4, > + proto_hdr_udp, > + proto_hdr_l2tpv2, > + proto_hdr_ppp} > +}; > + > +struct virtchnl_proto_hdrs ipv6_l2tpv2_ppp_tmplt =3D { > + TUNNEL_LEVEL_OUTER, 5, > + {proto_hdr_eth, > + proto_hdr_ipv6, > + proto_hdr_udp, > + proto_hdr_l2tpv2, > + proto_hdr_ppp} > +}; > + > /* rss type super set */ >=20 > /* IPv4 outer */ > @@ -480,6 +517,9 @@ struct virtchnl_proto_hdrs > udp_l2tpv2_ppp_ipv6_tcp_tmplt =3D { > #define IAVF_RSS_TYPE_IPV4_PFCP (RTE_ETH_RSS_PFCP | > RTE_ETH_RSS_IPV4) > #define IAVF_RSS_TYPE_IPV6_PFCP (RTE_ETH_RSS_PFCP | > RTE_ETH_RSS_IPV6) >=20 > +/* L2TPv2 */ > +#define IAVF_RSS_TYPE_ETH_L2TPV2 (RTE_ETH_RSS_ETH | > RTE_ETH_RSS_L2TPV2) > + > /** > * Supported pattern for hash. > * The first member is pattern item type, @@ -547,6 +587,8 @@ static str= uct > iavf_pattern_match_item iavf_hash_pattern_list[] =3D { > {iavf_pattern_eth_ipv6_gre_ipv4_tcp, > IAVF_RSS_TYPE_INNER_IPV4_TCP, &inner_ipv4_tcp_tmplt}, > {iavf_pattern_eth_ipv4_gre_ipv4_udp, > IAVF_RSS_TYPE_INNER_IPV4_UDP, &inner_ipv4_udp_tmplt}, > {iavf_pattern_eth_ipv6_gre_ipv4_udp, > IAVF_RSS_TYPE_INNER_IPV4_UDP, &inner_ipv4_udp_tmplt}, > + {iavf_pattern_eth_ipv4_udp_l2tpv2, > IAVF_RSS_TYPE_ETH_L2TPV2, &ipv4_l2tpv2_tmplt}, > + {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp, > IAVF_RSS_TYPE_ETH_L2TPV2, &ipv4_l2tpv2_ppp_tmplt}, > {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4, > IAVF_RSS_TYPE_INNER_IPV4, &udp_l2tpv2_ppp_ipv4_tmplt}, > {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_udp, > IAVF_RSS_TYPE_INNER_IPV4_UDP, > &udp_l2tpv2_ppp_ipv4_udp_tmplt}, > {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv4_tcp, > IAVF_RSS_TYPE_INNER_IPV4_TCP, > &udp_l2tpv2_ppp_ipv4_tcp_tmplt}, > @@ -614,6 +656,8 @@ static struct iavf_pattern_match_item > iavf_hash_pattern_list[] =3D { > {iavf_pattern_eth_ipv6_gre_ipv6_tcp, > IAVF_RSS_TYPE_INNER_IPV6_TCP, &inner_ipv6_tcp_tmplt}, > {iavf_pattern_eth_ipv4_gre_ipv6_udp, > IAVF_RSS_TYPE_INNER_IPV6_UDP, &inner_ipv6_udp_tmplt}, > {iavf_pattern_eth_ipv6_gre_ipv6_udp, > IAVF_RSS_TYPE_INNER_IPV6_UDP, &inner_ipv6_udp_tmplt}, > + {iavf_pattern_eth_ipv6_udp_l2tpv2, > IAVF_RSS_TYPE_ETH_L2TPV2, &ipv6_l2tpv2_tmplt}, > + {iavf_pattern_eth_ipv6_udp_l2tpv2_ppp, > IAVF_RSS_TYPE_ETH_L2TPV2, &ipv6_l2tpv2_ppp_tmplt}, > {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6, > IAVF_RSS_TYPE_INNER_IPV6, &udp_l2tpv2_ppp_ipv6_tmplt}, > {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_udp, > IAVF_RSS_TYPE_INNER_IPV6_UDP, > &udp_l2tpv2_ppp_ipv6_udp_tmplt}, > {iavf_pattern_eth_ipv4_udp_l2tpv2_ppp_ipv6_tcp, > IAVF_RSS_TYPE_INNER_IPV6_TCP, > &udp_l2tpv2_ppp_ipv6_tcp_tmplt}, > @@ -744,6 +788,8 @@ iavf_hash_parse_pattern(const struct rte_flow_item > pattern[], uint64_t *phint, > const struct rte_flow_item_gtp_psc *psc; > const struct rte_flow_item_ecpri *ecpri; > struct rte_ecpri_common_hdr ecpri_common; > + const struct rte_flow_item_l2tpv2 *l2tpv2; > + uint16_t flags_version; >=20 > for (item =3D pattern; item->type !=3D RTE_FLOW_ITEM_TYPE_END; item++) > { > if (item->last) { > @@ -802,7 +848,18 @@ iavf_hash_parse_pattern(const struct rte_flow_item > pattern[], uint64_t *phint, > *phint |=3D IAVF_PHINT_GRE; > break; > case RTE_FLOW_ITEM_TYPE_L2TPV2: > - *phint |=3D IAVF_PHINT_L2TPV2; > + l2tpv2 =3D item->spec; > + > + if (l2tpv2) { > + flags_version =3D > + rte_be_to_cpu_16(l2tpv2- > >hdr.common.flags_version); > + if (flags_version & IAVF_L2TPV2_FLAGS_LEN) > + *phint |=3D IAVF_PHINT_L2TPV2_LEN; > + else > + *phint |=3D IAVF_PHINT_L2TPV2; > + } else { > + *phint |=3D IAVF_PHINT_L2TPV2; > + } > break; > default: > break; > @@ -1024,6 +1081,10 @@ iavf_refine_proto_hdrs_l234(struct > virtchnl_proto_hdrs *proto_hdrs, > if (!(rss_type & RTE_ETH_RSS_ECPRI)) > hdr->field_selector =3D 0; > break; > + case VIRTCHNL_PROTO_HDR_L2TPV2: > + if (!(rss_type & RTE_ETH_RSS_L2TPV2)) > + hdr->field_selector =3D 0; > + break; > default: > break; > } > @@ -1130,10 +1191,10 @@ static void > iavf_refine_proto_hdrs_l2tpv2(struct virtchnl_proto_hdrs *proto_hdrs, > uint64_t phint) > { > - struct virtchnl_proto_hdr *hdr1; > + struct virtchnl_proto_hdr *hdr, *hdr1; > int i; >=20 > - if (!(phint & IAVF_PHINT_L2TPV2)) > + if (!(phint & IAVF_PHINT_L2TPV2) && !(phint & > IAVF_PHINT_L2TPV2_LEN)) > return; >=20 > if (proto_hdrs->tunnel_level =3D=3D TUNNEL_LEVEL_INNER) { @@ -1150,7 > +1211,19 @@ iavf_refine_proto_hdrs_l2tpv2(struct virtchnl_proto_hdrs > *proto_hdrs, > VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV4); > else if (phint & IAVF_PHINT_OUTER_IPV6) > VIRTCHNL_SET_PROTO_HDR_TYPE(hdr1, IPV6); > + } else { > + for (i =3D 0; i < proto_hdrs->count; i++) { > + hdr =3D &proto_hdrs->proto_hdr[i]; > + if (hdr->type =3D=3D VIRTCHNL_PROTO_HDR_L2TPV2) { > + if (phint & IAVF_PHINT_L2TPV2) { > + REFINE_PROTO_FLD(DEL, > L2TPV2_LEN_SESS_ID); > + } else if (phint & IAVF_PHINT_L2TPV2_LEN) { > + REFINE_PROTO_FLD(DEL, > L2TPV2_SESS_ID); > + } > + } > + } > } > + > } >=20 > static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdr= s, > -- > 2.25.1