[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF=yD-Ky2yW60cD_Vv7+VC0GLJjqJNJitOQXUyH7KYJo95s79g@mail.gmail.com>
Date: Mon, 8 Apr 2019 10:36:43 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: Network Development <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Willem de Bruijn <willemb@...gle.com>,
Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH net-next] datagram: remove rendundant 'peeked' argument
On Mon, Apr 8, 2019 at 4:18 AM Paolo Abeni <pabeni@...hat.com> wrote:
>
> After commit a297569fe00a ("net/udp: do not touch skb->peeked unless
> really needed") the 'peeked' argument of __skb_try_recv_datagram()
> and friends is always equal to !!'flags & MSG_PEEK'.
>
> Since such argument is really a boolean info, and the callers have
> already 'flags & MSG_PEEK' handy, we can remove it and clean-up the
> code a bit.
>
> Signed-off-by: Paolo Abeni <pabeni@...hat.com>
Acked-by: Willem de Bruijn <willemb@...gle.com>
More for my own understanding: I had a quick look why this approach
existed. It does seem that at some point *peeked used to be derived
from skb->peeked, so that MIB indatagrams would be incremented only on
the first read or peek (at a59322be07c9). This calculation was changed
and the update to skb->peeked on every peek avoided as of a297569fe00.
So threading this state then is no longer needed. Good catch!
Now skb_recv_datagram could also subsume __skb_recv_datagram, as it is
the only (trivial) caller.
Powered by blists - more mailing lists