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=esn8ul2G; 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 548335A0262 for ; Fri, 22 May 2026 08:23:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779431035; 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=PN6sFOVxJ34qeLxo0jfZWGaVhVl0FrUdrBfNJ9lIcVU=; b=esn8ul2Gl5fmUI/AeWRZUZpxwHc/bY1adUqFmWwIRgDqf5kGE8fZGdhP4wfsQgR6Wk/aOE NwAa9rKeGZmP0IngCzM5YQv/2IFYms54dKMNRMEw+lhuvANVWOVX2pq+5eWIKRPCDBbxQb geXtaGVulraktsViv8Yg+52V7Fi+ojM= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-387-IcGNWlsPNSyUAULsk3RkmQ-1; Fri, 22 May 2026 02:23:53 -0400 X-MC-Unique: IcGNWlsPNSyUAULsk3RkmQ-1 X-Mimecast-MFC-AGG-ID: IcGNWlsPNSyUAULsk3RkmQ_1779431032 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-45e7c7289c3so5114657f8f.1 for ; Thu, 21 May 2026 23:23:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779431032; x=1780035832; 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=N5sMq+LXF83zEs7eALvxSw7TfLqxtk3y2FTJSdU9K+Y=; b=Tu1LyjWIDJ9rFFPWr6q2M7Vkbp+79cJkO+b9hqjQlhzQ7kJQOrKLXEGzlxzXG2idKH Hd1ley1Bprx3aCKTdH69BFMz23xO4PEG/19F+q5gLikdKaH/rXSPc4BoAH7Q/unUTgAb qeouqmwVE44EVgHDg13sROsbkpjD3usGl+cjh/bz78ddQQNnqNCyi2FT6fjhiC62yLfE lJ1MmWylrolJS+s+/VOmmqe69DzcXr8jw8jV7vI/ZYVPiwZ7ByUnkxMuuX/pnPBlosvj xkD1bDM/e6JbB2BfXiZJjcBI7TkkIg9PkO6+rWg/dDxtEGjcOeh6ObYWdDtAVW3CjKoB KCXg== X-Forwarded-Encrypted: i=1; AFNElJ+5Og4lTAMjESGXR3w9L3tyt+hlQgmbnca8fegwgOuYmIXc082m0X5IHz5i/NZp6jJae5zW5+YTM8k=@passt.top X-Gm-Message-State: AOJu0YxrPBJ64hYgaE+ZWRSTNo/pIb7achSXsxeu4Z6STmKnrBZO/azP /xAoDkMSBC038pSAoXjdN5R6XLc6OfokCjgnnlEcAmdCpaMBMopFa4YIbNZhjolwog9hjnsVj5K snjX1LCG+Bp5MyJm/ffU50wPN1pN9mCrKuN7vaShrRAvkESST9TT6Og== X-Gm-Gg: Acq92OEw5CGUUvt8ptEcLlD9odcsMmownrP1z4kPG3shCl8QLlmnmzaegvm6BU9AE5m YcHYonrvDKE4y0R85LDL45FwpDpPl3GhfgoLiysPpuusnNvrpTMERG27ZqlP/gU6I6jxkGsf1/K ncARakFKUMD/D1pha96cxxCDJcuCssqz3u8HsVmjCDV0dDCsfkmDlKwdANR7HecVIIc5Ok8uyyF 8PW307p837/yzPWVlqsmr8a2B47f6VZ7GsJNLT+qW9+nZDYm5nQLvdaVkZ0NykdxBv2YFtfaTc3 4JY9wfzrbvG5eGXEM9tApDCYszZYTIrYLW0EQhEnZ1Ai0e1URQQzh+GNQrRnD7365DuO0tv8tpl x7z7xQoJm1rgND4qGErez3L6DJr86lee4 X-Received: by 2002:a05:6000:2f89:b0:45e:7792:6e6d with SMTP id ffacd0b85a97d-45eb3123abbmr2510971f8f.13.1779431031853; Thu, 21 May 2026 23:23:51 -0700 (PDT) X-Received: by 2002:a05:6000:2f89:b0:45e:7792:6e6d with SMTP id ffacd0b85a97d-45eb3123abbmr2510939f8f.13.1779431031346; Thu, 21 May 2026 23:23:51 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45eb6ccd04dsm1714999f8f.9.2026.05.21.23.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2026 23:23:50 -0700 (PDT) From: Stefano Brivio To: David GIbson Subject: Re: [PATCH v4 00/10] vhost-user: Preparatory series for multiple iovec entries per virtqueue element Message-ID: <20260522082349.3141a1f9@elisabeth> In-Reply-To: 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 08:23:50 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: juWiTM8p2jTu2YK6pT2zSU7PXbeiPrL6Hd0kEBEUBYY_1779431032 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 5HJIMICEXNT7DLNMBYW2O44TR6EZTXSA X-Message-ID-Hash: 5HJIMICEXNT7DLNMBYW2O44TR6EZTXSA 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: Laurent Vivier , passt-dev@passt.top, Jon Maloy 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 16:15:08 +1000 David GIbson wrote: > On Fri, May 22, 2026 at 07:44:56AM +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 elemen= t contains > > > > >>>>>> exactly one iovec entry covering the entire frame.=C2=A0 Thi= s assumption > > > > >>>>>> breaks as some virtio-net drivers (notably iPXE) provide des= criptors where the > > > > >>>>>> vnet header and the frame payload are in separate buffers, r= esulting in > > > > >>>>>> two iovec entries per virtqueue element. > > > > >>>>>> > > > > >>>>>> This series refactors the vhost-user data path so that frame= lengths, > > > > >>>>>> header sizes, and padding are tracked and passed explicitly = rather than > > > > >>>>>> being derived from iovec sizes.=C2=A0 This decoupling is a p= rerequisite for > > > > >>>>>> correctly handling padding of multi-buffer frames. =20 > > > > >>>>> > > > > >>>>> Sorry to bring (likely) bad news, but this series seems to in= troduce a > > > > >>>>> regression: I got the migration/rampstream_in tests fail twic= e in a > > > > >>>>> row, which I've never saw happening (I think I saw a single f= ailure a > > > > >>>>> long time ago when the machine had a high CPU load, but nothi= ng else). > > > > >>>>> > > > > >>>>> I'm currently bisecting and the bisect seems to point towards= the end > > > > >>>>> of the series (probably 10/10), but I haven't finished yet. I= 'll keep > > > > >>>>> you posted. I haven't spotted anything that might cause issue= s there. =20 > > > > >>>> > > > > >>>> Yeah, that's the one :( > > > > >>>> > > > > >>>> $ git bisect bad > > > > >>>> db798fc60f4c5869cb53168354e068fb4dabd91a is the first bad comm= it > > > > >>>> 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= padding 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 ramps= tream_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 th= e 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 = data receive" ? =20 > > >=20 > > > Now I tried, and yes, the test doesn't hang anymore! I seem to have a= n > > > issue with teardown functions on recent kernels (current net.git HEAD > > > more or less): > > >=20 > > > --- > > > + teardown_migrate > > > + cat /tmp/passt-tests-VVtLn0/migrate/qemu_1.pid > > > + /home/sbrivio/passt/test/nstool exec /tmp/passt-tests-VVtLn0/migrat= e/ns1.hold -- kill 16 > > > qemu-system-x86_64: terminating on signal 15 from pid 34 () > > > + cat /tmp/passt-tests-VVtLn0/migrate/qemu_2.pid > > > + /home/sbrivio/passt/test/nstool exec /tmp/passt-tests-VVtLn0/migrat= e/ns1.hold -- kill 15 > > > 18.8974: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Vhost user = message =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > 18.8974: Request: VHOST_USER_GET_VRING_BASE (11) > > > 18.8974: Flags: 0x1 > > > 18.8974: Size: 8 > > > 18.8974: State.index: 0 > > > 18.8975: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Vhost user = message =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > 18.8975: Request: VHOST_USER_GET_VRING_BASE (11) > > > 18.8975: Flags: 0x1 > > > 18.8975: Size: 8 > > > 18.8975: State.index: 1 > > > qemu-system-x86_64: terminating on signal 15 from pid 35 () > > > 18.7961: Client connection closed > > > 18.7962: Closing TCP_REPAIR helper socket > > > + context_wait qemu_1 > > > + __name=3Dqemu_1 > > > + __pidfile=3D/tmp/passt-tests-VVtLn0/migrate/context_qemu_1.pid > > > + cat /tmp/passt-tests-VVtLn0/migrate/context_qemu_1.pid > > > + rc=3D0 > > > + rm /tmp/passt-tests-VVtLn0/migrate/context_passt_repair_2.stdout.9p= wpVbQr /tmp/passt-tests-VVtLn0/migrate/context_passt_repair_2.stderr.dSY5hB= u1 > > > + __pid=3D67766 > > > + rm /tmp/passt-tests-VVtLn0/migrate/context_qemu_1.pid > > > + [ 1 -eq 1 ] > > > + echo [Exit code: 0] > > > + echo -n passt_repair_2$=20 > > > + return 0 > > > 18.9016: Client connection closed > > > 18.9018: Closing TCP_REPAIR helper socket > > > + wait 67766 > > > + rc=3D0 > > > + rm /tmp/passt-tests-VVtLn0/migrate/context_passt_repair_1.stdout.JE= yDGxXe /tmp/passt-tests-VVtLn0/migrate/context_passt_repair_1.stderr.WU550i= EI > > > + [ 1 -eq 1 ] > > > + echo [Exit code: 0] > > > + echo -n passt_repair_1$=20 > > > + return 0 > > > + rc=3D0 > > > + rm /tmp/passt-tests-VVtLn0/migrate/context_qemu_2.stdout.Dm8EAhfl /= tmp/passt-tests-VVtLn0/migrate/context_qemu_2.stderr.207qJYPA > > > + [ 1 -eq 1 ] > > > + echo [Exit code: 0] > > > + echo -n qemu_2$=20 > > > + return 0 > > > 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 unrelate= d. > > >=20 > > > I'm now trying to find some kind of workaround for existing (not fixe= d) > > > kernel versions. Maybe stopping rampstream_in for a moment or somethi= ng > > > like that. =20 > >=20 > > For some weird reason even very blatant throttling (100 ms - 1 s delays > > every 10000 ramps, or an explicit 500 ms pause via signal before > > migration) doesn't help. > >=20 > > So it doesn't seem to be *that* kind of race. I should probably check > > the same exact kernel version with fix and without... =20 >=20 > If it's due to the kernel not stopping the queues on REPAIR, then the > only real way to fix the test is to cut off the source machine's > network before we trigger migration. Well, that's a rather complicated way to do it. One could simply stop the traffic instead. But it doesn't help, so there's probably another issue. > That could be done with > netfilter (in a user+netns). But probably more natural would be to > not do the migration between local passt instances, but actually > between two host namespaces, with separate netifs for external > connectivity and for the migration. Remove the external netif on the > source, then trigger migration, then add the external netif on the > destination. >=20 > It's quite a bit of hassle :(. But it does model something much > closer to a real migration scenario. As a bonus it would mean we'd no > longer rely on the hack of guessing when to exit the source passt in > order to allow the destination passt to bind. I struggle to see how that would be worth the investment, especially if we're working around a kernel issue that should eventually be fixed. Or, at least, right now, I'm just trying to get tests to pass while keeping Laurent changes in the tree.. --=20 Stefano