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 727FF46020; Wed, 8 Jan 2025 18:02:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E04D4014F; Wed, 8 Jan 2025 18:02:07 +0100 (CET) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id A00B5400D6 for ; Wed, 8 Jan 2025 18:02:05 +0100 (CET) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-21628b3fe7dso246413575ad.3 for ; Wed, 08 Jan 2025 09:02:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1736355725; x=1736960525; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=XzX685FLhQHxYQdWJ4n/k7Y8yCE+uz2u2VDwlEfAa9k=; b=VOLp8c4q2HW7XrOXRoC5k1KNXMpg2Vpj7loIB024whRWG8xGKn1l1uL+iCTaU+ir78 oDf+v6EoiajACxfD0sKdzPukukh+VUJDxB/GrApsZ1pnNUjt7/3NeNF5xdA423XrPpcc XBQJb9vHA52ef9MrJ4f9QyuekwcMaSvD+KnekZ+a7vqC0O42LWWDicziWGO87SU0bPHM 3pSuRXHWwP3ISFDDzFymz2TPAb24Oen+2GZxvKysfxY4py7VeR+SA7Agnn0DYjajcTG5 H7UM0yPT1mZ57ZPdiJWm+K6aCJDPQGXorOwQy/XsEJp+f5HeC3IDcC//NBDzOPw7tPC9 xfvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736355725; x=1736960525; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XzX685FLhQHxYQdWJ4n/k7Y8yCE+uz2u2VDwlEfAa9k=; b=lEVJkEgitoOb8I0kSgvKg1ZEHJRHhdNahbeJs0rJYVsD+ut5fXJdAE4gxtBIYQVH+A C/hnv2lIJA6LqEH23IBZ0PX9ewLiEGZq7MYBcLqE7TqKAqqzIL3jT5+5Wucy2SZW0M2p qkZ4gVNsAiVvZnioLDDPQIawnZdM8QCxUMesF4VnOZ5u1ly1R+tuoe4oUKXWI4eXMOW9 KmmNLAr6qXR4wGEWzamb6ORm1bQ1FWZ8xazw6sTLP/GFKnM0/9HLRReaaXqdOmYK4++L /CyNtFfkJXQhVaxZp/42OwN+t6LIH27V/TfROsZccozVTzu9bnI5bdbtityXdtkFO62q CVgg== X-Gm-Message-State: AOJu0YzdUYMAS4y0UH7oax3eps0ESzqRtWvW3z/XMrdQSAwdtI0opYpX vxYme0FpZR6cpDEwWckaaRfYnMzakl8Noj1hP+/Sp6latqmZAEHsTDMc5oU4GRE= X-Gm-Gg: ASbGncvlngY1XbhgSBqTHPgoUTtZDT0pyrVhkPlsKv4JD7yffTPTENYVj8UFNrh+qc0 RyTTx7U5sfOU6dz5XXPfCbryBWnlw3jJZJSbvyo+5cWjdR/5zDTU27fJ5c4vN219mlTBAOEidYI gQI7yUwVrGRzrUhMjuKXXV2cy6qbE6UZp+ys0yWakL6ropLOyE8rS6efQzQkpigX8eKaXJAtiFX divveLDgBAPGd3kDjdx4hbeUb6TPj4BuUzHOxQXIFWuIC1l+zCpINYfVeVC+819g2RFUJ+EdeNM UM1hXGdt X-Google-Smtp-Source: AGHT+IEOGlup4HscbhIxAnb+64OeGa6Ni0KTPowZLm0q6s6zZnC6pfiDFqG99KKeN1/GZwyNETu+EA== X-Received: by 2002:a17:902:e810:b0:216:2804:a241 with SMTP id d9443c01a7336-21a83fb0a86mr53438235ad.37.1736355724770; Wed, 08 Jan 2025 09:02:04 -0800 (PST) Received: from pi5 (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc9cde7esm328290965ad.152.2025.01.08.09.02.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 09:02:04 -0800 (PST) Date: Wed, 8 Jan 2025 09:02:00 -0800 From: Stephen Hemminger To: Jie Hai Cc: , , , Aman Singh , , , Subject: Re: [PATCH] app/testpmd: add ipv6 extension header parse Message-ID: <20250108090200.763c1c75@pi5> In-Reply-To: <20250108024632.12152-1-haijie1@huawei.com> References: <20250108024632.12152-1-haijie1@huawei.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Wed, 8 Jan 2025 10:46:32 +0800 Jie Hai wrote: > From: Jie Hai > To: , , , Aman Singh > CC: , , , > 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 > --- > 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.