From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by passt.top (Postfix) with ESMTPS id 8E2765A0285 for ; Tue, 9 Apr 2024 17:59:54 +0200 (CEST) Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-56e2e851794so18804a12.0 for ; Tue, 09 Apr 2024 08:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712678394; x=1713283194; darn=passt.top; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=R/UKSJmmZmpmPfrid0VP/uklt14bKRE2DJxN9wKrclk=; b=YSYZNrd4HxWMqYnr/89D9ZdKuDYmHHJoaisbErpLtqsQ+XMUJLulC69C85UILkGG99 85X7VIzZy9m7lXKmkQuyXd2LvKIfyK1JtpNL2JsjS8kvtZVMPRqrRwg2R9LMI5864DHh r1mUnzbcdObZnoJo9YKmbHhzx/87bqzac80C6L4ehuoO3jUokuG8rUAd07E7a4NsdPLI Y5Uiwy99j8E5DGP3J77DBZLb6oQqptK74iHGbKBG7mrixjpt9YE/Sap8JN44EckJk9qd NTTyT4pUoknTsZwcK9wH1ZPRb9iXB6wxuBjqeLdxwxdTAwJ4F9pqS/sC4AWaY8Veg9FX WlOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712678394; x=1713283194; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R/UKSJmmZmpmPfrid0VP/uklt14bKRE2DJxN9wKrclk=; b=otGGyJmSTJdrRLSy0vIowuIxS6sLGgMhQzaUnEacjqMNzyC7G6tUlWENXQ9Re22cK0 MJLJprD0OKzV2YjJyU8Of1Ds/uVVS6mYK5Kcb24tLOYsZTIMX6ci5LFzcdrdCnQbPKso Kw2G9JnDBMlIKz/m76SBZb6D4iXAvYTWSMZEnUU6rnzIVwkXfNVU/PxXg0P9dAaCXxnD xVBffYYsQ/sKK7Lz3W+i2mJsHTOCiWhtvlHCKEVSOQLKd8/Y8dUkUMtrIIbs0z5s9+h7 EVoOPEEm9b5AanYumb7AFC452g4akRJN3YNjxePeNFKWhe3ncrsOTNqBhWqfsNjXRP3u XG5A== X-Forwarded-Encrypted: i=1; AJvYcCXWEFG8R2GdThBNcDByUzwPQDvA5TehGUlP8zpM9C6UfsMn8ldQv950wrrVxy7Js6d4RiSo39dZ3SPb2uf4wr3XHn/g X-Gm-Message-State: AOJu0YwUBskPotQNAlvR824PqY8HsyNx/jgZG45ZSStTCIDPxURBQbHQ F87ON05uzXIyRThoOWVYvmSDJcfE1Jq5FX/wB5QXuGBfvYzTjWoHqgJpZCcmSzJmrdrFqMi5Oc4 kAgJlbHOvWoxp/PkzMgjq5UIzahB3HdJ2Ih+J X-Google-Smtp-Source: AGHT+IFm9aPzYO7/xwO7KoweJXTiMzSSKxU3eUsnKdjN0yDeR2ckVA0sVXcOxiBT9dPEy12p4xYjGgZjvF413NgdTb0= X-Received: by 2002:aa7:c906:0:b0:56e:5681:ff3e with SMTP id b6-20020aa7c906000000b0056e5681ff3emr219681edt.2.1712678393837; Tue, 09 Apr 2024 08:59:53 -0700 (PDT) MIME-Version: 1.0 References: <20240409152805.913891-1-jmaloy@redhat.com> In-Reply-To: <20240409152805.913891-1-jmaloy@redhat.com> From: Eric Dumazet Message-ID: Subject: Re: [net-next v4] tcp: add support for SO_PEEK_OFF socket option To: jmaloy@redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-MailFrom: edumazet@google.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation Message-ID-Hash: SZCCG4VZZ2QE4D4YOHII4MEUI5RB6DAN X-Message-ID-Hash: SZCCG4VZZ2QE4D4YOHII4MEUI5RB6DAN X-Mailman-Approved-At: Fri, 12 Apr 2024 07:37:46 +0200 CC: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, passt-dev@passt.top, sbrivio@redhat.com, lvivier@redhat.com, dgibson@redhat.com, eric.dumazet@gmail.com 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: Date: Tue, 09 Apr 2024 15:59:54 X-Original-Date: Tue, 9 Apr 2024 17:59:39 +0200 On Tue, Apr 9, 2024 at 5:28=E2=80=AFPM wrote: > > From: Jon Maloy > > When reading received messages from a socket with MSG_PEEK, we may want > to read the contents with an offset, like we can do with pread/preadv() > when reading files. Currently, it is not possible to do that. > > In this commit, we add support for the SO_PEEK_OFF socket option for TCP, > in a similar way it is done for Unix Domain sockets. > > In the iperf3 log examples shown below, we can observe a throughput > improvement of 15-20 % in the direction host->namespace when using the > protocol splicer 'pasta' (https://passt.top). > This is a consistent result. > > pasta(1) and passt(1) implement user-mode networking for network > namespaces (containers) and virtual machines by means of a translation > layer between Layer-2 network interface and native Layer-4 sockets > (TCP, UDP, ICMP/ICMPv6 echo). > > Received, pending TCP data to the container/guest is kept in kernel > buffers until acknowledged, so the tool routinely needs to fetch new > data from socket, skipping data that was already sent. > > Suggested-by: Paolo Abeni > Reviewed-by: Stefano Brivio > Signed-off-by: Jon Maloy Reviewed-by: Eric Dumazet