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 2A2B0A04B5; Wed, 30 Sep 2020 16:55:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 08D9F1DACE; Wed, 30 Sep 2020 16:55:47 +0200 (CEST) Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by dpdk.org (Postfix) with ESMTP id 1BAE81DACE for ; Wed, 30 Sep 2020 16:55:43 +0200 (CEST) Received: from HKMAIL102.nvidia.com (Not Verified[10.18.92.9]) by nat-hk.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 30 Sep 2020 22:55:41 +0800 Received: from HKMAIL103.nvidia.com (10.18.16.12) by HKMAIL102.nvidia.com (10.18.16.11) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 30 Sep 2020 14:55:40 +0000 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.58) by HKMAIL103.nvidia.com (10.18.16.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 30 Sep 2020 14:55:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JUafeuAQ4XmiYvM9jXOjpShj1/txnpKpS5Gkg2AxAeoI4rRI/4sSpQKpSYc3Ny4P75Tolaon10EQhKKxbBCr2WC1Yg4fk1EGBQ9BwNpKIM3/Gd5bu2ecvVs0CrdoUwI1emnjM1NwAej4N4uqOZi34H3vD0HwMKixqceES8oJ+k7KyOcFza3/tnoHu+2WhGivW4qjDmeFppR/xPpPCXaEYE2zYfYxxf9YLAFYL4jXOfw0is+ZcualtoUPpCSbvQfePexBRXVOltcL45uzoapK051VZ9G97mSrcNYAk8RORun5BwkMSS80Nv3N7kBpeiLqoWY2HO936XojF2674JHa0Q== 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=Z1/5Eywp8hqWbzmu8wKe8W9REu2GfMkv1qVoLXbTm5c=; b=jUmCOhhZQkSHf2MvhGcNcgh+vZAyc21npJxYqRxBWJEuDgFpRGBbx5AXgDeK6MfNGPQ9ZWYTLVa2hdkonwyxX205ClX9y8QHHRmpCxR11agmMIXUq3GVT4vt9DH9a9MhTbKWX6Eh4reI9+cZ3JDJo+uaJDOarcmNK8ZRgC+pTQVva1D3p/cxy1z9V83oiEVULPZwjounD8Cft6mKtXvDyQa4gobS1Dy8Zx5V8/l6a59imp/RQCPJAXm8hn7h5bt/+zhB4e3zd+iqvOLUr32Sdo0bmRznUX8zkpplf8jrWh1XBWhuJuDhaSQZRCBtPCAZWqlMeEZQq6aZZFtsK6/FMg== 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 MN2PR12MB4517.namprd12.prod.outlook.com (2603:10b6:208:267::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.32; Wed, 30 Sep 2020 14:55:37 +0000 Received: from MN2PR12MB4286.namprd12.prod.outlook.com ([fe80::61fd:a36e:cf4f:2d3f]) by MN2PR12MB4286.namprd12.prod.outlook.com ([fe80::61fd:a36e:cf4f:2d3f%8]) with mapi id 15.20.3433.035; Wed, 30 Sep 2020 14:55:37 +0000 From: Ori Kam To: Dekel Peled , NBU-Contact-Thomas Monjalon , "ferruh.yigit@intel.com" , "arybchenko@solarflare.com" , "konstantin.ananyev@intel.com" , "olivier.matz@6wind.com" , "wenzhuo.lu@intel.com" , "beilei.xing@intel.com" , "bernard.iremonger@intel.com" , Matan Azrad , Shahaf Shuler , Slava Ovsiienko CC: "dev@dpdk.org" Thread-Topic: [PATCH 02/10] ethdev: add IPv6 fragment extension header item Thread-Index: AQHWlzOdELj9/om7JUun3QhwpMF5D6mBROvg Date: Wed, 30 Sep 2020 14:55:37 +0000 Message-ID: References: <3b2c7f074e245db507f9b21d28dbe68b87051515.1601474841.git.dekelp@nvidia.com> In-Reply-To: <3b2c7f074e245db507f9b21d28dbe68b87051515.1601474841.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: df6a101c-7774-431f-d6b7-08d86550e47f x-ms-traffictypediagnostic: MN2PR12MB4517: 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:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 4L5jkQilUxKvwqFshPRZHvWrKRh/3Muk49EowcYl3Hns1lChVHtD7c0Uc02Q5DqT+6PStiDmGVQRRETBw31aVbHF1tZi2UwMiIlfjSg6OGnnqbhdDyLMnzGFLBCFL+fdDV/YZGTvQ2QeKVJ1xX/iXOo6uOlYi/V2tF4cKn09QgupdAPbQ1Pi+yZWycslaRZD0BFCXiCAfMRz2IJsR0SGUqE9iBljAfhpiCohcFJmWvelBgFY1Olg07tLndZLPUvnyW2OJasf+4xeYoa+4hTrarLwMjTMaWdEQB2QBo0Xag5jtDz7p05B39IQfL5HtcD3NKwsvTbKHeBkhugAcDJuRmwuj8Vc2BLgbT0vkDJwiM5KOpyfOrS7I6ezy8QC78b5WSH1kc61ULQdiRjdqnn2ZA== 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)(346002)(39860400002)(366004)(396003)(136003)(376002)(66556008)(8676002)(64756008)(66446008)(66946007)(66476007)(6636002)(4326008)(316002)(478600001)(45080400002)(966005)(76116006)(5660300002)(9686003)(2906002)(83380400001)(8936002)(53546011)(6506007)(71200400001)(7696005)(33656002)(86362001)(55016002)(26005)(110136005)(186003)(52536014)(921003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: w0XonqN4D8PT+d88p+d6cicp6bf2V/eT1mEGCNrzN1LuKJv1Ub+QPiq4r5nOPSJwvuQc2IjBKF8S0t3s5yytMzW+oOQFkz1l3BXUG4e9MsQ0gJOoiafmKAfYUOE5XM4eDkCw+Y8pzCgaI1Jc3lEh8wVgm7pWDkgoLC1xlAWn6qcTphOxcK9B0Ee2DQaEkRSZc4nGZ6teb6Lgg9OugUAoOKwoF2yxkdfCO82LRqDlNGvgXEbavXl4h7yRjChgnK+Wr8LDxG3G4L6M6utO+DFt5T/8n4BoHMnThmKXep8Yu5Y+RcnY+qEsf4hcwfuNH7NY31jntIXsGtCEeUVvCy4miXVcE6B8a+w+3hrNazjaTXP2HU2CLb9NA/epCNZmQc8Fn5p3YBLTRh3ucBqvfIpdWBuHlQ8/9z6wgviUa4zpVvz0DUvKmnxWdGkQFAPucmT1T/kyai+pDAvB/YZGFFGOYqiMDxoLzjGzF1F2iS9eBNaUgyzbfvjWxFdDc91UmkCKS1ylZ01q9sO/A0y+0VrlrGmiPTkxtUYxYH7oH1WYHYKlaA+JumQDLp2sTg9nfs7YbcxYjSUDEZn2ri7zKmt+UzkvSzWfZH5RU+CDjA2IuB8JfSab3C3jlRd84nrDImPepGSPlXnufPvK3Uvt6oFR9w== 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: df6a101c-7774-431f-d6b7-08d86550e47f X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Sep 2020 14:55:37.6824 (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: sGti6fVHqKYHnE75aOFNX2R3miOLutlkTetC1b+pf1gsaylN2WUpYaC7tCZpxt2qa7srXHIVyn15lRniZkajoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4517 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601477741; bh=Z1/5Eywp8hqWbzmu8wKe8W9REu2GfMkv1qVoLXbTm5c=; 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=YQ/qKXfJWtdoiLXnPVX7wIRfymOW+dnWcqCTSfWmFUCOgJcI1Z8uth8oKXpFSxHVv G8ALec37npfG7a6nrKz3KKUacoLOCjIw/0DY8WLjPYvjws8WgDy4bTNiXaxpvLmevd YyImhfA+laaHsraxQuw5k9kZY7xYYVxLdhge8BvxQ6/04NFpCNe6zDH+jZEI6OJrnG h5x3YobpBMU0KEsHG4LzFdTvPTLcRZ/WaxR/grqwn7H6eqn346heLBNMZJ2IyC5Ocg hfQLgwuHJalveabpYgfJq4DsD1PotwFC6r+vSlWS+lBgOnhaKtfLz6iedcw00VIxq6 6Sx5Ye6d1BDYA== Subject: Re: [dpdk-dev] [PATCH 02/10] ethdev: add IPv6 fragment extension header item 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: Wednesday, September 30, 2020 5:10 PM > Subject: [PATCH 02/10] ethdev: add IPv6 fragment extension header item >=20 > Applications handling fragmented IPv6 packets need to match on IPv6 > fragment extension header, in order to identify the fragments order > and location in the packet. > This patch introduces the IPv6 fragment extension header item, > proposed in [1]. >=20 > Relevant definitions are moved from lib/librte_ip_frag/rte_ip_frag.h > to lib/librte_net/rte_ip.h, as they are needed for IPv6 header handling. > struct ipv6_extension_fragment renamed to rte_ipv6_fragment_ext to > adapt it to the common naming convention. >=20 > Default mask is not defined, since all fields are optional. >=20 > [1] > https://nam11.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fmails.= dpd > k.org%2Farchives%2Fdev%2F2020- > March%2F160255.html&data=3D02%7C01%7Corika%40nvidia.com%7C52959 > fd24ed2489868e308d8654abe56%7C43083d15727340c1b7db39efd9ccc17a%7C > 0%7C0%7C637370718986486792&sdata=3DEPQFJHS9JJvzNj%2Ff9ODWt6yd3 > F1HhQiKcPX6UD1eWGA%3D&reserved=3D0 >=20 > Signed-off-by: Dekel Peled > --- > doc/guides/prog_guide/rte_flow.rst | 16 ++++++++++++++-- > lib/librte_ethdev/rte_flow.c | 1 + > lib/librte_ethdev/rte_flow.h | 21 +++++++++++++++++++++ > lib/librte_ip_frag/rte_ip_frag.h | 26 ++------------------------ > lib/librte_net/rte_ip.h | 26 ++++++++++++++++++++++++-- > 5 files changed, 62 insertions(+), 28 deletions(-) >=20 > diff --git a/doc/guides/prog_guide/rte_flow.rst > b/doc/guides/prog_guide/rte_flow.rst > index 0b476da..826e45d 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -947,8 +947,8 @@ Item: ``IPV6`` > Matches an IPv6 header. >=20 > Dedicated flags indicate existence of specific extension headers. > -Every type of extension header can use a dedicated pattern item, or > -the generic `Item: IPV6_EXT`_. > +Every type of extension header can use a dedicated pattern item, > +for example `Item: IPV6_FRAG_EXT`_, or the generic `Item: IPV6_EXT`_. >=20 > - ``hdr``: IPv6 header definition (``rte_ip.h``). > - ``hop_ext_exist``: Hop-by-Hop Options extension header exists. > @@ -1187,6 +1187,18 @@ Normally preceded by any of: > - `Item: IPV6`_ > - `Item: IPV6_EXT`_ >=20 > +Item: ``IPV6_FRAG_EXT`` > +^^^^^^^^^^^^^^^^^^^^^^^ > + > +Matches the presence of IPv6 fragment extension header. > + > +- ``hdr``: IPv6 fragment extension header definition (``rte_ip.h``). > + > +Normally preceded by any of: > + > +- `Item: IPV6`_ > +- `Item: IPV6_EXT`_ > + > Item: ``ICMP6`` > ^^^^^^^^^^^^^^^ >=20 > diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c > index f8fdd68..c1f3132 100644 > --- a/lib/librte_ethdev/rte_flow.c > +++ b/lib/librte_ethdev/rte_flow.c > @@ -72,6 +72,7 @@ struct rte_flow_desc_data { > MK_FLOW_ITEM(VXLAN_GPE, sizeof(struct rte_flow_item_vxlan_gpe)), > MK_FLOW_ITEM(ARP_ETH_IPV4, sizeof(struct > rte_flow_item_arp_eth_ipv4)), > MK_FLOW_ITEM(IPV6_EXT, sizeof(struct rte_flow_item_ipv6_ext)), > + MK_FLOW_ITEM(IPV6_FRAG_EXT, sizeof(struct > rte_flow_item_ipv6_frag_ext)), > MK_FLOW_ITEM(ICMP6, sizeof(struct rte_flow_item_icmp6)), > MK_FLOW_ITEM(ICMP6_ND_NS, sizeof(struct > rte_flow_item_icmp6_nd_ns)), > MK_FLOW_ITEM(ICMP6_ND_NA, sizeof(struct > rte_flow_item_icmp6_nd_na)), > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > index 5b5bed2..1443e6a 100644 > --- a/lib/librte_ethdev/rte_flow.h > +++ b/lib/librte_ethdev/rte_flow.h > @@ -368,6 +368,13 @@ enum rte_flow_item_type { > RTE_FLOW_ITEM_TYPE_IPV6_EXT, >=20 > /** > + * Matches the presence of IPv6 fragment extension header. > + * > + * See struct rte_flow_item_ipv6_frag_ext. > + */ > + RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT, > + > + /** > * Matches any ICMPv6 header. > * > * See struct rte_flow_item_icmp6. > @@ -1188,6 +1195,20 @@ struct rte_flow_item_ipv6_ext > rte_flow_item_ipv6_ext_mask =3D { > #endif >=20 > /** > + * RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT > + * > + * Matches the presence of IPv6 fragment extension header. > + * > + * Preceded by any of: > + * > + * - RTE_FLOW_ITEM_TYPE_IPV6 > + * - RTE_FLOW_ITEM_TYPE_IPV6_EXT > + */ > +struct rte_flow_item_ipv6_frag_ext { > + struct rte_ipv6_fragment_ext hdr; > +}; > + > +/** > * RTE_FLOW_ITEM_TYPE_ICMP6 > * > * Matches any ICMPv6 header. > diff --git a/lib/librte_ip_frag/rte_ip_frag.h b/lib/librte_ip_frag/rte_ip= _frag.h > index 66edd7e..0bfe64b 100644 > --- a/lib/librte_ip_frag/rte_ip_frag.h > +++ b/lib/librte_ip_frag/rte_ip_frag.h > @@ -110,30 +110,8 @@ struct rte_ip_frag_tbl { > __extension__ struct ip_frag_pkt pkt[0]; /**< hash table. */ > }; >=20 > -/** IPv6 fragment extension header */ > -#define RTE_IPV6_EHDR_MF_SHIFT 0 > -#define RTE_IPV6_EHDR_MF_MASK 1 > -#define RTE_IPV6_EHDR_FO_SHIFT 3 > -#define RTE_IPV6_EHDR_FO_MASK (~((1 << > RTE_IPV6_EHDR_FO_SHIFT) - 1)) > -#define RTE_IPV6_EHDR_FO_ALIGN (1 << > RTE_IPV6_EHDR_FO_SHIFT) > - > -#define RTE_IPV6_FRAG_USED_MASK \ > - (RTE_IPV6_EHDR_MF_MASK | RTE_IPV6_EHDR_FO_MASK) > - > -#define RTE_IPV6_GET_MF(x) ((x) & > RTE_IPV6_EHDR_MF_MASK) > -#define RTE_IPV6_GET_FO(x) ((x) >> > RTE_IPV6_EHDR_FO_SHIFT) > - > -#define RTE_IPV6_SET_FRAG_DATA(fo, mf) \ > - (((fo) & RTE_IPV6_EHDR_FO_MASK) | ((mf) & > RTE_IPV6_EHDR_MF_MASK)) > - > -struct ipv6_extension_fragment { > - uint8_t next_header; /**< Next header type */ > - uint8_t reserved; /**< Reserved */ > - uint16_t frag_data; /**< All fragmentation data */ > - uint32_t id; /**< Packet ID */ > -} __rte_packed; > - > - > +/* struct ipv6_extension_fragment moved to librte_net/rte_ip.h and renam= ed. > */ > +#define ipv6_extension_fragment rte_ipv6_fragment_ext >=20 > /** > * Create a new IP fragmentation table. > diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h > index fcd1eb3..3081c46 100644 > --- a/lib/librte_net/rte_ip.h > +++ b/lib/librte_net/rte_ip.h > @@ -456,8 +456,30 @@ struct rte_ipv6_hdr { > return (uint16_t)cksum; > } >=20 > -/* IPv6 fragmentation header size */ > -#define RTE_IPV6_FRAG_HDR_SIZE 8 > +/** IPv6 fragment extension header. */ > +#define RTE_IPV6_EHDR_MF_SHIFT 0 > +#define RTE_IPV6_EHDR_MF_MASK 1 > +#define RTE_IPV6_EHDR_FO_SHIFT 3 > +#define RTE_IPV6_EHDR_FO_MASK (~((1 << > RTE_IPV6_EHDR_FO_SHIFT) - 1)) > +#define RTE_IPV6_EHDR_FO_ALIGN (1 << > RTE_IPV6_EHDR_FO_SHIFT) > + > +#define RTE_IPV6_FRAG_USED_MASK (RTE_IPV6_EHDR_MF_MASK | > RTE_IPV6_EHDR_FO_MASK) > + > +#define RTE_IPV6_GET_MF(x) ((x) & RTE_IPV6_EHDR_MF_MASK) > +#define RTE_IPV6_GET_FO(x) ((x) >> RTE_IPV6_EHDR_FO_SHIFT) > + > +#define RTE_IPV6_SET_FRAG_DATA(fo, mf) \ > + (((fo) & RTE_IPV6_EHDR_FO_MASK) | ((mf) & > RTE_IPV6_EHDR_MF_MASK)) > + > +struct rte_ipv6_fragment_ext { > + uint8_t next_header; /**< Next header type */ > + uint8_t reserved; /**< Reserved */ > + rte_be16_t frag_data; /**< All fragmentation data */ > + rte_be32_t id; /**< Packet ID */ > +} __rte_packed; > + > +/* IPv6 fragment extension header size */ > +#define RTE_IPV6_FRAG_HDR_SIZE sizeof(struct rte_ipv6_fragment_ext) >=20 > /** > * Parse next IPv6 header extension > -- > 1.8.3.1 Acked-by: Ori Kam Thanks, Ori