From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none 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=fHqM8HFl; 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 ESMTP id 29FF05A004C for ; Thu, 17 Oct 2024 23:21:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729200072; 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=F+lY/bDXwaGcPUpY33VmSDAbIEf25EP8pwVxv6HZcOM=; b=fHqM8HFlhljVD8ipGCBrH2PraUx3zv9sm0GuRsRHEBe22ct2Qyzc5u+GLygjJKXQryJV3S 1sGHHbyeOrvY7OVFlIJTulGtG6LImywTkM4lhIoxMVS/hXKj8TKOlJwL6dPLBZZL/CjsB6 dSw/1fmYNneNa9/QY6+02IePh3kqFX0= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-387-jdvEsLeSMayhJi5i-11Qug-1; Thu, 17 Oct 2024 17:21:10 -0400 X-MC-Unique: jdvEsLeSMayhJi5i-11Qug-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-43157e3521dso8638115e9.1 for ; Thu, 17 Oct 2024 14:21:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729200070; x=1729804870; 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=F+lY/bDXwaGcPUpY33VmSDAbIEf25EP8pwVxv6HZcOM=; b=NvOe/Iyekdl1RE4bngm+U6Qyuq21AZvbUTNq23I8c3FzGTZ+QEAdwE8uWhgqvjMsfr vovDQ/Ks8fbRHuPjAbR5myVjGeZt0MvBlBblZwxZiHnrVd5K5Lmf1v3jhg4zgYoj74Ew v02yOx4+vFxy2gQhbTZXvgpOEKke03PgUXGnMWhDGQfoVy9Sd70vPhFGrlBac98zWyyY HLvH+JvkpuCR+FYn1dGW0sdW6Ym5k7r6sKB74tP/GUSHZiK+5PgpqHkZsUyqVYkqJJkt bI54uxPy1miMBs2r5p5XqtfygJvcM5j12EezIWslZeR9D02WCiVJDQDRa/HhHFSknhxs QZcQ== X-Forwarded-Encrypted: i=1; AJvYcCUILa2sI0jpvYDVqhhy8mOqagP2NCilreIizvbKmzsfsaVkk496NFfQe/tc/XE1Jm5iLam5CBOr6hY=@passt.top X-Gm-Message-State: AOJu0YwY0rgwb1a4rbuDovnx/30Go5KojjE+KdisW1MczMpu7+uSBqVt U9dpcmQoC3/NPHMWHaUCTNmg0VyYYB/57rJZ+oorTzfiWmNPPromRuz/8ffJAJ8XrKwdxJhN8GX SfiL9dRAaxrhowuVU6RFE7KBFthU7+6+KlD3EUcoQKl23vMjM/A== X-Received: by 2002:a05:600c:4447:b0:431:52f5:f497 with SMTP id 5b1f17b1804b1-4316164204dmr566985e9.9.1729200069648; Thu, 17 Oct 2024 14:21:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6wd0wzuInKm6sKzZepeoYZ2HrjqhRyezEhxU2O/iu7mP3NvEcBvxuFl/ZAQOWRvsX7JnKIg== X-Received: by 2002:a05:600c:4447:b0:431:52f5:f497 with SMTP id 5b1f17b1804b1-4316164204dmr566905e9.9.1729200069246; Thu, 17 Oct 2024 14:21:09 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ecf140298sm48061f8f.110.2024.10.17.14.21.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 14:21:08 -0700 (PDT) Date: Thu, 17 Oct 2024 23:21:06 +0200 From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH v8 7/8] vhost-user: add vhost-user Message-ID: <20241017232106.47a42d77@elisabeth> In-Reply-To: <20241017193338.031e717c@elisabeth> References: <20241010122903.1188992-1-lvivier@redhat.com> <20241010122903.1188992-8-lvivier@redhat.com> <20241015215438.1595b4d7@elisabeth> <20241017021031.1adb421e@elisabeth> <20241017132503.0d174463@elisabeth> <100e2890-ff11-4e6f-9967-d05cc3b545d2@redhat.com> <20241017193338.031e717c@elisabeth> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; 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: OFTBSM3D5VMIWMGCVUJTRVTZVECUWUPP X-Message-ID-Hash: OFTBSM3D5VMIWMGCVUJTRVTZVECUWUPP 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 , passt-dev@passt.top 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 Thu, 17 Oct 2024 19:33:38 +0200 Stefano Brivio wrote: > On Thu, 17 Oct 2024 19:18:57 +0200 > Laurent Vivier wrote: > > > On 17/10/2024 13:25, Stefano Brivio wrote: > > > On Thu, 17 Oct 2024 02:10:31 +0200 > > > Stefano Brivio wrote: > > > > > >> On Wed, 16 Oct 2024 11:41:34 +1100 > > >> David Gibson wrote: > > >> > > >>> On Tue, Oct 15, 2024 at 09:54:38PM +0200, Stefano Brivio wrote: > > >>>> [Still partial review] > > >>> [snip] > > >>>>> + if (peek_offset_cap) > > >>>>> + already_sent = 0; > > >>>>> + > > >>>>> + iov_vu[0].iov_base = tcp_buf_discard; > > >>>>> + iov_vu[0].iov_len = already_sent; > > >>>> > > >>>> I think I had a similar comment to a previous revision. Now, I haven't > > >>>> tested this (yet) on a kernel with support for SO_PEEK_OFF on TCP, but > > >>>> I think this should eventually follow the same logic as the (updated) > > >>>> tcp_buf_data_from_sock(): we should use tcp_buf_discard only if > > >>>> (!peek_offset_cap). > > >>>> > > >>>> It's fine to always initialise VIRTQUEUE_MAX_SIZE iov_vu items, > > >>>> starting from 1, for simplicity. But I'm not sure if it's safe to pass a > > >>>> zero iov_len if (peek_offset_cap). > > >>> > > >>>> I'll test that (unless you already did) -- if it works, we can fix this > > >>>> up later as well. > > >>> > > >>> I believe I tested it at some point, and I think we're already using > > >>> it somewhere. > > >> > > >> I tested it again just to be sure on a recent net.git kernel: sometimes > > >> the first test in passt_vu_in_ns/tcp, "TCP/IPv4: host to guest: big > > >> transfer" hangs on my setup, sometimes it's the "TCP/IPv4: ns to guest > > >> (using loopback address): big transfer" test instead. > > >> > > >> I can reproduce at least one of the two issues consistently (tests > > >> stopped 5 times out of 5). > > >> > > >> The socat client completes the transfer, the server is still waiting > > >> for something. I haven't taken captures yet or tried to re-send from > > >> the client. > > > > > > ...Laurent, let me know if I should dig into this any further. > > > > > > For reference, the kernel commit introducing SO_PEEK_OFF support for TCP > > > on IPv6 is be9a4fb831b8 ("tcp: add SO_PEEK_OFF socket option tor > > > TCPv6"). Without that commit, passt won't set peek_offset_cap. > > > > > > It was added in 6.11-rc5, so it's part of kernel-6.11.3-200.fc40 (latest > > > stable kernel) for Fedora 40. passt will print "SO_PEEK_OFF supported" > > > if you run it with -d -f. > > > > > > > I have kernel 6.11.3-200.fc40.x86_64 but the message is "SO_PEEK_OFF not supported". > > > > Any idea? > > Grr, sorry, I used 'git describe' wrong. That commit will be in 6.12 > (not released yet), it's not in 6.11. > > For testing, you can force peek_offset_cap = true in tcp.c, as long as > you don't use IPv6 (you can pass "-4" to passt just to be sure) it's > fine. Or... I didn't know about this until now: https://fedoraproject.org/wiki/RawhideKernelNodebug as well as: https://fedoraproject.org/wiki/Kernel_Vanilla_Repositories https://docs.fedoraproject.org/en-US/releases/rawhide/#_questions_and_answers and kernel-6.12.0-0.rc3.20241015giteca631b8fe80.32.fc42 surely includes that commit: https://bodhi.fedoraproject.org/updates/FEDORA-2024-4f8beaeee0 -- Stefano