From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A5B8C43613 for ; Fri, 21 Jun 2019 08:01:38 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id C4F3D2089E for ; Fri, 21 Jun 2019 08:01:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="XBHlTiIP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C4F3D2089E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CC3081D561; Fri, 21 Jun 2019 10:01:36 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50050.outbound.protection.outlook.com [40.107.5.50]) by dpdk.org (Postfix) with ESMTP id 065801D560 for ; Fri, 21 Jun 2019 10:01:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eoyme7cf83SaAzQVIN38IVoCL4eNZHWnyFGiicp8RIY=; b=XBHlTiIP7nCGoJIcPB3UCO3ma6fejZIOGKNsQbbK37W+uU7aDAckI+cTdmj80qH3/X2Y0N3hYsmKZh/IxGJsqnfC/wo7heawQ4hQI6vKChGYNB9qlUcUctGc0REigMSo74bA/l4M0Te6t58nScSLx9kJaa0S07ggsvx+OtuXhSM= Received: from VE1PR04MB6639.eurprd04.prod.outlook.com (20.179.235.82) by VE1PR04MB6590.eurprd04.prod.outlook.com (20.179.234.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.13; Fri, 21 Jun 2019 08:01:34 +0000 Received: from VE1PR04MB6639.eurprd04.prod.outlook.com ([fe80::a929:3d03:7bb7:d5e0]) by VE1PR04MB6639.eurprd04.prod.outlook.com ([fe80::a929:3d03:7bb7:d5e0%7]) with mapi id 15.20.1987.014; Fri, 21 Jun 2019 08:01:34 +0000 From: Akhil Goyal To: "Ananyev, Konstantin" , "Smoczynski, MarcinX" , "Kovacevic, Marko" , "orika@mellanox.com" , "Richardson, Bruce" , "De Lara Guarch, Pablo" , "Nicolau, Radu" , "Kantecki, Tomasz" , "Iremonger, Bernard" , "olivier.matz@6wind.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH 1/3] net: new ipv6 header extension parsing function Thread-Index: AQHVBYt/A1SfYuZY10OyhHyZoPRbVaakrYQAgABlzgCAAO7h0A== Date: Fri, 21 Jun 2019 08:01:33 +0000 Message-ID: References: <20190508104717.13448-1-marcinx.smoczynski@intel.com> <2601191342CEEE43887BDE71AB97725801689E2C5B@IRSMSX104.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB97725801689E2C5B@IRSMSX104.ger.corp.intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; x-originating-ip: [92.120.1.65] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1b92fdcc-3517-4d41-0633-08d6f61ead8b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:VE1PR04MB6590; x-ms-traffictypediagnostic: VE1PR04MB6590: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 0075CB064E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(136003)(346002)(376002)(39860400002)(199004)(189003)(55016002)(53936002)(4326008)(52536014)(66066001)(6436002)(6506007)(186003)(25786009)(76176011)(7696005)(26005)(316002)(99286004)(102836004)(2906002)(229853002)(6246003)(9686003)(7416002)(11346002)(476003)(446003)(5660300002)(256004)(2501003)(44832011)(7736002)(74316002)(71200400001)(14454004)(486006)(110136005)(71190400001)(478600001)(68736007)(76116006)(8936002)(3846002)(6116002)(86362001)(73956011)(81156014)(8676002)(33656002)(66446008)(81166006)(66946007)(305945005)(64756008)(66476007)(66556008)(921003)(21314003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6590; H:VE1PR04MB6639.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: HC0LX8dgvVIZRCYHWrCMH/PGDnvbePQz1p2wbkBdqZl4bt6SQO+rR6ZH2UO49KxenCltFCbzMwS1D3cqIbWapPkmNwW9f+sGRU8cyl7JRggoTblAg5AJAhAdRHBwmQobXIAPbZkH472av2DmMDFfOy3LYdWQnnEcrwL/5/ktjRHe3jXMqTBrc1kiV3xSUFrw6The8jnyHCRHa9BWd/3NMhOcIhiBGWPeZ7EM5/8l6v4QPYVCksnhfbeaBiMkYEXlFieku3gzTW6N0OFQaNYhNKvXuY8tPpupRt2yLFm2mk9vKMoRnLzixXbTiRKdv9daESXTvzsz8ghJsAwSzhfRNrAYn4ZLAA4tXyittoUbYBh+GdJan+qHsxJ8ow8fnpvtkYLKZqpgJzNcD1U6zNmFDoGBXgtJe0jUTlqif3f1znM= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b92fdcc-3517-4d41-0633-08d6f61ead8b X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jun 2019 08:01:33.9945 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: akhil.goyal@nxp.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6590 Subject: Re: [dpdk-dev] [PATCH 1/3] net: new ipv6 header extension parsing function 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" Hi Konstantin, >=20 > Hi Akhil, >=20 > > > > Hi Marcin, > > > > > > > > Introduce new function for IPv6 header extension parsing able to > > > determine extension length and next protocol number. > > > > > > This function is helpful when implementing IPv6 header traversing. > > > > > > Signed-off-by: Marcin Smoczynski > > > --- > > > lib/librte_net/rte_ip.h | 49 > +++++++++++++++++++++++++++++++++++++++++ > > > 1 file changed, 49 insertions(+) > > > > > > diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h > > > index f9b909090..be64da662 100644 > > > --- a/lib/librte_net/rte_ip.h > > > +++ b/lib/librte_net/rte_ip.h > > > @@ -425,6 +425,55 @@ rte_ipv6_udptcp_cksum(const struct ipv6_hdr > > > *ipv6_hdr, const void *l4_hdr) > > > return (uint16_t)cksum; > > > } > > > > > > +/* IPv6 fragmentation header size */ > > > +#define RTE_IPV6_FRAG_HDR_SIZE 8 > > > + > > > +/** > > > + * Parse next IPv6 header extension > > > + * > > > + * This function checks if proto number is an IPv6 extensions and pa= rses its > > > + * data if so, providing information on next header and extension le= ngth. > > > + * > > > + * @param p > > > + * Pointer to an extension raw data. > > > + * @param proto > > > + * Protocol number extracted from the "next header" field from > > > + * the IPv6 header or the previous extension. > > > + * @param ext_len > > > + * Extension data length. > > > + * @return > > > + * next protocol number if proto is an IPv6 extension, -EINVAL oth= erwise > > > + */ > > > +static inline int __rte_experimental > > > > > > Rte_experimental may not be required for inline functions. >=20 > AFAIK we do need that tag for both inline and non-inline functions, > till API will be transferred to 'stable' state: >=20 > $ find lib -type f | xargs grep __rte_experimental | grep inline | wc -l > 57 My first impression was that this API was not exposed. Inline APIs are norm= ally not exposed,=20 So I thought rte_experimental is not required. I believe only exposed APIs Need to be tagged with rte_experimental. Now since this API is exposed to the application as well, it should have an= entry in the .map file. Otherwise shared build will fail I think for application. >=20 > > > > > > > +rte_ipv6_get_next_ext(uint8_t *p, int proto, size_t *ext_len) > > > +{ > > > + int next_proto; > > > + > > > + switch (proto) { > > > + case IPPROTO_AH: > > > + next_proto =3D *p++; > > > + *ext_len =3D (*p + 2) * sizeof(uint32_t); > > > + break; > > > + > > > + case IPPROTO_HOPOPTS: > > > + case IPPROTO_ROUTING: > > > + case IPPROTO_DSTOPTS: > > > + next_proto =3D *p++; > > > + *ext_len =3D (*p + 1) * sizeof(uint64_t); > > > + break; > > > + > > > + case IPPROTO_FRAGMENT: > > I see that there is some compilation issues with respect to IPPROTO_xxx= fields. > These are reported in patchworks if you need details. > > > > Could you please fix these and send next rev. > > > > Thanks, > > Akhil