From: Konstantin Ananyev <konstantin.ananyev@huawei.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
"vignesh.purushotham.srinivas@ericsson.com"
<vignesh.purushotham.srinivas@ericsson.com>
Cc: "konstantin.v.ananyev@yandex.ru" <konstantin.v.ananyev@yandex.ru>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH] ip_frag: support IPv6 reassembly with extensions
Date: Tue, 17 Sep 2024 17:57:59 +0000 [thread overview]
Message-ID: <85706cce3f694d318d274faf48a54250@huawei.com> (raw)
In-Reply-To: <20240826084143.269d069a@hermes.local>
>
> On Mon, 26 Aug 2024 13:23:28 +0200
> <vignesh.purushotham.srinivas@ericsson.com> wrote:
>
> > 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 for first fragment */
> > + uint8_t *next_proto; /* pointer of the next_proto field */
> > struct ip_frag frags[IP_MAX_FRAG_NUM]; /* fragments */
> > };
>
> 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.
>
> > +
> > + while (next_proto != IPPROTO_FRAGMENT &&
> > + num_exts < MAX_NUM_IPV6_EXTS &&
> > + (next_proto = rte_ipv6_get_next_ext(
> > + *last_ext, next_proto, &ext_len)) >= 0) {
>
> I would break up this loop condition for clarity.
+ 1
> Something like:
>
> while (next_proto != IPPROTO_FRAGMENT && num_exts < MAX_NUM_IPV6_EXTS) {
> next_proto = rte_ipv6_get_next_ext(*last_ext, next_proto, &ext_len);
> if (next_proto < 0)
> break
>
> Also, need a new test cases for this.
Agree, that would be good thing to add.
next prev parent reply other threads:[~2024-09-17 17:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-26 11:23 vignesh.purushotham.srinivas
2024-08-26 15:41 ` Stephen Hemminger
2024-09-17 17:57 ` Konstantin Ananyev [this message]
2024-10-14 10:38 ` Vignesh Purushotham Srinivas
2024-09-17 18:07 ` Konstantin Ananyev
2024-10-14 16:11 ` Vignesh Purushotham Srinivas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=85706cce3f694d318d274faf48a54250@huawei.com \
--to=konstantin.ananyev@huawei.com \
--cc=dev@dpdk.org \
--cc=konstantin.v.ananyev@yandex.ru \
--cc=stephen@networkplumber.org \
--cc=vignesh.purushotham.srinivas@ericsson.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).