DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: <vignesh.purushotham.srinivas@ericsson.com>
Cc: <konstantin.v.ananyev@yandex.ru>, <dev@dpdk.org>
Subject: Re: [PATCH] ip_frag: support IPv6 reassembly with extensions
Date: Mon, 26 Aug 2024 08:41:43 -0700	[thread overview]
Message-ID: <20240826084143.269d069a@hermes.local> (raw)
In-Reply-To: <20240826112328.3028488-1-vignesh.purushotham.srinivas@ericsson.com>

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.

> +
> +	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.
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.

  reply	other threads:[~2024-08-26 15:41 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 [this message]
2024-09-17 17:57   ` Konstantin Ananyev
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=20240826084143.269d069a@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=konstantin.v.ananyev@yandex.ru \
    --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).