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=YVdcAWF+; 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 444275A004C for ; Thu, 17 Oct 2024 19:33:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729186424; 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=Ecocp8JKJ2PH4LlZ1wm7C//7sKHoBdSl2vuiaqZV2kQ=; b=YVdcAWF+4vY1hgdKvJvnoV1QhFZ7qIgNr7LT5avXttwl0XLM/EgU18qbwqwK+1xw6ljyU1 w1u6RSWT3JWdPnG0Ehq25cSRaMWNGe2HvX2MdYpWkoxqdmcPn6dQC+KkWor9jdcyV7OGAY eTq3i2IqTsJH1JbyeqRq8V4G9C6pvyQ= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-631-9Ub8fNsGN_iXTdveSR4aHg-1; Thu, 17 Oct 2024 13:33:42 -0400 X-MC-Unique: 9Ub8fNsGN_iXTdveSR4aHg-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-37d47127e69so572577f8f.1 for ; Thu, 17 Oct 2024 10:33:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729186421; x=1729791221; 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=Ecocp8JKJ2PH4LlZ1wm7C//7sKHoBdSl2vuiaqZV2kQ=; b=t2GRzq5S9uh1OCthr3+z+kXJlU4Qj/JffsE9bWWRKtwQQmuUa1Dx3b8HMUwiZ+Cgy8 d8mfcNe23MAZOwCMA4OPd8Dk09/bnE9plhxu03opSJ1cr8GxJEVFZQHawX/iiQo/MSCA n1SMe50oMg6TSf+9vwN24Kl7GxCKjUtcd1VPaH8Y95xcJOahQV30Wql1TKR8jhth53x7 K0FgROM83FvCtwdSiNRh0BTqESlEbQ4zO94yBOSnkHkfSchsgisTe5jRIvvXKfOK+Hjt XuUC+YYRk7EX7cAJjPLOKChE83ePHAjS/c2KAWWp/m8SvmtD5YbZh6PMe9pYMPysB4zs wESw== X-Forwarded-Encrypted: i=1; AJvYcCWD/wdGqF1Rwm/LyUgv/H1LCJYvMumdMOeeoCNVLot/Tosl/wISwkb1Pv78uPj7SfFJfvWvHEAsRvU=@passt.top X-Gm-Message-State: AOJu0Ywuvacts4Wy6hUzt+OkNYcQQr9NG3vA6pGrudP3FlVrs1uKVdpz yZG1CCaVBlviNm51IT+iREBa+RGtZ8zDvq/Qx1N5DJKHhEW7v/zcSSbSfjVXciDCDsLBgqlBB6c aHolMjLWW5b0MYf+PRQgzIS23APcZYapQwzeYIL8q0W3Xo64cfg== X-Received: by 2002:adf:ea41:0:b0:37d:4cd6:6f2f with SMTP id ffacd0b85a97d-37d86ba83b6mr5332735f8f.3.1729186421504; Thu, 17 Oct 2024 10:33:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsZrtgQcYeCrrjDWXppqiWqMpJ9KRpYyB3xmBdjG+wZb1lElyTWYom+tMqxqTz52wQb1iaSw== X-Received: by 2002:adf:ea41:0:b0:37d:4cd6:6f2f with SMTP id ffacd0b85a97d-37d86ba83b6mr5332720f8f.3.1729186421046; Thu, 17 Oct 2024 10:33:41 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d7fa7a055sm7939378f8f.1.2024.10.17.10.33.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 10:33:40 -0700 (PDT) Date: Thu, 17 Oct 2024 19:33:38 +0200 From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH v8 7/8] vhost-user: add vhost-user Message-ID: <20241017193338.031e717c@elisabeth> In-Reply-To: <100e2890-ff11-4e6f-9967-d05cc3b545d2@redhat.com> 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> 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: BT6LSH6PL4GFRFC37X2RZFVYK4THVWEP X-Message-ID-Hash: BT6LSH6PL4GFRFC37X2RZFVYK4THVWEP 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: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. -- Stefano