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 08EA6A0471 for ; Thu, 20 Jun 2019 19:40:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 748281D426; Thu, 20 Jun 2019 19:40:17 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 1BCB51D420 for ; Thu, 20 Jun 2019 19:40:14 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jun 2019 10:40:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,397,1557212400"; d="scan'208";a="154197087" Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by orsmga008.jf.intel.com with ESMTP; 20 Jun 2019 10:40:12 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.143]) by IRSMSX106.ger.corp.intel.com ([169.254.8.222]) with mapi id 14.03.0439.000; Thu, 20 Jun 2019 18:40:11 +0100 From: "Ananyev, Konstantin" To: Akhil Goyal , "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: AQHVBYuBa0DLsFNcvU6Tkc9p5sm++qakne4AgAB0p/A= Date: Thu, 20 Jun 2019 17:40:10 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725801689E2C5B@IRSMSX104.ger.corp.intel.com> References: <20190508104717.13448-1-marcinx.smoczynski@intel.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmI2Mjk5ZTgtNDBkNC00NDQ1LTg1MTQtOGZiM2JiNzVjNDRjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibWJScDJxd3NTbjJyUUNCRnZwSFJBT2FGQVliYkpIUFZXaGYyQ0FUSHhwOE1FXC9UbElOYVF6NDZLUGMweGVUWnoifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 Akhil, >=20 > Hi Marcin, >=20 > > > > 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 pars= es its > > + * data if so, providing information on next header and extension leng= th. > > + * > > + * @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 other= wise > > + */ > > +static inline int __rte_experimental >=20 >=20 > Rte_experimental may not be required for inline functions. AFAIK we do need that tag for both inline and non-inline functions, till API will be transferred to 'stable' state: $ find lib -type f | xargs grep __rte_experimental | grep inline | wc -l 57 >=20 >=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 f= ields. These are reported in patchworks if you need details. >=20 > Could you please fix these and send next rev. >=20 > Thanks, > Akhil