All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Caiqiang Liao <18859237562@163.com>
Cc: maxime.coquelin@redhat.com, chenbox@nvidia.com, dev@dpdk.org
Subject: Re: [PATCH] lib/gso: gso Adds the processing of IPV6 tcp packets
Date: Mon, 30 Mar 2026 12:56:21 -0700	[thread overview]
Message-ID: <20260330125621.131f4b63@phoenix.local> (raw)
In-Reply-To: <20241204100551.2914-1-18859237562@163.com>

On Wed,  4 Dec 2024 18:05:51 +0800
Caiqiang Liao <18859237562@163.com> wrote:

> The rte_gso_segment function increases the processing of IPV6 tcp packets
> 
> Signed-off-by: Caiqiang Liao <18859237562@163.com>

This patch never got any review.

Turned to AI review and it found a lot to fix.

 Summary of Findings
  The most significant issue is a logic error in rte_gso_segment that prevents plain IPv6/TCP packets from being
  segmented and incorrectly handles tunnel flags. There are also widespread indentation issues and inconsistent use of
  DPDK-preferred endianness functions.

  ---

  [ERROR] Correctness Bugs

  1. Logic Error in rte_gso_segment Conditionals
  In lib/gso/rte_gso.c, the new block for IPv6 TCP segmentation has incorrect flag checks and redundant/wrong protocol
  handling:

   1 +    } else if ((IS_IPV6_TCP(pkt->ol_flags) &&
   2 +        (gso_ctx->gso_types & RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO)) ||
   3 +        ((IS_IPV4_GRE_TCP4(pkt->ol_flags) &&
   4 +                     (gso_ctx->gso_types & RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO)))) {
   5 +                pkt->ol_flags &= (~RTE_MBUF_F_TX_TCP_SEG);
   6 +                ret = gso_tcp6_segment(pkt, gso_size,
   7 +                        direct_pool, indirect_pool,
   8 +                        pkts_out, nb_pkts_out);
   - Plain IPv6/TCP packets will not be segmented because the code checks for RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO instead of
     RTE_ETH_TX_OFFLOAD_TCP_TSO.
   - IS_IPV4_GRE_TCP4 is an IPv4 protocol but is incorrectly grouped here to be processed by gso_tcp6_segment.
     Additionally, this protocol is already handled earlier in the function by gso_tunnel_tcp4_segment.

  2. Inconsistent Endianness Conversion
  The patch uses standard libc functions (htons, ntohs, ntohl) instead of the DPDK-preferred rte_cpu_to_be_X and
  rte_be_to_cpu_X macros. This is found in:
   - lib/gso/gso_common.h: update_ipv6_header uses htons.
   - lib/gso/gso_tcp6.c: update_ipv6_tcp_headers uses ntohl.
   - lib/gso/gso_tunnel_tcp6.c: update_tunnel_ipv6_tcp_headers uses ntohs and ntohl.

  ---

  [WARNING] Style and Process Issues

  1. Indentation
  The patch consistently uses 4-space indentation in the new files (gso_tcp6.c, gso_tcp6.h, gso_tunnel_tcp6.c, etc.) and
  some modified blocks. DPDK coding style requires the use of tabs for indentation.


  ---

  [ADVISORY] Improvements

  1. Use of rte_pktmbuf_mtod_offset
  The patch frequently uses rte_pktmbuf_mtod(pkt, char *) + offset. DPDK style prefers the more concise and safer
  rte_pktmbuf_mtod_offset(pkt, type, offset) macro, which is already used elsewhere in the GSO library.


      reply	other threads:[~2026-03-30 19:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04 10:05 [PATCH] lib/gso: gso Adds the processing of IPV6 tcp packets Caiqiang Liao
2026-03-30 19:56 ` Stephen Hemminger [this message]

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=20260330125621.131f4b63@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=18859237562@163.com \
    --cc=chenbox@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.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 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.