public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top, David Gibson <david@gibson.dropbear.id.au>,
	Jon Maloy <jmaloy@redhat.com>
Subject: Re: [PATCH v7 1/4] tcp: Encode checksum computation flags in a single parameter
Date: Tue, 26 May 2026 10:37:59 +0200 (CEST)	[thread overview]
Message-ID: <20260526103758.34941683@elisabeth> (raw)
In-Reply-To: <20260520151010.496286-2-lvivier@redhat.com>

On Wed, 20 May 2026 17:10:07 +0200
Laurent Vivier <lvivier@redhat.com> wrote:

> tcp_fill_headers() takes a pointer to a previously computed IPv4 header
> checksum to avoid recalculating it when the payload length doesn't
> change, and a separate bool to skip TCP checksum computation.
> 
> Replace both parameters with a single uint32_t csum_flags that encodes:
> - IP4_CSUM (bit 31): compute IPv4 header checksum from scratch
> - TCP_CSUM (bit 30): compute TCP checksum
> - IP4_CMASK (low 16 bits): cached IPv4 header checksum value

Have you considered something like:

struct csum_state {
	bool compute_tcp;
	bool compute_ip;
	uint16_t computed_ip;
};

? I think the related documentation would look simpler and it should
also be more robust to future changes.

Not worth a respin though, if it looks like a good idea I guess it could
be done as a follow-up.

-- 
Stefano


  reply	other threads:[~2026-05-26  8:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 15:10 [PATCH v7 0/4] vhost-user,tcp: Handle multiple iovec entries per virtqueue element Laurent Vivier
2026-05-20 15:10 ` [PATCH v7 1/4] tcp: Encode checksum computation flags in a single parameter Laurent Vivier
2026-05-26  8:37   ` Stefano Brivio [this message]
2026-05-26  8:56     ` Laurent Vivier
2026-05-26 12:44 ` [PATCH v7 0/4] vhost-user,tcp: Handle multiple iovec entries per virtqueue element Stefano Brivio

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=20260526103758.34941683@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=jmaloy@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=passt-dev@passt.top \
    /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.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

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 IMAP folder(s).