Netdev List
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "Toke Høiland-Jørgensen" <toke@redhat.com>,
	"Jamal Hadi Salim" <jhs@mojatatu.com>,
	"Jiri Pirko" <jiri@resnulli.us>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Simon Horman" <horms@kernel.org>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next] tc: Return an error if filters try to attach too many actions
Date: Mon, 14 Apr 2025 14:03:31 -0700	[thread overview]
Message-ID: <Z/14I68bvZRza6eB@pop-os.localdomain> (raw)
In-Reply-To: <20250409171016.57d7d4b7@kernel.org>

On Wed, Apr 09, 2025 at 05:10:16PM -0700, Jakub Kicinski wrote:
> On Wed, 9 Apr 2025 09:44:32 -0700 Cong Wang wrote:
> > > +	if (tb[TCA_ACT_MAX_PRIO + 1]) {
> > > +		NL_SET_ERR_MSG_FMT(extack,
> > > +				   "Only %d actions supported per filter",
> > > +				   TCA_ACT_MAX_PRIO);
> > > +		return -EINVAL;  
> > 
> > I wonder ENOSPC is a better errno than EINVAL here?
> 
> I think EINVAL is fine, it's the generic "netlink says no" error code. 
> The string error should be clear enough.

IMHO, EINVAL is abused (which is probably why we introduced extack). I
prefer to find a better errno than EINVAL whenever possible.

Extack is available but it is mostly for human to read, not technically
an API for programs to interpret.

Thanks.

  reply	other threads:[~2025-04-14 21:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09 14:55 [PATCH net-next] tc: Return an error if filters try to attach too many actions Toke Høiland-Jørgensen
2025-04-09 16:44 ` Cong Wang
2025-04-10  0:10   ` Jakub Kicinski
2025-04-14 21:03     ` Cong Wang [this message]
2025-04-14 21:24       ` Jakub Kicinski
2025-04-15 14:46         ` Paolo Abeni
2025-04-16  0:20 ` patchwork-bot+netdevbpf

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=Z/14I68bvZRza6eB@pop-os.localdomain \
    --to=xiyou.wangcong@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=toke@redhat.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