[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iKXOZdT7_ww_Jytm4wMoXAe0=pqX+M_iVpNGaHqe_9o4Q@mail.gmail.com>
Date: Thu, 15 Feb 2024 18:46:18 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: Jon Maloy <jmaloy@...hat.com>, kuba@...nel.org, passt-dev@...st.top,
sbrivio@...hat.com, lvivier@...hat.com, dgibson@...hat.com,
netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH v3] tcp: add support for SO_PEEK_OFF
On Thu, Feb 15, 2024 at 6:41 PM Paolo Abeni <pabeni@...hat.com> wrote:
>
> Note: please send text-only email to netdev.
>
> On Thu, 2024-02-15 at 10:11 -0500, Jon Maloy wrote:
> > I wonder if the following could be acceptable:
> >
> > if (flags & MSG_PEEK)
> > sk_peek_offset_fwd(sk, used);
> > else if (peek_offset > 0)
> > sk_peek_offset_bwd(sk, used);
> >
> > peek_offset is already present in the data cache, and if it has the value
> > zero it means either that that sk->sk_peek_off is unused (-1) or actually is zero.
> > Either way, no rewind is needed in that case.
>
> I agree the above should avoid touching cold cachelines in the
> fastpath, and looks functionally correct to me.
>
> The last word is up to Eric :)
>
An actual patch seems needed.
In the current form, local variable peek_offset is 0 when !MSG_PEEK.
So the "else if (peek_offset > 0)" would always be false.
Powered by blists - more mailing lists