[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z6Vl6lcPpj1qBN5e@LQ3V64L9R2>
Date: Thu, 6 Feb 2025 17:46:18 -0800
From: Joe Damato <jdamato@...tly.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, Donald Hunter <donald.hunter@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>,
Andrew Lunn <andrew+netdev@...n.ch>,
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Stanislav Fomichev <sdf@...ichev.me>,
Mina Almasry <almasrymina@...gle.com>,
Daniel Jurgens <danielj@...dia.com>,
Martin Karsten <mkarsten@...terloo.ca>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next v3 1/2] netdev-genl: Add an XSK attribute to
queues
On Thu, Feb 06, 2025 at 05:41:38PM -0800, Jakub Kicinski wrote:
> On Thu, 6 Feb 2025 17:31:47 -0800 Joe Damato wrote:
> > > nla_nest_start() can fail, you gotta nul-check the return value.
> > > You could possibly add an nla_put_empty_nest() helper in netlink.h
> > > to make this less awkward? I think the iouring guys had the same bug
> >
> > Ah, right.
> >
> > I'll see what a helper looks like. Feels like maybe overkill?
>
> Yeah, not sure either. Technically nla_nest_end() isn't required here,
> but that's not very obvious to a casual reader. So a helper that hides
> that fact could be useful:
>
> static inline int nla_put_empty_nest(struct sk_buff *skb, int attrtype)
> {
> return nla_nest_start(skb, attrtype) ? 0 : -EMSGSIZE;
> }
Yea after reading the code it makes sense that nla_nest_end is not
needed. I wrote a small thing similar to what you proposed above,
but yours is more succinct.
I'll go with that and see how it looks.
> But totally unsure whether it's worthwhile. Just don't want for someone
> to suggest this on v4 and make you respin once again.
No worries; respinning is not the end of the world.
Powered by blists - more mailing lists