All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Jie Hai <haijie1@huawei.com>
Cc: <dev@dpdk.org>, <thomas@monjalon.net>, <ferruh.yigit@amd.com>,
	Aman Singh <aman.deep.singh@intel.com>, <lihuisong@huawei.com>,
	<fengcengwen@huawei.com>, <huangdengdui@huawei.com>
Subject: Re: [PATCH] app/testpmd: add ipv6 extension header parse
Date: Wed, 8 Jan 2025 09:02:00 -0800	[thread overview]
Message-ID: <20250108090200.763c1c75@pi5> (raw)
In-Reply-To: <20250108024632.12152-1-haijie1@huawei.com>

On Wed, 8 Jan 2025 10:46:32 +0800
Jie Hai <haijie1@huawei.com> wrote:

> From: Jie Hai <haijie1@huawei.com>
> To: <dev@dpdk.org>, <thomas@monjalon.net>, <ferruh.yigit@amd.com>, Aman Singh  <aman.deep.singh@intel.com>
> CC: <lihuisong@huawei.com>, <fengcengwen@huawei.com>, <haijie1@huawei.com>,  <huangdengdui@huawei.com>
> Subject: [PATCH] app/testpmd: add ipv6 extension header parse
> Date: Wed, 8 Jan 2025 10:46:32 +0800
> X-Mailer: git-send-email 2.22.0
> 
> This patch support parse ipv6 extension header, and
> support TSO for ipv6tcp packets with extension header.
> 
> Signed-off-by: Jie Hai <haijie1@huawei.com>
> ---
>  app/test-pmd/csumonly.c | 47 ++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 46 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
> index 2246c22e8e56..a7b11490fe27 100644
> --- a/app/test-pmd/csumonly.c
> +++ b/app/test-pmd/csumonly.c
> @@ -124,14 +124,59 @@ parse_ipv4(struct rte_ipv4_hdr *ipv4_hdr, struct testpmd_offload_info *info)
>  		info->l4_len = 0;
>  }
>  
> +static uint16_t
> +parse_ipv6_ext(struct rte_ipv6_hdr *ipv6_hdr, uint32_t *off)
> +{
> +	struct ext_hdr {
> +		uint8_t next_hdr;
> +		uint8_t len;
> +	};
> +	struct ext_hdr *xh;
> +	uint16_t proto;
> +	char *xh_fst;
> +	uint16_t i;
> +
> +	proto = ipv6_hdr->proto;
> +	xh_fst = (char *)ipv6_hdr + sizeof(*ipv6_hdr);
> +#define MAX_EXT_HDRS 9
> +	for (i = 0; i < MAX_EXT_HDRS; i++) {
> +		switch (proto) {
> +		case IPPROTO_HOPOPTS:
> +		case IPPROTO_ROUTING:
> +		case IPPROTO_DSTOPTS:
> +			xh = (struct ext_hdr *)(xh_fst + *off);
> +			*off += (xh->len + 1) * 8;
> +			proto = xh->next_hdr;
> +			break;
> +		case IPPROTO_AH:
> +			xh = (struct ext_hdr *)(xh_fst + *off);
> +			*off += (xh->len + 2) * 4;
> +			proto = xh->next_hdr;
> +			break;
> +		case IPPROTO_FRAGMENT:
> +			xh = (struct ext_hdr *)(xh_fst + *off);
> +			*off += 8;
> +			proto = xh->next_hdr;
> +			return proto; /* this is always the last ext hdr */
> +		case IPPROTO_NONE:
> +			return proto;
> +		default:
> +			return proto;
> +		}
> +	}
> +	return proto;
> +}
> +

Why copy/paste of rte_net_skip_ip6_ext, why not use that?
Having two copies of same codes means that bugs need to be fixed in two places later.

  reply	other threads:[~2025-01-08 17:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-08  2:46 [PATCH] app/testpmd: add ipv6 extension header parse Jie Hai
2025-01-08 17:02 ` Stephen Hemminger [this message]
2025-01-14  2:05   ` Jie Hai
2025-01-14 11:24     ` Thomas Monjalon
2025-01-24  9:43 ` [PATCH v2 0/2] parse ptype for tunnel packets Jie Hai
2025-01-24  9:43   ` [PATCH v2 1/2] net: add ptype parse " Jie Hai
2025-01-30 18:26     ` Stephen Hemminger
2025-01-24  9:43   ` [PATCH v2 2/2] app/test-pmd: use ptype API parse packets Jie Hai
2025-02-14  1:56 ` [PATCH v3 0/2] app/testpmd: add ipv6 extension header parse Jie Hai
2025-02-14  1:56   ` [PATCH v3 1/2] net: add ptype parse for tunnel packets Jie Hai
2025-02-14 16:35     ` Stephen Hemminger
2025-02-22  1:53       ` Jie Hai
2025-02-14  1:56   ` [PATCH v3 2/2] app/test-pmd: use ptype API parse packets Jie Hai

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=20250108090200.763c1c75@pi5 \
    --to=stephen@networkplumber.org \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=fengcengwen@huawei.com \
    --cc=ferruh.yigit@amd.com \
    --cc=haijie1@huawei.com \
    --cc=huangdengdui@huawei.com \
    --cc=lihuisong@huawei.com \
    --cc=thomas@monjalon.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.