From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124])
	by passt.top (Postfix) with ESMTP id E93DF5A0271
	for <passt-dev@passt.top>; Fri,  8 Mar 2024 17:24:47 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1709915086;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=ORs70mMylOjKC3NtK1YKpKpOHYaUpzgbNSf1f406X4U=;
	b=cWb0Riy8stMEC4KPvK8rIkwxgKeoNie+Cp4PGGoKlGjn//q6wHp+SgiUutA825P6/pmafn
	zSP+kjUwhqoJgH3MWq5OWjNJejjPtknw281Szyf7l+WXXGilHMSPpETFj6x4VrTeiQyKqH
	txpj1sez4tLPsWVURtuQmXHFoRu/pJY=
Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com
 [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-164-H3jN9qVmP0u00eUUmETCUw-1; Fri, 08 Mar 2024 11:24:44 -0500
X-MC-Unique: H3jN9qVmP0u00eUUmETCUw-1
Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a44460e6c06so53277666b.1
        for <passt-dev@passt.top>; Fri, 08 Mar 2024 08:24:43 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1709915082; x=1710519882;
        h=content-transfer-encoding:mime-version:organization: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=ORs70mMylOjKC3NtK1YKpKpOHYaUpzgbNSf1f406X4U=;
        b=LE1XH+Eb9SWYTdBZMU+VSqrrEYk6qGnviWKBIJ3hafEjE+STtuq6QnH+EbI1qWhlYt
         DaBCVEJaN2t9o4wQGYao67FvPQi6xRGyXVszWN91w/Bejsm/HcN9jDUJL5tAiX9cAvg/
         LTay0PBG+WRJRjf4yRP7ivtXoY8tanQtX2oGqi/GusJki83rHG+GOd3qBLcmFBvQMgeS
         TkvqRCatA2/CocPERZbJiaozIhWAB7hz+6ZWf4r7sNuMg+mhbHi1rVVQwdPibVAumclk
         oZTru7gMutvHjdzPs5a0qUShYBYLLfMyyPR9VUM/I4LWOhIn4OnBseL//W1NApOxuzMW
         MSZg==
X-Forwarded-Encrypted: i=1; AJvYcCUC3CdpwlJGBzBzq25ayOWZHn5vSCaDuqR77TDOxRGk/uCFdFCT7Mx5JrB4ZzOQb/K4ucBh08OOvCd5pLuNq/66aXfg
X-Gm-Message-State: AOJu0Yz7DZS5kMY0cqSNJHjmBdKUaAE+H4ztVeryDRKRRNSTJ3PdXTap
	4avRpDGX4NlKqughhkt8x/yxFS1YU54WUYUp/ZhU7Xfbx7ruBnpKY0FgUBNAXDzC9eAaPTAUQGg
	sG+67MJ5J+TWXkhU9ydLnzhOa/Ar+n9BRNTlUPD9XRKDkAav4Ng==
X-Received: by 2002:a17:906:cc93:b0:a43:e46b:7a80 with SMTP id oq19-20020a170906cc9300b00a43e46b7a80mr13739096ejb.43.1709915082426;
        Fri, 08 Mar 2024 08:24:42 -0800 (PST)
X-Google-Smtp-Source: AGHT+IHaTSkAw84njLAZOUC8tUbVpSk6EbYNl/5OF0jekJAsNnLOTEoj0qt8PAs/31iGQUhPMdSfbw==
X-Received: by 2002:a17:906:cc93:b0:a43:e46b:7a80 with SMTP id oq19-20020a170906cc9300b00a43e46b7a80mr13739079ejb.43.1709915081819;
        Fri, 08 Mar 2024 08:24:41 -0800 (PST)
Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33])
        by smtp.gmail.com with ESMTPSA id qw16-20020a1709066a1000b00a3edb758561sm9399668ejc.129.2024.03.08.08.24.41
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 08 Mar 2024 08:24:41 -0800 (PST)
Date: Fri, 8 Mar 2024 17:24:07 +0100
From: Stefano Brivio <sbrivio@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Subject: Re: [PATCH 0/4] Some improvements to the tap send path
Message-ID: <20240308172407.71c95f07@elisabeth>
In-Reply-To: <63786860-6caa-40b3-a432-9a5399636af5@redhat.com>
References: <20240308065325.2181322-1-david@gibson.dropbear.id.au>
	<348a52c9-7c07-4150-b594-4743c7775be6@redhat.com>
	<20240308093404.3328ad2a@elisabeth>
	<63786860-6caa-40b3-a432-9a5399636af5@redhat.com>
Organization: Red Hat
X-Mailer: Claws Mail 4.2.0 (GTK 3.24.36; x86_64-pc-linux-gnu)
MIME-Version: 1.0
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Message-ID-Hash: 2KE3WNTMRJNQGS4XF3DTGWYGBTKKOCAA
X-Message-ID-Hash: 2KE3WNTMRJNQGS4XF3DTGWYGBTKKOCAA
X-MailFrom: sbrivio@redhat.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: David Gibson <david@gibson.dropbear.id.au>, passt-dev@passt.top
X-Mailman-Version: 3.3.8
Precedence: list
List-Id: Development discussion and patches for passt <passt-dev.passt.top>
Archived-At: <https://archives.passt.top/passt-dev/20240308172407.71c95f07@elisabeth/>
Archived-At: <https://passt.top/hyperkitty/list/passt-dev@passt.top/message/2KE3WNTMRJNQGS4XF3DTGWYGBTKKOCAA/>
List-Archive: <https://archives.passt.top/passt-dev/>
List-Archive: <https://passt.top/hyperkitty/list/passt-dev@passt.top/>
List-Help: <mailto:passt-dev-request@passt.top?subject=help>
List-Owner: <mailto:passt-dev-owner@passt.top>
List-Post: <mailto:passt-dev@passt.top>
List-Subscribe: <mailto:passt-dev-join@passt.top>
List-Unsubscribe: <mailto:passt-dev-leave@passt.top>

On Fri, 8 Mar 2024 16:49:20 +0100
Laurent Vivier <lvivier@redhat.com> wrote:

> On 3/8/24 09:34, Stefano Brivio wrote:
> > On Fri, 8 Mar 2024 09:18:48 +0100
> > Laurent Vivier <lvivier@redhat.com> wrote:
> >   
> >> On 3/8/24 07:53, David Gibson wrote:  
> >>> This series has a handful of small improvements to the tap send path.
> >>> See individual commit messages for the details.
> >>>
> >>> I expect this will conflict with Laurent's upcoming work.  I hope the
> >>> conflicts won't be too bad, and indeed will set us up for less
> >>> duplication there in the end.  
> >>
> >> I'm working on patch that devides TCP buffers in several buffers pointed out by an IOV
> >> arrays and then provided to tap_send_frames(). I'm going to base my patch on this series.
> >>
> >> The idea is:
> >>
> >> A frame is made with 4 iovecs:
> >>
> >> #define TCP_IOV_VNET    0
> >> #define TCP_IOV_ETH     1
> >> #define TCP_IOV_IP      2
> >> #define TCP_IOV_PAYLOAD 3
> >> #define TCP_IOV_NUM     4
> >> typedef struct iovec tap_iovec_t[TCP_IOV_NUM];  
> > 
> > Except for the typedef :) (I'm actively trying to discourage them)
> > ...this looks very neat.
> > 
> > I would suggest that as soon as you have something barely spitting out
> > pseudo-correct bytes, you give it a try with perf(1). I'm quite
> > concerned that we might end up killing throughput, especially without
> > vhost-user, even though in theory it all sounds nice and byte-saving.
> >   
> 
> Using iovec improves performance:
> 
> iperf3 -c localhost -p 10001  -t 60  -4
> 
>    iovec
> 
>      [  5]   0.00-60.00  sec  32.9 GBytes  4.72 Gbits/sec    0             sender
>      [  5]   0.00-60.06  sec  32.9 GBytes  4.71 Gbits/sec                  receiver
> 
>    buf_t
> 
>      [  5]   0.00-60.00  sec  15.9 GBytes  2.27 Gbits/sec    0             sender
>      [  5]   0.00-60.06  sec  15.9 GBytes  2.27 Gbits/sec                  receiver

!

...it must be some alignment matter. Nice. I guess it doesn't happen
with large windows (-w ...) or messages (-l 1M), but it looks promising
enough with small ones.

-- 
Stefano