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 EAE27459AF; Tue, 17 Sep 2024 19:58:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8218640280; Tue, 17 Sep 2024 19:58:02 +0200 (CEST) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by mails.dpdk.org (Postfix) with ESMTP id 7FC7440261 for ; Tue, 17 Sep 2024 19:58:01 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4X7Tym2x6sz6K5nt; Wed, 18 Sep 2024 01:57:52 +0800 (CST) Received: from frapeml100008.china.huawei.com (unknown [7.182.85.131]) by mail.maildlp.com (Postfix) with ESMTPS id 5DD65140B35; Wed, 18 Sep 2024 01:58:00 +0800 (CST) Received: from frapeml500007.china.huawei.com (7.182.85.172) by frapeml100008.china.huawei.com (7.182.85.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 17 Sep 2024 19:58:00 +0200 Received: from frapeml500007.china.huawei.com ([7.182.85.172]) by frapeml500007.china.huawei.com ([7.182.85.172]) with mapi id 15.01.2507.039; Tue, 17 Sep 2024 19:57:59 +0200 From: Konstantin Ananyev To: Stephen Hemminger , "vignesh.purushotham.srinivas@ericsson.com" CC: "konstantin.v.ananyev@yandex.ru" , "dev@dpdk.org" Subject: RE: [PATCH] ip_frag: support IPv6 reassembly with extensions Thread-Topic: [PATCH] ip_frag: support IPv6 reassembly with extensions Thread-Index: AQHa96p7DJtUreh0vEKAb1S1N5t0lLI5jAqAgCLZo3A= Date: Tue, 17 Sep 2024 17:57:59 +0000 Message-ID: <85706cce3f694d318d274faf48a54250@huawei.com> References: <20240826112328.3028488-1-vignesh.purushotham.srinivas@ericsson.com> <20240826084143.269d069a@hermes.local> In-Reply-To: <20240826084143.269d069a@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.206.138.42] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 >=20 > On Mon, 26 Aug 2024 13:23:28 +0200 > wrote: >=20 > > diff --git a/lib/ip_frag/ip_reassembly.h b/lib/ip_frag/ip_reassembly.h > > index 54afed5417..429e74f1b3 100644 > > --- a/lib/ip_frag/ip_reassembly.h > > +++ b/lib/ip_frag/ip_reassembly.h > > @@ -54,6 +54,8 @@ struct __rte_cache_aligned ip_frag_pkt { > > uint32_t total_size; /* expected reassembled size *= / > > uint32_t frag_size; /* size of fragments received = */ > > uint32_t last_idx; /* index of next entry to fill= */ > > + uint32_t exts_len; /* length of extension hdrs fo= r first fragment */ > > + uint8_t *next_proto; /* pointer of the next_proto f= ield */ > > struct ip_frag frags[IP_MAX_FRAG_NUM]; /* fragments */ > > }; >=20 > This creates a 32 bit hole in the structure. > Better to put next_proto after the start field. Another alternative - use offset within the mbuf instead of pointer. >=20 > > + > > + while (next_proto !=3D IPPROTO_FRAGMENT && > > + num_exts < MAX_NUM_IPV6_EXTS && > > + (next_proto =3D rte_ipv6_get_next_ext( > > + *last_ext, next_proto, &ext_len)) >=3D 0) { >=20 > I would break up this loop condition for clarity. + 1 > Something like: >=20 > while (next_proto !=3D IPPROTO_FRAGMENT && num_exts < MAX_NUM_IPV6_EXTS)= { > next_proto =3D rte_ipv6_get_next_ext(*last_ext, next_proto, &ext_len); > if (next_proto < 0) > break >=20 > Also, need a new test cases for this. Agree, that would be good thing to add.