netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Joe Damato <jdamato@fastly.com>
Cc: netdev@vger.kernel.org, Donald Hunter <donald.hunter@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Mina Almasry <almasrymina@google.com>,
	Daniel Jurgens <danielj@nvidia.com>,
	Martin Karsten <mkarsten@uwaterloo.ca>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v3 1/2] netdev-genl: Add an XSK attribute to queues
Date: Thu, 6 Feb 2025 17:41:38 -0800	[thread overview]
Message-ID: <20250206174138.7de4580d@kernel.org> (raw)
In-Reply-To: <Z6Vig04c-a46WScr@LQ3V64L9R2>

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;
}

But totally unsure whether it's worthwhile. Just don't want for someone
to suggest this on v4 and make you respin once again.

  reply	other threads:[~2025-02-07  1:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04 19:10 [PATCH net-next v3 0/2] netdevgenl: Add an xsk attribute to queues Joe Damato
2025-02-04 19:10 ` [PATCH net-next v3 1/2] netdev-genl: Add an XSK " Joe Damato
2025-02-07  0:57   ` Jakub Kicinski
2025-02-07  1:31     ` Joe Damato
2025-02-07  1:41       ` Jakub Kicinski [this message]
2025-02-07  1:46         ` Joe Damato
2025-02-07  6:43   ` kernel test robot
2025-02-04 19:10 ` [PATCH net-next v3 2/2] selftests: drv-net: Test queue xsk attribute Joe Damato

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250206174138.7de4580d@kernel.org \
    --to=kuba@kernel.org \
    --cc=almasrymina@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=danielj@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jdamato@fastly.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkarsten@uwaterloo.ca \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).