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 43CB65A004E for ; Tue, 23 Jul 2024 22:30:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721766636; 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=fkrlLebLf62E8LbuNKAxSTNWf8bGKaN894gJHCF0+kw=; b=INwsQrEzL7u5mJ46089HKZkSKMlt9CcFlEX9ax4jQP/e1MeUphBGrcuyQ3Vm4/LGceDrfF JyShogutjbt9gIzPS+NGcufEK/3Pzai2S9Ugmvk0rdjpPtTeWxTamHmr1sPdDweCHbJDJG G8cZW0aF5vQ4wlfvkrVb67oJ4+l+Yxg= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-638-J7288xxVP6Wko-HbFhmCNw-1; Tue, 23 Jul 2024 16:30:33 -0400 X-MC-Unique: J7288xxVP6Wko-HbFhmCNw-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-79f04b04fa7so853110485a.0 for ; Tue, 23 Jul 2024 13:30:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721766633; x=1722371433; 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=fkrlLebLf62E8LbuNKAxSTNWf8bGKaN894gJHCF0+kw=; b=J6s/9L0t85gUFgiWNfAmuam3PweTP0mzCtmA34H7cyufT8e8eWmId/ON6ssIpW7/Lf 6QPWWcGdJWcWKX3dK3R2csHUiELzxxS6CivsX/jCieraxsl456y4zmUu+hysT6ePT1gR FXYHe4LH9g2r1ST4LR+fRG2Lt6jbyaqiP34QBwNe7822CmuUiB7pdjuPyjeD3SWJI873 0VmOtfuAPtsntUH9frVjJzFmrdNlmsEa+y6jbi1158IMn9daHOLL1+s98S6Q+zPSA0E8 oKWBj9WlwhE/ts1gztXs2KE5vht4eKjpyMm2nWFM9Cw94YfdeAjcXcFc0HVnwIpbxLgP tR3w== X-Gm-Message-State: AOJu0YwBC5XEQE6bKmEYaep4Gysj5u0PE4DsF/pE+46+0lOfPy5+hMF7 3VenxughSjyHriWU1NqdOyWjpLJt+VFeIrVyAxMlz2jmatZvShcmkmnbVJbO4i9OioRATQWWr1E BMv2d0Q1sd/mrikADvJEA8NvtV1MarCq3WsVw4WpfeBDEdntfUA== X-Received: by 2002:a05:620a:4554:b0:79e:fc96:408b with SMTP id af79cd13be357-7a1ca1175bdmr115195485a.40.1721766633151; Tue, 23 Jul 2024 13:30:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEcgx/BSyfRl8EXI4CRqHeHWY+Uaendfs+3tZ9sKqJHMiSX44oEYm9l0qc6v2TdrrqL+2Y2nQ== X-Received: by 2002:a05:620a:4554:b0:79e:fc96:408b with SMTP id af79cd13be357-7a1ca1175bdmr115193485a.40.1721766632801; Tue, 23 Jul 2024 13:30:32 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a198ff997esm507868185a.56.2024.07.23.13.30.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jul 2024 13:30:31 -0700 (PDT) Date: Tue, 23 Jul 2024 22:29:36 +0200 From: Stefano Brivio To: passt-dev@passt.top Subject: Re: [PATCH v2] tcp: probe for SO_PEEK_OFF both in tcpv4 and tcp6 Message-ID: <20240723222936.1c301d30@elisabeth> In-Reply-To: <20240722220937.3663437-1-sbrivio@redhat.com> References: <20240722220937.3663437-1-sbrivio@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=UTF-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: I6AFJMOBQLE6QQYW5EKDE2QQMR2O7W66 X-Message-ID-Hash: I6AFJMOBQLE6QQYW5EKDE2QQMR2O7W66 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: 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 Tue, 23 Jul 2024 00:09:37 +0200 Stefano Brivio wrote: > From: Jon Maloy >=20 > Based on an original patch by Jon Maloy: >=20 > -- > The recently added socket option SO_PEEK_OFF is not supported for > TCP/IPv6 sockets. Until we get that support into the kernel we need to > test for support in both protocols to set the global 'peek_offset_cap=C2= =B4 > to true. > -- >=20 > Compared to the original patch: > - only check for SO_PEEK_OFF support for enabled IP versions > - use sa_family_t instead of int to pass the address family around >=20 > Fixes: e63d281871ef ("tcp: leverage support of SO_PEEK_OFF socket option = when available") ...so, with this, the probing issue is solved: on a 6.10 kernel, SO_PEEK_OFF is not used, unless I disable IPv6 (with --ipv4-only / -4). However, if I disable it, for some reason, resorting to IPv4, at least together with the flow table (applying just this patch to HEAD), I get something that looks like one of the "old" TCP stalls. On the host: $ ./passt -f -t 10000 -4 and in the guest: # ip link set dev eth0 up # dhclient eth0 # iperf3 -s -p 10000 back to the host: $ iperf3 -c 127.0.0.1 -p 10000 Connecting to host 127.0.0.1, port 10000 [ 5] local 127.0.0.1 port 39046 connected to 127.0.0.1 port 10000 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 11.2 MBytes 94.3 Mbits/sec 0 5.50 MBytes = =20 [ 5] 1.00-2.00 sec 0.00 Bytes 0.00 bits/sec 0 5.50 MBytes = =20 [ 5] 2.00-3.00 sec 0.00 Bytes 0.00 bits/sec 0 5.50 MBytes = =20 ...the transfer never recovers. I didn't really have time to debug this further. At the moment I would be inclined to temporarily revert commit e63d281871ef ("tcp: leverage support of SO_PEEK_OFF socket option when available"), but it's not a good idea if this happens to be hiding some (unlikely?) issue with the flow table. --=20 Stefano