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: [RFC] tcp: Replace TCP buffer structure by an iovec array
Date: Tue, 12 Mar 2024 23:56:03 +0100	[thread overview]
Message-ID: <20240312235603.5922b01a@elisabeth> (raw)
In-Reply-To: <20240311133356.1405001-1-lvivier@redhat.com>

On Mon, 11 Mar 2024 14:33:56 +0100
Laurent Vivier <lvivier@redhat.com> wrote:

> To be able to provide pointers to TCP headers and IP headers without
> worrying about alignment in the structure, split the structure into
> several arrays and point to each part of the frame using an iovec array.
> 
> Using iovec also allows us to simply ignore the first entry when the
> vnet length header is not needed. And as the payload buffer contains
> only the TCP header and the TCP data we can increase the size of the
> TCP data to USHRT_MAX - sizeof(struct tcphdr).
> 
> As a side effect, these changes improve performance by a factor of
> x1.5.
> 
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>  tap.c | 104 ++++++++++++++
>  tap.h |  16 +++
>  tcp.c | 429 ++++++++++++++++++++++++----------------------------------
>  3 files changed, 296 insertions(+), 253 deletions(-)
> 
> diff --git a/tap.c b/tap.c
> index c7b9372668ec..afd01cffbed6 100644
> --- a/tap.c
> +++ b/tap.c
> @@ -350,6 +350,30 @@ static size_t tap_send_frames_pasta(const struct ctx *c,
>  	return i;
>  }
>  
> +/**
> + * tap_send_iov_pasta() - Send out multiple prepared frames

...to the pasta tap.

That is, this should get the description of the existing
tap_send_frames_pasta(), and, I guess, tap_send_frames_pasta() should
now switch to writev(), as it's used to send one single message from
multiple buffers, otherwise you'll get a lot of system calls for pasta?

I'm still in the middle of reviewing here, but I thought I would
comment on this right away because it looks quite fundamental.

-- 
Stefano


  reply	other threads:[~2024-03-12 22:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11 13:33 [RFC] tcp: Replace TCP buffer structure by an iovec array Laurent Vivier
2024-03-12 22:56 ` Stefano Brivio [this message]
2024-03-13 11:37 ` Stefano Brivio
2024-03-13 14:42   ` Laurent Vivier
2024-03-13 15:27     ` Stefano Brivio
2024-03-13 15:20   ` Laurent Vivier
2024-03-13 16:58     ` Stefano Brivio
2024-03-14 14:07   ` Laurent Vivier
2024-03-14 15:47     ` Stefano Brivio
2024-03-14 15:54       ` Laurent Vivier
2024-03-14 16:26         ` Stefano Brivio
2024-03-15  0:46           ` David Gibson
2024-03-14  4:22 ` David Gibson

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=20240312235603.5922b01a@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).