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
Subject: Re: [PATCH v6 4/5] tcp: Update TCP checksum using an iovec array
Date: Fri, 4 Oct 2024 08:56:12 +0200	[thread overview]
Message-ID: <20241004085612.6e82cf0d@elisabeth> (raw)
In-Reply-To: <d9309db4-6dcf-4bd9-9339-96f29ad05d0e@redhat.com>

On Thu, 3 Oct 2024 16:55:56 +0200
Laurent Vivier <lvivier@redhat.com> wrote:

> On 03/10/2024 16:51, Laurent Vivier wrote:
> > TCP header and payload are supposed to be in the same buffer,
> > and tcp_update_check_tcp4()/tcp_update_check_tcp6() compute
> > the checksum from the base address of the header using the
> > length of the IP payload.
> > 
> > In the future (for vhost-user) we need to dispatch the TCP header and
> > the TCP payload through several buffers. To be able to manage that, we
> > provide an iovec array that points to the data of the TCP frame.
> > We provide also an offset to be able to provide an array that contains
> > the TCP frame embedded in an lower level frame, and this offset points
> > to the TCP header inside the iovec array.
> > 
> > Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> > ---
> > 
> > Notes:
> >      v6:
> >        - fix clang-tidy error with ptr
> >        - add missing static to tcp_update_check_tcp[4|6]
> >      
> >      v5:
> >        - s/IPv6/IPv4/
> >        - reintroduce ip6h and iph to avoid iov_size()
> >        - check pointer alignment before casting to the type
> >      
> >      v4:
> >        - replace die() by err() in tcp_update_check_tcp6() too
> >      
> >      v3:
> >        - replace die() by err() and return
> >        - add more information in the error message
> >      
> >      v2:
> >        - s/payload_offset/l4offset/
> >        - check memory address of the checksum (alignment, iovec boundaries)
> > 
> >   checksum.c |   1 -
> >   iov.c      |   1 -
> >   tcp.c      | 118 +++++++++++++++++++++++++++++++++++++++++++++--------
> >   3 files changed, 100 insertions(+), 20 deletions(-)
> >   
> ...
> > diff --git a/iov.c b/iov.c
> > index 3f9e229a305f..9116dda94247 100644
> > --- a/iov.c
> > +++ b/iov.c
> > @@ -25,7 +25,6 @@
> >   #include "util.h"
> >   #include "iov.h"
> >   
> > -
> >   /* iov_skip_bytes() - Skip leading bytes of an IO vector
> >    * @iov:	IO vector
> >    * @n:		Number of entries in @iov  
> 
> This is an unwanted change... could you remove it on merge?

Sure.

I still have to figure out what causes tests to fail before merging. By
applying just this series I haven't seen failures anymore, but I just
ran tests twice. It might take a bit.

-- 
Stefano


  reply	other threads:[~2024-10-04  6:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-03 14:51 [PATCH v6 0/5] tcp: use csum_iov() in tcp_update_check_tcp[4|6]() Laurent Vivier
2024-10-03 14:51 ` [PATCH v6 1/5] tcp: Use tcp_payload_t rather than tcphdr Laurent Vivier
2024-10-03 14:51 ` [PATCH v6 2/5] pcap: Add an offset argument in pcap_iov() Laurent Vivier
2024-10-03 14:51 ` [PATCH v6 3/5] checksum: Add an offset argument in csum_iov() Laurent Vivier
2024-10-03 14:51 ` [PATCH v6 4/5] tcp: Update TCP checksum using an iovec array Laurent Vivier
2024-10-03 14:55   ` Laurent Vivier
2024-10-04  6:56     ` Stefano Brivio [this message]
2024-10-03 14:51 ` [PATCH v6 5/5] udp: Update UDP " Laurent Vivier
2024-10-04 13:10 ` [PATCH v6 0/5] tcp: use csum_iov() in tcp_update_check_tcp[4|6]() 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=20241004085612.6e82cf0d@elisabeth \
    --to=sbrivio@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).