From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id F0270A0471 for ; Thu, 20 Jun 2019 13:40:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6A54A1D184; Thu, 20 Jun 2019 13:40:03 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80049.outbound.protection.outlook.com [40.107.8.49]) by dpdk.org (Postfix) with ESMTP id CA1991D123 for ; Thu, 20 Jun 2019 13:40:01 +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=bcj0V3GOr1i/aSkKRpNBMqjIWeq6yBU0M2wDrnz5D0E=; b=QndMlvMNFs7zu2uZ0/+ouAgNjyKBaZGXhWgrELmkTfGZj3p85hwqM/kYyMzxrLGTijShjIN6JjLk1YY7gF4MqpYs8F0QHb5Q7mOQ67lGWvEARc31CTrnVJZSjQMGtfSOBOu3h6Zusdmk524yDx3jkFSCkKEN96InJCzE6GxK160= Received: from VE1PR04MB6639.eurprd04.prod.outlook.com (20.179.235.82) by VE1PR04MB6493.eurprd04.prod.outlook.com (20.179.233.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1987.11; Thu, 20 Jun 2019 11:40:00 +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; Thu, 20 Jun 2019 11:40:00 +0000 From: Akhil Goyal To: Marcin Smoczynski , "marko.kovacevic@intel.com" , "orika@mellanox.com" , "bruce.richardson@intel.com" , "pablo.de.lara.guarch@intel.com" , "radu.nicolau@intel.com" , "tomasz.kantecki@intel.com" , "konstantin.ananyev@intel.com" , "bernard.iremonger@intel.com" , "olivier.matz@6wind.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH 1/3] net: new ipv6 header extension parsing function Thread-Index: AQHVBYt/A1SfYuZY10OyhHyZoPRbVaakrYQA Date: Thu, 20 Jun 2019 11:40:00 +0000 Message-ID: References: <20190508104717.13448-1-marcinx.smoczynski@intel.com> In-Reply-To: <20190508104717.13448-1-marcinx.smoczynski@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: bc5d9584-4369-4fb4-0afa-08d6f5740767 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:VE1PR04MB6493; x-ms-traffictypediagnostic: VE1PR04MB6493: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0074BBE012 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(346002)(396003)(39860400002)(366004)(376002)(199004)(189003)(66066001)(68736007)(6506007)(7416002)(44832011)(256004)(53936002)(316002)(71190400001)(186003)(110136005)(55016002)(71200400001)(66946007)(9686003)(102836004)(66556008)(229853002)(76176011)(26005)(66446008)(64756008)(52536014)(5660300002)(6436002)(66476007)(73956011)(86362001)(446003)(8936002)(4326008)(6246003)(486006)(7696005)(2201001)(76116006)(81156014)(33656002)(14454004)(8676002)(3846002)(99286004)(74316002)(7736002)(11346002)(476003)(478600001)(305945005)(81166006)(25786009)(2906002)(2501003)(6116002)(21314003)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6493; 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: htOKBm2dYQAMK5qtOd2vozLpFrUhWVZ9CDwcu5iW0zDQCelzB3gZIPzuA4/Re3MmPAvb1bVF86His+h64PXo3paeJp+Ti6uCThy9muf/SnJ3Xb1j81fB7UdpxXRn24Rt6htH50icvz0BVKrRl2l4tHWsFNU/S4d6uQDMmIviPIZvIg5mFc2opQBuCh3yUMTwl4lqu1D4VS8grIOLfOhk2mQaaahxTk63nECnHe4qTWPM+SlhbNt6f4xvqOEgQG646Flg9o66iOgILJv4v3jp9alDaFyk4CbwoI5cXjo+bkvJwfUlSwHZSD6PE2lzBY3yvaxwFkjzKB7wLcXLtvYCaDnCoVlj/hI9kKNVIyj5wNGJmD7VuTISQR7AiLf9JmrmFbhUlG4GcfU4dLfhlwe+Dz+LG2xsm2Lnv/QaAeIIYPw= 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: bc5d9584-4369-4fb4-0afa-08d6f5740767 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jun 2019 11:40:00.7109 (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: VE1PR04MB6493 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 Marcin, >=20 > Introduce new function for IPv6 header extension parsing able to > determine extension length and next protocol number. >=20 > This function is helpful when implementing IPv6 header traversing. >=20 > Signed-off-by: Marcin Smoczynski > --- > lib/librte_net/rte_ip.h | 49 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 49 insertions(+) >=20 > 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; > } >=20 > +/* 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 parses= its > + * data if so, providing information on next header and extension length= . > + * > + * @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 otherwi= se > + */ > +static inline int __rte_experimental Rte_experimental may not be required for inline functions. > +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 fie= lds. These are reported in patchworks if you need details. Could you please fix these and send next rev. Thanks, Akhil