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 43EBFA00BE; Fri, 11 Feb 2022 11:10:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 33F304270A; Fri, 11 Feb 2022 11:10:54 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2045.outbound.protection.outlook.com [40.107.220.45]) by mails.dpdk.org (Postfix) with ESMTP id 0AF2641144 for ; Fri, 11 Feb 2022 11:10:53 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZmaVKE7vkyu8WF95KNgHVyCu124xeMfr7pmMnoJ/7Tq9HgEOQ2QuUXgOoxnC2GZQ+ek9/I/ch/iLxUmpP3UqRzPnYlxkjgyK4Xm9yOH3PbBNmlcRxpC4QNjebHhy030GXGsS71avtJaufu+a2pfdkMczui1qgGl8wT5Mn39cc5KAdeZO2vO+/tSGcXwJvNY2Wd/sInfKpiVSKRQoPLA5kPcL3DhwETuVACDh+TTb1YK/Z02D1KSyIB8Z/QUaXTZRl6LCFJXkz43VVZpMfSzsW0uZHJJR6XDiwttFYeYuRx/pORrFzY/RdyspY+FK9KXxe46+VEdSbhGfSFwZD4LOrg== 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=P2AgtlZqtAtcrA0oo8lwHtYL0Io+vNZiskbUFfXf8eY=; b=OB45stsSUG14W6jJfRKDUcjj+0oJbm2NtBuYtcfgoXE4Bfv0lWia9lsKuB6NJ/thaq06YAU0KFKXdmFPqNwhOYC5eMlEq4IZeuTYKj34c2NSg//gjk7TniJD/B3lUuDgK9Y/aNdK5mtP/nK9gGc6UEdWUZ20EpPbj2Zib16Ex9q4zlAssfc8I6k4bb/kS0OUxFqckj3jouOkOXIRv+ebguqxUiwR8cpAs7w+vj1pPp0rZ3qFZHgpemRUgebwOf2mdtb0YkGZJoNq8ToFqmR8XttR6ly0DbzDtCRxr7+A/dAPQojZxc1AOWh3XlRtZsRsdFRF9qy2SHLQOui2NGySKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P2AgtlZqtAtcrA0oo8lwHtYL0Io+vNZiskbUFfXf8eY=; b=BcHCj/8BXFFyikvwhYTIIizA9ZUfs7B04vviz6AdgWZy7qzE7LmuWaLetDSmboIqzjb5Ni8o5NAt85jyj9Y6Sq1Q1ypFhqBP34iEghYqJx0Qt+AbmAWlFCu4AM/SCjyP8DTBA4jHxnpWHfnvGttPHe5w29K3TsaJnUqvH/OR5i+Gs/0iw2yXMwBsG5DDxTgGgJuS8IfYAboN193avl5fXNnlzFCm20IB2xZvfgD/RqFvZd02dLRAk0SztaOe0VpgQhCXktYa5Xmo6fFnS2qY0jasD363IG4GILAP0rL4MY57EX7qWQm8So8KRgB51SzVGyXDaRL4HWVaZZ3e/EUg+A== Received: from MW2PR12MB4666.namprd12.prod.outlook.com (2603:10b6:302:13::22) by BN8PR12MB4593.namprd12.prod.outlook.com (2603:10b6:408:aa::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Fri, 11 Feb 2022 10:10:50 +0000 Received: from MW2PR12MB4666.namprd12.prod.outlook.com ([fe80::9d4e:649c:c6b8:b353]) by MW2PR12MB4666.namprd12.prod.outlook.com ([fe80::9d4e:649c:c6b8:b353%4]) with mapi id 15.20.4951.019; Fri, 11 Feb 2022 10:10:50 +0000 From: Ori Kam To: "Sean Zhang (Networking SW)" , "NBU-Contact-Thomas Monjalon (EXTERNAL)" , "ferruh.yigit@intel.com" , Andrew Rybchenko CC: "dev@dpdk.org" Subject: RE: [v2 2/4] ethdev: support GRE optional fields Thread-Topic: [v2 2/4] ethdev: support GRE optional fields Thread-Index: AQHYHukhDC4udhZp/0KyBEr9t88ezKyOIWLw Date: Fri, 11 Feb 2022 10:10:50 +0000 Message-ID: References: <20220126084404.40178-1-xiazhang@nvidia.com> <20220211014530.77711-1-xiazhang@nvidia.com> <20220211014530.77711-3-xiazhang@nvidia.com> In-Reply-To: <20220211014530.77711-3-xiazhang@nvidia.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=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3225a417-3448-4f20-f896-08d9ed46c78b x-ms-traffictypediagnostic: BN8PR12MB4593:EE_ x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: F1KKbNOUY3GXHAWTkEvXWvslzUgmRT39efxngsm3xzQCrUQdlq7TxHg0gp5gE2/yDVHXMF8Nk4t9ec/1O7DBx4gYi7NAHLihOWxHvR/kj9y0qsAbtEFX6976qWbD+kLBXPPpzR5eK6VLmXMTffzA21hSWrS6ZYufeYI2h6bmoNWAMBsBVo6d7RVcdZ0bBzZ1h8oTDWL7UL19tk2jY7BryUHAK0Davvb87PuN8E/TKO/csgJtcYFnJvBrSi2pjobiEguiGOe/Fi0m+3oikEPV/Abz22logPKTLA+uIMYu8Qb856EIHdAJ7sJS2NPpW6tEZxA1Pf0inU8xKuCxTGvOOZlCEWvfmjcFfV5ezr8WjaKQ9gHUw3n4wTxGR4NTrPyeeZEvoOl98csF/KxsAP4e795UHstUVkiKyDaw0lHDT3I3xTB3NUFPe/bd1KY7q+cCN+E9j3ruicJiAJtn6i8EpHM4VS3QOSPrWqyZJQHWHgSqiI5FoC1TTaUuiJcS32bDeF52/dLawMjPh9wsqUtwIlGwTKSVrBkCKaAXzF+ZJooN0ixuAWe8Nf8MBbkWraDXS2GGJXl+BQbogWTexCZ2V1q3/3XA0X9B+MduQiXSQP8ODirqD5WGgd63C7boKemqJhrgyPZliXatAOIhmpwylFFG9oS8ksaHsxt0ksL/+7kPJJ6PD6FqFh7A4zYznDUI66crZjmCk2bCKyamKX6noA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR12MB4666.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(110136005)(38100700002)(5660300002)(26005)(186003)(86362001)(38070700005)(71200400001)(76116006)(55016003)(33656002)(66476007)(64756008)(4326008)(66946007)(8676002)(83380400001)(508600001)(7696005)(316002)(122000001)(66446008)(9686003)(8936002)(66556008)(52536014)(2906002)(6506007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?sFWFSrXAdbu4klOTFh+OGOcKU6wd40+HEkJ+MQWIeIAnOtK5qvBonBj5+47F?= =?us-ascii?Q?FSbtXiGWYQtrYx4OhwNu2Q0oWXX+G3ZvRAa5NRwSubFACV49L+GAxIeEuUqG?= =?us-ascii?Q?tqQ40ZtrJgk/ZIVTyZuBCQDgT+SOe1yT68nsmRnC9BaqhSTuYti7xPT/3TmA?= =?us-ascii?Q?nzk63bDYQQCixt1Cqt3LJ4fBZ7tnItsC8f55kTCt5k/NOlHRSvpRqlOCnxGg?= =?us-ascii?Q?Y0wc3KqCPzki6dxLLjnfJAn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ascii?Q?o1M8dur3zxUPySpEMHKAzBnG6kbKjccc0vWtoveuAfY76pRnk+0S0fDBbzQ2?= =?us-ascii?Q?jmfAjUZ0xqLDa1EdC4TLzj1DvFVygcfkslztKnz1KMYXUcehcpkZ13Wx8uY9?= =?us-ascii?Q?kytn+rn5JVPSg/8AkvS0rStYXgCiNQ3pgi5kMx75EBiPz6UAbHbPoSHqPg84?= =?us-ascii?Q?qZYyygtOWA18FfC/LyW2gGqcx4wh8RMg+UFtSMHC6rZqYz3t7BFwFy8THOX3?= =?us-ascii?Q?HQyqyD/zUyVBouFnNPK52TrioOjIiNsln2ZScoMclnMqfpKwRgZ2tWuivQrU?= =?us-ascii?Q?IEqaiF1vYXygdLfRhbUKsH+1T6xOyM7GAw02McKA9uiyPfLZy/pNIOh0LPGj?= =?us-ascii?Q?KxWW6HT5jaKjGED5euKZZKlw4tU7Sgie+RzodmRvtyHM0wGy40cY1sj9tk+B?= =?us-ascii?Q?5f9uWtYBmHwtdR3I5sXqdmTjiUWMxZb+mSom6qIyXiSh6zug3l+HOSdc3FNb?= =?us-ascii?Q?4A=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR12MB4666.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3225a417-3448-4f20-f896-08d9ed46c78b X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Feb 2022 10:10:50.0187 (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: ikOx9j0jbrmJ6XBmKZ9Mf7s1gHh4iImN46mvvd0zPA0ZMO2RuYHHNmes2FJF5CK5BZp0GsqHlV3kTrGsKqkY7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB4593 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 Hi Sean, > -----Original Message----- > From: Sean Zhang (Networking SW) > Subject: [v2 2/4] ethdev: support GRE optional fields >=20 > Add flow pattern items and header format for matching optional fields > (checksum/key/sequence) in GRE header. And the flags in gre item should > be correspondingly set with the new added items. >=20 > Signed-off-by: Sean Zhang > --- > doc/guides/prog_guide/rte_flow.rst | 17 +++++++++++++++++ > doc/guides/rel_notes/release_22_03.rst | 5 +++++ > lib/ethdev/rte_flow.c | 1 + > lib/ethdev/rte_flow.h | 19 +++++++++++++++++++ > 4 files changed, 42 insertions(+) >=20 > diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/r= te_flow.rst > index b4aa9c4..0e47501 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -1106,6 +1106,7 @@ Matches a GRE header. >=20 > Item: ``GRE_KEY`` > ^^^^^^^^^^^^^^^^^ > +This action is deprecated. Consider `Item: GRE_OPTION`. >=20 > Matches a GRE key field. > This should be preceded by item ``GRE``. > @@ -1113,6 +1114,22 @@ This should be preceded by item ``GRE``. > - Value to be matched is a big-endian 32 bit integer. > - When this item present it implicitly match K bit in default mask as "1= " >=20 > +Item: ``GRE_OPTION`` > +^^^^^^^^^^^^^^^^^^^^ > + > +Matches a GRE optional fields (checksum/key/sequence). > +This should be preceded by item ``GRE``. > + > +- ``checksum``: checksum. > +- ``key``: key. > +- ``sequence``: sequence. > +- The items in GRE_OPTION do not change bit flags(c_bit/k_bit/s_bit) in = GRE > + item. The bit flags need be set with GRE item by application. When the= items > + present, the corresponding bits in GRE spec and mask should be set "1"= by > + application, it means to match specified value of the fields. When the= items > + no present, but the corresponding bits in GRE spec and mask is "1", it= means > + to match any value of the fields. > + > Item: ``FUZZY`` > ^^^^^^^^^^^^^^^ >=20 > diff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_note= s/release_22_03.rst > index b20716c..721ce16 100644 > --- a/doc/guides/rel_notes/release_22_03.rst > +++ b/doc/guides/rel_notes/release_22_03.rst > @@ -87,6 +87,11 @@ New Features >=20 > The new API ``rte_event_eth_rx_adapter_event_port_get()`` was added. >=20 > +* **Added rte_flow support for matching GRE optional fields.** > + > + * Added ``gre_option`` item in rte_flow to support checksum/key/sequen= ce > + matching in GRE packets. > + > * **Updated testpmd.** >=20 > * Called ``rte_ipv4/6_udptcp_cksum_mbuf()`` functions in testpmd csum = mode > diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c > index a93f68a..7f93900 100644 > --- a/lib/ethdev/rte_flow.c > +++ b/lib/ethdev/rte_flow.c > @@ -139,6 +139,7 @@ struct rte_flow_desc_data { > MK_FLOW_ITEM(META, sizeof(struct rte_flow_item_meta)), > MK_FLOW_ITEM(TAG, sizeof(struct rte_flow_item_tag)), > MK_FLOW_ITEM(GRE_KEY, sizeof(rte_be32_t)), > + MK_FLOW_ITEM(GRE_OPTION, sizeof(struct rte_flow_item_gre_opt)), > MK_FLOW_ITEM(GTP_PSC, sizeof(struct rte_flow_item_gtp_psc)), > MK_FLOW_ITEM(PPPOES, sizeof(struct rte_flow_item_pppoe)), > MK_FLOW_ITEM(PPPOED, sizeof(struct rte_flow_item_pppoe)), > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h > index 1031fb2..765beb3 100644 > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > @@ -37,6 +37,7 @@ > #include > #include > #include > +#include >=20 > #ifdef __cplusplus > extern "C" { > @@ -660,6 +661,13 @@ enum rte_flow_item_type { > * See struct rte_flow_item_ppp. > */ > RTE_FLOW_ITEM_TYPE_PPP, > + > + /** > + * Matches GRE optional fields. > + * > + * See struct rte_flow_item_gre_opt. > + */ > + RTE_FLOW_ITEM_TYPE_GRE_OPTION, > }; >=20 > /** > @@ -1196,6 +1204,17 @@ struct rte_flow_item_gre { > #endif >=20 > /** > + * RTE_FLOW_ITEM_TYPE_GRE_OPTION. > + * > + * Matches GRE optional fields in header. > + */ > +struct rte_flow_item_gre_opt { > + struct rte_gre_hdr_opt_checksum_rsvd checksum_rsvd; > + struct rte_gre_hdr_opt_key key; > + struct rte_gre_hdr_opt_sequence sequence; > +}; > + > +/** > * RTE_FLOW_ITEM_TYPE_FUZZY > * > * Fuzzy pattern match, expect faster than default. > -- > 1.8.3.1 Acked-by: Ori Kam Best, Ori