[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e1bc19b4b246478ea32cb2631cb514e8@AcuMS.aculab.com>
Date: Fri, 19 Jan 2024 22:32:18 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Eric Dumazet' <edumazet@...gle.com>, Willem de Bruijn
<willemdebruijn.kernel@...il.com>
CC: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Willem de Bruijn
<willemb@...gle.com>, David Ahern <dsahern@...nel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>, "eric.dumazet@...il.com"
<eric.dumazet@...il.com>
Subject: RE: [PATCH net] udp: fix busy polling
...
> > > +static inline bool sk_is_udp(const struct sock *sk)
> > > +{
> > > + return sk->sk_type == SOCK_DGRAM && sk->sk_protocol == IPPROTO_UDP;
> > > +}
> > > +
> >
> > Since busy polling code is protocol (family) independent, is it safe
> > to assume sk->sk_family == PF_INET or PF_INET6 here?
>
> Hmm. This is a valid point.
Do 'we' need separate 16bit sk_family, sk_type and sk_protocol?
Seems a lot of bits.
I was sort of thinking that the above test could be a single compare
(of a compound value).
But since IPPROTO_UDP => SOCK_DGRAM and I don't think you can
possibly run UDP over anything else, getting the sk_protocol values
unique across families (how much non-IP stuff is there anyway)
would simplify all similar tests.
Might impact the socket() system call a bit - but not much.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists