From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by passt.top (Postfix) with ESMTPS id 7E66D5A027B for ; Fri, 16 Feb 2024 11:56:01 +0100 (CET) Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-56037115bb8so5892a12.0 for ; Fri, 16 Feb 2024 02:56:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708080961; x=1708685761; 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=KX2M6t+HpO+1iW7i0PqIiahh3l0yTGcSe9sM2hZ/jGk=; b=I4Zr1Cy0NKWE6H+i+/0lcwIxS9OEpRrDbhw/mrUoFl+wpXLVyFEUvVWzI7jp7Ss4Yf MPHw5etEq1gDI4HBKVEpI3Mz62nRq8juUVetHI+wXCdc1WHSvu81e9NZS7Dj/cGplxXJ BE72XH+E4KTzwL9q2XthrTh2Pnp0emLpWyy5MEDtJCgG9LB683kJA5ssbjCsx8aiKGvX VKchs1d+r8gWFBdySX28d712Teiz9DOOoNDCXXPgJVbylLs+VCK7yPj0rbvyz9+KLgpw KHLSLQc+oUClpt7sQ+9YWeArZonD1l9NB/CNkIa9Q8WDdkc8YXo5Ni5d5oL6vOGQ/aIn tBTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708080961; x=1708685761; 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=KX2M6t+HpO+1iW7i0PqIiahh3l0yTGcSe9sM2hZ/jGk=; b=ebreZslLdGROcJpdxTxIeXD4l8G5avT60t1mkAx7lJpXH6rYMU4yW/HlNjbv8B7Krq MjdAC0n46rLZFhiMfdRAZBzIR158QydA1YFz2jjHPQQLqKpO9WlzMyrSqXsR+FmKnglY ojs2+iDmXK8AZy2d8de1rSklfUMgJRcmCYsi1srRG7m56/1D067XZ5aXo2UHJPcvy4nC QPM9hIa35xm43HtEJXILYTfAw9sFAuuDhIiGAekqoI8hR4nQU/BE3YYG47w2fudDQ1/7 sYdu0qSCtJeiQTpOlybv9mxpmjPZH81wdHHkLBjhipukKlAGWdcM1JHRMZfXX7aIzc7T a9Jg== X-Forwarded-Encrypted: i=1; AJvYcCWfc6k+2WZz/ojKzrYUb1vQ/Q7J571EbVgaiOjcd+REfjuy/apPgnVSbZjqx3dXlxnlmuON8an+eH1fPaRQFYpw1Ppx X-Gm-Message-State: AOJu0YwucRECRhujhCVLduCBJ1bHBFdB1TjweMiY2Flr7NFH9ksLPurn XS4T66n/RVWKn/GmfNt7I7xRlR5m/82gAJqIC2naQYJfgTo6q5TeZBQ/2ca/zBCI02AdRsVP+PP kvoKJ8NlVyJRK/JmFLCPZd1ZQZPlHpk3Io2JB X-Google-Smtp-Source: AGHT+IGlX1QR+LHgM3dgNRGRSkvm9KLpPPg++QJMcF0mCAyVVyKKfI28CC4iVOan2649soOqYcRz1ihtr7hV1nJKQCg= X-Received: by 2002:a50:d546:0:b0:562:deb:df00 with SMTP id f6-20020a50d546000000b005620debdf00mr148059edj.4.1708080960777; Fri, 16 Feb 2024 02:56:00 -0800 (PST) MIME-Version: 1.0 References: <20240209221233.3150253-1-jmaloy@redhat.com> <8d77d8a4e6a37e80aa46cd8df98de84714c384a5.camel@redhat.com> <20072ba530b34729589a3d527c420a766b49e205.camel@redhat.com> <725a92b4813242549f2316e6682d3312b5e658d8.camel@redhat.com> <20687849-ec5c-9ce5-0a18-cc80f5b64816@redhat.com> <178b9f2dbb3c56fcfef46a97ea395bdd13ebfb59.camel@redhat.com> <89f263be-3403-8404-69ed-313539d59669@redhat.com> <9cb12376da3f6cd316320b29f294cc84eaba6cfa.camel@redhat.com> <6a9f5dec-eb0c-51ef-0911-7345f50e08f0@redhat.com> In-Reply-To: <6a9f5dec-eb0c-51ef-0911-7345f50e08f0@redhat.com> From: Eric Dumazet Date: Fri, 16 Feb 2024 11:55:47 +0100 Message-ID: Subject: Re: [PATCH v3] tcp: add support for SO_PEEK_OFF To: Jon Maloy 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: NIY3HYSCZ2TFBRA4TIOHBSK3YDDAPYO7 X-Message-ID-Hash: NIY3HYSCZ2TFBRA4TIOHBSK3YDDAPYO7 X-Mailman-Approved-At: Sat, 17 Feb 2024 11:21:11 +0100 CC: Paolo Abeni , kuba@kernel.org, passt-dev@passt.top, sbrivio@redhat.com, lvivier@redhat.com, dgibson@redhat.com, netdev@vger.kernel.org, davem@davemloft.net 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, Feb 16, 2024 at 11:13=E2=80=AFAM Jon Maloy wrot= e: > > There is also the following alternative: > > if (flags & MSG_PEEK) > sk_peek_offset_fwd(sk, used); > else if (flags & MSG_TRUNC) > sk_peek_offset_bwd(sk, used); > > This is the way we use it, and probably the typical usage. > It would force a user to drain the receive queue with MSG_TRUNC whenever = he is using > MSG_PEEK_OFF, but I don't really see that as a limitation. > > Anyway, if Paolo's suggestion solves the problem this shouldn't be necess= ary. I think the suggestion to move sk_peek_off came from my first message on this thread ;) "We need to move sk_peek_off in a better location before we accept this pa= tch." Anyway, a complete reorg of 'struct sock' was overdue, I am working on it.