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 3C180A04DB; Thu, 15 Oct 2020 18:11:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8578E1DC84; Thu, 15 Oct 2020 18:11:22 +0200 (CEST) Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by dpdk.org (Postfix) with ESMTP id DB6111DC6F for ; Thu, 15 Oct 2020 18:11:19 +0200 (CEST) Received: from HKMAIL103.nvidia.com (Not Verified[10.18.92.77]) by nat-hk.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 16 Oct 2020 00:11:17 +0800 Received: from HKMAIL102.nvidia.com (10.18.16.11) by HKMAIL103.nvidia.com (10.18.16.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 15 Oct 2020 16:11:16 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.109) by HKMAIL102.nvidia.com (10.18.16.11) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Thu, 15 Oct 2020 16:11:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BvoqErmxfQHTP5UOshfROybkbYbYzZ6xrt+4rrtMjTD+AJwwPWX7ou+KadqlmzB378e0zCtgAdZ7UlBQ1MekQbtCcGFt0i9m8XDDrVS+yT17sSsAlvUtMi9CgHP2rV7i2tGiMP2juFvGD81mENmEvEfPvyzhY0x3fYHFU7M1GOaKVVejMjhFQXwKP3gWrJ7LuK+bPrY1+iAA8Lcv9Kxq51guj8iaviAf0gJm8YNO/nAdPi6vSlUP5E4jx5iZDc/GVsID4ifEqEC6ETWSFhTHx0qv7Dwx/MWyJ58WFuJ3MFyCGMKuAKDN9K0M43hRajre6pPrLwBgrfPh2aZnCmbMZA== 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=ewArmLfMSIGP/E1bnGOglNHdT1c5MUDh0neMxXlTfYY=; b=ciMbFGJKFGy/O0o3Uok9O+dljJkyXbjj/vah6ju4cZGTmB6HIiyA01JPx5IouIyQhIBmNeQTOxWFjpuJI1zKmQodtXYjtgVub9MGS78WOIsa/oApRL2wgBAlxRY5wWK5wqlgXlp5yfwgzoa0QBjBPsYW6teFpOAQ3cqZyl89Ha4YSm7u7zyoyQZdatDq02lkAE1kpR9lGQIzr91NiEEeWnj4pEyPR4atigAGOKdmSf49RSBK0dxaYYBwSEh34tAsA89da7T322Pu7e24t383LQ3k58BOYm+qFCNw5tVQxRTOny4RT5KV3mwpuIldC8QnZ//VMjWFjPTdD2ztkPiZxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from MN2PR12MB4286.namprd12.prod.outlook.com (2603:10b6:208:199::22) by MN2PR12MB3757.namprd12.prod.outlook.com (2603:10b6:208:15a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.24; Thu, 15 Oct 2020 16:11:14 +0000 Received: from MN2PR12MB4286.namprd12.prod.outlook.com ([fe80::61fd:a36e:cf4f:2d3f]) by MN2PR12MB4286.namprd12.prod.outlook.com ([fe80::61fd:a36e:cf4f:2d3f%9]) with mapi id 15.20.3455.030; Thu, 15 Oct 2020 16:11:14 +0000 From: Ori Kam To: Dekel Peled , "wenzhuo.lu@intel.com" , "beilei.xing@intel.com" , "bernard.iremonger@intel.com" , "mdr@ashroe.eu" , "nhorman@tuxdriver.com" , NBU-Contact-Thomas Monjalon , "ferruh.yigit@intel.com" , "andrew.rybchenko@oktetlabs.ru" CC: "dev@dpdk.org" Thread-Topic: [PATCH v5 1/2] ethdev: add VLAN attributes to ETH and VLAN items Thread-Index: AQHWows53If2ZN4Oq0GzySfkmr2AN6mY1Vig Date: Thu, 15 Oct 2020 16:11:14 +0000 Message-ID: References: <209f5087596180d7866a43f0a0f12c9a032eb7ce.1601577847.git.dekelp@nvidia.com> <406ab1872004e841ea694e554dbc44e8dd2c9bd3.1602776948.git.dekelp@nvidia.com> In-Reply-To: <406ab1872004e841ea694e554dbc44e8dd2c9bd3.1602776948.git.dekelp@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [147.236.152.129] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2e4c2d95-36b2-4fd5-1973-08d87124f0a8 x-ms-traffictypediagnostic: MN2PR12MB3757: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SZMmpMIiT0APnRLYW6Y6o4Eb6636qsEJgzGPOH9c3+BB/ke3rga96EveLB9Vw8axHEhAyGz6BvvII1DrBiftx7pCmYZj8HLToTpViZo5+mOTJiuwa9kyEYlokE4pMsg2x/BCk91Mw6o1PwCmyddm1Drb+kF8AyPF/qWJTpx7hqcJEK0uMwF31Mm6QFpPdYsCTkPCL4Cy5nfSzI1Xhkf+9Xx0AZAJMTQyn5pBfhr2dZlzhBshLf2APYcQ7tnP1XbVsMlfk2Vi7I9UndB7TNYoYrsirxRsewax9Hzq7LSc8cgb1qdXkfE+mu9NRywFrvc3r6HGae2jJSUX0rKGzPKMq0fNcoxjiPDZEsKuGjghmj3zwI1wb21W4pecTkHATAMQvSR4V8c5o+vIapNd4P6w3A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB4286.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(366004)(39860400002)(136003)(346002)(52536014)(83380400001)(5660300002)(8936002)(66446008)(316002)(83080400001)(76116006)(66476007)(66556008)(64756008)(66946007)(110136005)(33656002)(55016002)(71200400001)(2906002)(86362001)(7696005)(966005)(4326008)(478600001)(9686003)(45080400002)(26005)(186003)(8676002)(53546011)(6506007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: jm4pc4D3Jsri8tOSi9V5GWOAFzfy7xJ2XpxKBrriMqe1J/I5wwAB151oLs3szByLcNkjfROLRghBWTtd2IZgZjB88O3JldU7vVec7/W4YUW6Nx4EPm2B+4fAPGM68Gf33DdVg2K8N+yZsQnc1KCWkargG0x/O7CkyjxG+GtrqD5320agZTLqs4bX7JIUbkFYpBVEDMbIuTM9bJrCveDirMh1ukn4rPs/pn0NeBWA2ThxeymK46igkuNFqBPd6OsYI8/O0/8Y2ZnYl8sahrO8TdLU6svw/msTGjz75Z4Xu/kYU4MW/BCxW/2fQizBIL7xNG67qPtq1AUrp6tSusrxaNKagfUhF+VolGJt4VZizz6dbKj9l0Vzsf5ROb7YubvjJ1RKfafHPv5+Aa+jHlO7rUSKkQVzo/ub58BBnTMeN/+D7sDsfVS3td6w4jGW2hZ8JnpRjlz36hW0BZUaaR9Xyltem/HYu82aKoOZpXr5napDu2c9FwAcFNVbDb1nLuywaafnEnX/s8YzWzAWeU8R0m9kqXX+bXE//Oz9ej0FAkN+q8MfDFFs4CWyXBesrPPaAOEqMOBLWfo8iMnmztu1ihTzxCYHUsRH4TQTev5Lu7Dd/oASvLcUCiWz1f6osrNMwPjT3E3EaXuYpfZAy/b/mQ== 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: MN2PR12MB4286.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e4c2d95-36b2-4fd5-1973-08d87124f0a8 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2020 16:11:14.1860 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: XUDfvsHTvecYmzSFmTd8/navVrDZcU32hYSmHXNRe1KnWGl0JzKOKyIFYIDDepQqxH6QQI+sObiKTr3c81BQ0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3757 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1602778277; bh=ewArmLfMSIGP/E1bnGOglNHdT1c5MUDh0neMxXlTfYY=; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To: CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-ld-processed: x-ms-exchange-transport-forked:x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers:x-ms-exchange-senderadcheck: x-microsoft-antispam:x-microsoft-antispam-message-info: x-forefront-antispam-report:x-ms-exchange-antispam-messagedata: Content-Type:Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=U3mST4aWydainBnDkiKFHfqhNa36Mzu+Am45CWfmWqhYI9t4DUm+ILXOuZTnXWwVd i981UYLDQeVi7LbUC1gjLTylUWzY/xDUbua+bCckeGojA1yeLRxIRFt0wxZejtbXy6 9rJhdMhyX5LEsCg3KGqo+YcS7elwhMdY7JUZe1zO5eWtbK1ucNFzFF+SQArUBmC7Lq K5NzslcWe4xgEBA8Jzobi9/APQwcmK3GkAyELN5Zyew8reBmrdrj2RxTO0MWAzw1Rd I73RW6WbcCLQeW5jw+WjMCtqbru2sxSgLYY3dcJ2jiPN5NyS+yBjDWnw6Ax/hfO2X5 NfSJlsgwC59QQ== Subject: Re: [dpdk-dev] [PATCH v5 1/2] ethdev: add VLAN attributes to ETH and VLAN items 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" > -----Original Message----- > From: Dekel Peled > Sent: Thursday, October 15, 2020 6:52 PM > Subject: [PATCH v5 1/2] ethdev: add VLAN attributes to ETH and VLAN items >=20 > This patch implements the change proposes in RFC [1], adding dedicated > fields to ETH and VLAN items structs, to clearly define the required > characteristic of a packet, and enable precise match criteria. > Documentation is updated accordingly. >=20 > [1] > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fmails= .dp > dk.org%2Farchives%2Fdev%2F2020- > August%2F177536.html&data=3D02%7C01%7Corika%40nvidia.com%7C4325 > 4e0b28ab40e5940208d871225b10%7C43083d15727340c1b7db39efd9ccc17a% > 7C0%7C0%7C637383739649652879&sdata=3DZg9cH%2BYP%2B%2Fd0YItuAq > 9totU3ES40i6H2ELDi74ok%2FBI%3D&reserved=3D0 >=20 > Signed-off-by: Dekel Peled > Acked-by: Matan Azrad > --- > doc/guides/prog_guide/rte_flow.rst | 13 ++++++++++--- > doc/guides/rel_notes/deprecation.rst | 5 ----- > doc/guides/rel_notes/release_20_11.rst | 7 +++++++ > lib/librte_ethdev/rte_flow.h | 17 +++++++++++++---- > 4 files changed, 30 insertions(+), 12 deletions(-) >=20 > diff --git a/doc/guides/prog_guide/rte_flow.rst > b/doc/guides/prog_guide/rte_flow.rst > index 55497c9..b93cc77 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -907,13 +907,15 @@ EtherType/TPID provided by the subsequent pattern > item. This is the same > order as on the wire. > If the ``type`` field contains a TPID value, then only tagged packets wi= th the > specified TPID will match the pattern. > -Otherwise, only untagged packets will match the pattern. > -If the ``ETH`` item is the only item in the pattern, and the ``type`` fi= eld is > -not specified, then both tagged and untagged packets will match the patt= ern. > +The field ``has_vlan`` can be used to match any type of tagged packets, > +instead of using the ``type`` field. > +If the ``type`` and ``has_vlan`` fields are not specified, then both tag= ged > +and untagged packets will match the pattern. >=20 > - ``dst``: destination MAC. > - ``src``: source MAC. > - ``type``: EtherType or TPID. > +- ``has_vlan``: packet header contains at least one VLAN. > - Default ``mask`` matches destination and source addresses only. >=20 > Item: ``VLAN`` > @@ -926,9 +928,14 @@ The corresponding standard outer EtherType (TPID) > values are > preceding pattern item. > If a ``VLAN`` item is present in the pattern, then only tagged packets w= ill > match the pattern. > +The field ``has_more_vlan`` can be used to match any type of tagged pack= ets, > +instead of using the ``inner_type field``. > +If the ``inner_type`` and ``has_more_vlan`` fields are not specified, > +then any tagged packets will match the pattern. >=20 > - ``tci``: tag control information. > - ``inner_type``: inner EtherType or TPID. > +- ``has_more_vlan``: packet header contains at least one more VLAN, afte= r > this VLAN. > - Default ``mask`` matches the VID part of TCI only (lower 12 bits). >=20 > Item: ``IPV4`` > diff --git a/doc/guides/rel_notes/deprecation.rst > b/doc/guides/rel_notes/deprecation.rst > index d1f5ed3..99520cd 100644 > --- a/doc/guides/rel_notes/deprecation.rst > +++ b/doc/guides/rel_notes/deprecation.rst > @@ -154,11 +154,6 @@ Deprecation Notices > as deprecated in DPDK 20.11, along with the associated macros > ``ETH_MIRROR_*``. > This API will be fully removed in DPDK 21.11. >=20 > -* ethdev: The ``struct rte_flow_item_eth`` and ``struct rte_flow_item_vl= an`` > - structs will be modified, to include an additional value, indicating e= xistence > - or absence of a VLAN header following the current header, as proposed = in > RFC > - > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fmails= .dp > dk.org%2Farchives%2Fdev%2F2020- > August%2F177536.html&data=3D02%7C01%7Corika%40nvidia.com%7C4325 > 4e0b28ab40e5940208d871225b10%7C43083d15727340c1b7db39efd9ccc17a% > 7C0%7C0%7C637383739649652879&sdata=3DZg9cH%2BYP%2B%2Fd0YItuAq > 9totU3ES40i6H2ELDi74ok%2FBI%3D&reserved=3D0. > - > * security: The API ``rte_security_session_create`` takes only single me= mpool > for session and session private data. So the application need to creat= e > mempool for twice the number of sessions needed and will also lead to > diff --git a/doc/guides/rel_notes/release_20_11.rst > b/doc/guides/rel_notes/release_20_11.rst > index f8686a5..e371d39 100644 > --- a/doc/guides/rel_notes/release_20_11.rst > +++ b/doc/guides/rel_notes/release_20_11.rst > @@ -321,6 +321,13 @@ API Changes > As the data of ``uint8_t`` will be truncated when queue number under > a TC is greater than 256. >=20 > +* ethdev: Added new field ``has_vlan`` to structure ``rte_flow_item_eth`= `, > + indicating that packet header contains at least one VLAN. > + > +* ethdev: Added new field ``has_more_vlan`` to structure > + ``rte_flow_item_vlan``, indicating that packet header contains at leas= t one > + more VLAN, after this VLAN. > + > * vhost: Moved vDPA APIs from experimental to stable. >=20 > * rawdev: Added a structure size parameter to the functions > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > index d3e8d8a..4839528 100644 > --- a/lib/librte_ethdev/rte_flow.h > +++ b/lib/librte_ethdev/rte_flow.h > @@ -728,15 +728,17 @@ struct rte_flow_item_raw { > * same order as on the wire. > * If the @p type field contains a TPID value, then only tagged packets = with the > * specified TPID will match the pattern. > - * Otherwise, only untagged packets will match the pattern. > - * If the @p ETH item is the only item in the pattern, and the @p type f= ield > - * is not specified, then both tagged and untagged packets will match th= e > - * pattern. > + * The field @p has_vlan can be used to match any type of tagged packets= , > + * instead of using the @p type field. > + * If the @p type and @p has_vlan fields are not specified, then both ta= gged > + * and untagged packets will match the pattern. > */ > struct rte_flow_item_eth { > struct rte_ether_addr dst; /**< Destination MAC. */ > struct rte_ether_addr src; /**< Source MAC. */ > rte_be16_t type; /**< EtherType or TPID. */ > + uint32_t has_vlan:1; /**< Packet header contains at least one VLAN. */ > + uint32_t reserved:31; /**< Reserved, must be zero. */ > }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_ETH. */ > @@ -758,10 +760,17 @@ struct rte_flow_item_eth { > * the preceding pattern item. > * If a @p VLAN item is present in the pattern, then only tagged packets= will > * match the pattern. > + * The field @p has_more_vlan can be used to match any type of tagged > packets, > + * instead of using the @p inner_type field. > + * If the @p inner_type and @p has_more_vlan fields are not specified, > + * then any tagged packets will match the pattern. > */ > struct rte_flow_item_vlan { > rte_be16_t tci; /**< Tag control information. */ > rte_be16_t inner_type; /**< Inner EtherType or TPID. */ > + uint32_t has_more_vlan:1; > + /**< Packet header contains at least one more VLAN, after this VLAN. > */ > + uint32_t reserved:31; /**< Reserved, must be zero. */ > }; >=20 > /** Default mask for RTE_FLOW_ITEM_TYPE_VLAN. */ > -- > 1.8.3.1 Acked-by: Ori Kam Thanks, Ori