From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jTwaqAB3; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 0D7E85A0262 for ; Fri, 22 May 2026 14:04:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779451460; 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=wSBQkD+Vvd33Se9ERA/Zpr7I0z8/oLHauXa/Zi/gvtI=; b=jTwaqAB36WSr07bo+EP7QeDTNcJBdlX31AxfUtyxZCDvDh6IixLtMwPNckPC4logfVJh4K 5H4zQCPPZFKB9LgFA1VhpgSJsdGmYJLRymGHAfkLfGF6vCukxyn/CxfwDY7kwtYFubJ7Cp HdvyPDWp+7+qW5E/E4uOeuW/9+FZu78= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-393-_Wd98JyVN7Kz5b8tAkDT0A-1; Fri, 22 May 2026 08:04:19 -0400 X-MC-Unique: _Wd98JyVN7Kz5b8tAkDT0A-1 X-Mimecast-MFC-AGG-ID: _Wd98JyVN7Kz5b8tAkDT0A_1779451458 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-49049100a40so881755e9.2 for ; Fri, 22 May 2026 05:04:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779451458; x=1780056258; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Z22a8N75n9NTUczCL/nyH9A8OL6VBKC3qigSfZxMclA=; b=pIJn6WmQMhqhwIVQ62wFtuT4NdNC8WW6vEczFwplQteztW6UU5kxlQGp14GKEjMsYR rKQjfrCxjI/dmgjpCOIIIcEzNbjvrQIwT/mpUK7GsEFTPhYGnb5Mpi036vhkqADZOUSy oq4yNaI/YMK/mmNK6myB9ihqxDARbXhWYCbuOhRsLupBOXDqFkRFUUzdzO9h9cCbC3s+ TzhL10yCVfEmEsBqhSZAEW8ITYI/WNH6b03sFBEycSQRHEYs0vtuuKX0uZqlymg8GPDO y/I48meHYpNg0hZL4Qexvml/X4JrBKXsgHL6DokpPupMm6qJZgjMcHEesszJNAalPke1 dVDw== X-Gm-Message-State: AOJu0Yy2W+15zyMEH1htGRsHwBnnQibbk0VcyDKjS5WdMb3mr6EE1McI RVmdTkm83u+ijiBeeVu1xaukQjkf5Txc27izceg61iorCRTwFZvmtVWq5Nn1OWALSy7lyJ14w3F TAw/+b4dJACEb/5ippWe7Ny+sB5e2dB9Y1kVcbcyw0eHdmvDFD20M+tKHMH3TsA== X-Gm-Gg: Acq92OF474qJjHJp214l/q5IxLpgRa+a6IKbS4SwmwKdWHU53V7dD+hLSzIhUaxoWdW nTqJsnTFdSHQL5LXSuSQDlIbvy7U65r8EZbGQkEU8Ne2YOxZHvyIwwFa6junCNLP27DZw4vyOeu 7AZwymQtfsJkgqcxGS5GEv4jQqPjTaU3xLno9LjqHsuqb5ce39d8sV4tErcvEnmaKFcERaA2ix4 526euA0+9TnJxnW5x07EuJV0pbCZlK8fJVkDWWAK+Z4qCPmYSwoi4WtohHFKkrKSEDfNRhOLFrK sLBgIWlhTmiZiPEw8Z06gzIdkJuCtTP0+kTz0l13SYWYzt54ZiS/TFkHeCBQJ5POsu4Cjc1XBXq KtpWLRrT8azbKyMMvKiySGDq8xfI1cT5uMtws8FnLa3+2pKyqNA== X-Received: by 2002:a05:600c:4fd0:b0:48f:e6de:1cb9 with SMTP id 5b1f17b1804b1-490428ce9d3mr39950815e9.19.1779451457318; Fri, 22 May 2026 05:04:17 -0700 (PDT) X-Received: by 2002:a05:600c:4fd0:b0:48f:e6de:1cb9 with SMTP id 5b1f17b1804b1-490428ce9d3mr39949985e9.19.1779451456647; Fri, 22 May 2026 05:04:16 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490428f6786sm17527855e9.25.2026.05.22.05.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2026 05:04:15 -0700 (PDT) From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH v4 00/10] vhost-user: Preparatory series for multiple iovec entries per virtqueue element Message-ID: <20260522140414.6eaa8f43@elisabeth> In-Reply-To: <20260522074455.15e6cc3e@elisabeth> References: <20260513115218.1662850-1-lvivier@redhat.com> <20260520173445.0658dfef@elisabeth> <20260520180708.275ec4de@elisabeth> <20260520181852.1f0119ff@elisabeth> <20260520225340.54490a21@elisabeth> <50d79312-0493-4af0-b0bc-7c590885cbd2@redhat.com> <20260522062239.4fcd3314@elisabeth> <20260522074455.15e6cc3e@elisabeth> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Fri, 22 May 2026 14:04:15 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 4I4BDcVuyio7k7u5muImnl7zrDFaEx14F2knNWod1kU_1779451458 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ZKQAJC5YBDO6R563VDCS2K6DU7PAXAAN X-Message-ID-Hash: ZKQAJC5YBDO6R563VDCS2K6DU7PAXAAN 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: passt-dev@passt.top, Jon Maloy , David GIbson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri, 22 May 2026 07:44:55 +0200 Stefano Brivio wrote: > On Fri, 22 May 2026 06:22:39 +0200 > Stefano Brivio wrote: >=20 > > On Fri, 22 May 2026 01:13:33 +0200 > > Laurent Vivier wrote: > > =20 > > > On 5/21/26 10:30, Laurent Vivier wrote: =20 > > > > On 5/20/26 22:53, Stefano Brivio wrote: =20 > > > >> On Wed, 20 May 2026 18:18:52 +0200 > > > >> Stefano Brivio wrote: > > > >> =20 > > > >>> On Wed, 20 May 2026 18:07:08 +0200 > > > >>> Stefano Brivio wrote: > > > >>> =20 > > > >>>> On Wed, 20 May 2026 17:34:45 +0200 > > > >>>> Stefano Brivio wrote: =20 > > > >>>>> On Wed, 13 May 2026 13:52:08 +0200 > > > >>>>> Laurent Vivier wrote: =20 > > > >>>>>> Currently, the vhost-user path assumes each virtqueue element = contains > > > >>>>>> exactly one iovec entry covering the entire frame.=C2=A0 This = assumption > > > >>>>>> breaks as some virtio-net drivers (notably iPXE) provide descr= iptors where the > > > >>>>>> vnet header and the frame payload are in separate buffers, res= ulting in > > > >>>>>> two iovec entries per virtqueue element. > > > >>>>>> > > > >>>>>> This series refactors the vhost-user data path so that frame l= engths, > > > >>>>>> header sizes, and padding are tracked and passed explicitly ra= ther than > > > >>>>>> being derived from iovec sizes.=C2=A0 This decoupling is a pre= requisite for > > > >>>>>> correctly handling padding of multi-buffer frames. =20 > > > >>>>> > > > >>>>> Sorry to bring (likely) bad news, but this series seems to intr= oduce a > > > >>>>> regression: I got the migration/rampstream_in tests fail twice = in a > > > >>>>> row, which I've never saw happening (I think I saw a single fai= lure a > > > >>>>> long time ago when the machine had a high CPU load, but nothing= else). > > > >>>>> > > > >>>>> I'm currently bisecting and the bisect seems to point towards t= he end > > > >>>>> of the series (probably 10/10), but I haven't finished yet. I'l= l keep > > > >>>>> you posted. I haven't spotted anything that might cause issues = there. =20 > > > >>>> > > > >>>> Yeah, that's the one :( > > > >>>> > > > >>>> $ git bisect bad > > > >>>> db798fc60f4c5869cb53168354e068fb4dabd91a is the first bad commit > > > >>>> commit db798fc60f4c5869cb53168354e068fb4dabd91a > > > >>>> Author: Laurent Vivier > > > >>>> Date:=C2=A0=C2=A0 Wed May 13 13:52:18 2026 +0200 > > > >>>> > > > >>>> =C2=A0=C2=A0=C2=A0=C2=A0 vhost-user: Centralise Ethernet frame p= adding in vu_collect() and vu_pad() =20 > > > >=20 > > > > I checked on my system with the commit previous to this series, > > > > bcc3d37a6e01 ("util: Fix changes to assert_with_msg()") and rampstr= eam_in fails too (not=20 > > > > everytime). > > > > =20 > > > > > TCP/IPv4: sequence check, ramps, inbound =20 > > > > ...failed. > > > >=20 > > > > and rampstream_out hangs sometime too. > > > >=20 > > > > I'm going to try with ealier commits. =20 > > >=20 > > > For me the problem can happen with any commit... > > >=20 > > > As it depends on the execution path and on the load and speed of the = system it looks like=20 > > > a race condition. =20 > >=20 > > Hah, thanks for checking. Maybe... > > =20 > > > Did you try to test on a host with a kernel patched with > > > "[PATCH net v2 0/2] Fix race condition between TCP_REPAIR dump and da= ta receive" ? =20 > >=20 > > Now I tried, and yes, the test doesn't hang anymore! I seem to have an > > issue with teardown functions on recent kernels (current net.git HEAD > > more or less): > >=20 > > --- > > [...] > > > > 2026/05/22 04:08:23 socat[73089] E connect(5, AF=3D40 cid:94558 port:22= , 16): Connection timed out > > Connection closed by UNKNOWN port 65535 > > ... > > --- > >=20 > > it looks like we stop QEMU a bit too early. But it should be unrelated. Oops, I forgot to upgrade QEMU on the virtual machine I was using to test those kernel builds, I had a somewhat outdated 8.1 version and it failed migration for unrelated reasons. It works with 11.0. Back to kernel versions: the "problem" is that with a recent net-next.git HEAD, with or without my fix, in a nested VM, the test always passes (20/20). And I can't easily test things non-nested. I guess could just skip that test for the moment from the set I run git push, and run it manually in the virtual machine, for the moment. But judging from captures (test_logs/pasta_1.pcap from PCAP=3D1 ./run) I'm fairly sure it's not *that* issue: 465 12.141763 192.0.2.1 =E2=86=92 88.198.0.164 58451 TCP [TCP Window = Full] 34416 =E2=86=92 10001 [PSH, ACK] Seq=3D10002100 Ack=3D1 Win=3D65536 L= en=3D58397=20 466 12.187195 88.198.0.164 =E2=86=92 192.0.2.1 54 TCP [TCP ZeroWindow= ] 10001 =E2=86=92 34416 [ACK] Seq=3D1 Ack=3D10060497 Win=3D0 Len=3D0=20 467 13.187281 192.0.2.1 =E2=86=92 88.198.0.164 4150 TCP 34416 =E2=86= =92 10001 [PSH, ACK] Seq=3D10060497 Ack=3D1 Win=3D65536 Len=3D4096=20 last data transfer from client (rampstream): 468 13.187358 88.198.0.164 =E2=86=92 192.0.2.1 54 TCP [TCP ZeroWindow= ] 10001 =E2=86=92 34416 [ACK] Seq=3D1 Ack=3D10060497 Win=3D0 Len=3D0=20 everything acknowledged, migration starts now: 469 14.143217 fe80::f471:c3ff:fe10:4e45 =E2=86=92 ff02::2 70 ICMPv6= Router Solicitation from f6:71:c3:10:4e:45=20 470 14.687123 88.198.0.164 =E2=86=92 192.0.2.1 54 TCP [TCP ZeroWindow= ] [TCP Keep-Alive] 10001 =E2=86=92 34416 [ACK] Seq=3D0 Ack=3D10060497 Win= =3D0 Len=3D0=20 migration completed: and we acknowledge the right sequence (10060497), so it didn't jump forward. But starting from this point: 471 14.687265 192.0.2.1 =E2=86=92 88.198.0.164 60 TCP 34416 =E2=86=92= 10001 [ACK] Seq=3D10060497 Ack=3D1 Win=3D65536 Len=3D0=20 472 16.687412 192.0.2.1 =E2=86=92 88.198.0.164 4150 TCP [TCP Retransm= ission] 34416 =E2=86=92 10001 [PSH, ACK] Seq=3D10060497 Ack=3D1 Win=3D65536= Len=3D4096=20 473 16.687450 88.198.0.164 =E2=86=92 192.0.2.1 54 TCP [TCP ZeroWindow= ] 10001 =E2=86=92 34416 [ACK] Seq=3D1 Ack=3D10060497 Win=3D0 Len=3D0=20 474 20.687650 192.0.2.1 =E2=86=92 88.198.0.164 4150 TCP [TCP Retransm= ission] 34416 =E2=86=92 10001 [PSH, ACK] Seq=3D10060497 Ack=3D1 Win=3D65536= Len=3D4096=20 475 20.687692 88.198.0.164 =E2=86=92 192.0.2.1 54 TCP [TCP ZeroWindow= ] 10001 =E2=86=92 34416 [ACK] Seq=3D1 Ack=3D10060497 Win=3D0 Len=3D0=20 476 28.687817 192.0.2.1 =E2=86=92 88.198.0.164 4150 TCP [TCP Retransm= ission] 34416 =E2=86=92 10001 [PSH, ACK] Seq=3D10060497 Ack=3D1 Win=3D65536= Len=3D4096=20 we keep advertising a zero window (that's the kernel doing it really), as if we were unable to dequeue data. I enabled --trace just for the target instance of passt, and I don't see anything suspicious there: 13.0958: Receiving 1 flows 13.0958: Flow 0 (NEW): FREE -> NEW 13.0958: Flow 0 (TCP connection): TGT -> TYPED 13.0958: Flow 0 (TCP connection): HOST [192.0.2.1]:49892 -> [88.198.0.164]:= 10001 =3D> TAP [192.0.2.1]:49892 -> [88.198.0.164]:10001 13.0958: Flow 0 (TCP connection): Side 1 hash table insert: bucket: 138154 13.0958: Flow 0 (TCP connection): TYPED -> ACTIVE 13.0958: Flow 0 (TCP connection): HOST [192.0.2.1]:49892 -> [88.198.0.164]:= 10001 =3D> TAP [192.0.2.1]:49892 -> [88.198.0.164]:10001 13.0959: Flow 0 (TCP connection): Extended migration data, socket 83 sequen= ces send 3121929544 receive 1643895001 13.0959: Flow 0 (TCP connection): pending queues: send 0 not sent 0 recei= ve 3500081 13.0959: Flow 0 (TCP connection): window: snd_wl1 1647395082 snd_wnd 6553= 6 max 65536 rcv_wnd 0 rcv_wup 1647395082 13.0959: Flow 0 (TCP connection): SO_PEEK_OFF disabled offset=3D0 13.0985: Got packet, but RX virtqueue not usable yet 13.0985: Closing migration channel, fd: 82 13.0985: Closing TCP_REPAIR helper socket 13.0985: passt: epoll event on vhost-user command socket 77 (events: 0x0000= 0001) then the usual VHOST_USER_CHECK_DEVICE_STATE and VHOST_USER_SET_VRING_ENABL= E commands. After that, a tight loop of: 13.0986: passt: epoll event on connected TCP socket 83 (events: 0x00000001) 13.0986: Got packet, but RX virtqueue not usable yet 13.0986: passt: epoll event on connected TCP socket 83 (events: 0x00000001) 13.0986: Got packet, but RX virtqueue not usable yet until we go further with the vhost-user setup. I still see this message which I had never noticed (but I didn't try to bisect around it): 13.1006: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Vhost user messag= e =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 13.1006: Request: VHOST_USER_SET_VRING_ADDR (9) [...] 13.1006: Last avail index !=3D used index: 3252 !=3D 3027 and then after VHOST_USER_SET_VRING_CALL, and: 13.1008: passt: epoll event on vhost-user kick socket 78 (events: 0x0000000= 1) 13.1008: vhost-user: got kick_data: 0000000000000001 idx: 1 it's just a tight loop of: 13.1008: passt: epoll event on connected TCP socket 83 (events: 0x00000001) 13.1008: passt: epoll event on connected TCP socket 83 (events: 0x00000001) 13.1008: passt: epoll event on connected TCP socket 83 (events: 0x00000001) as if we weren't dequeueing anything from there. I start suspecting we might be hitting two different issues: perhaps things fail on your setup because of the kernel bug with TCP_REPAIR not freezing the queue, and they fail on my setup for some other reason. For me it's very deterministic though: with patch 10/10 things always fail, and without it they never fail. I guess I'll add more prints and check for more messages before/after that patch. --=20 Stefano