From: Simon Horman <horms@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
pabeni@redhat.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com,
jiri@resnulli.us
Subject: Re: [PATCH net-next] net: sched: cls_api: improve the error message for ID allocation failure
Date: Fri, 13 Sep 2024 12:03:50 +0100 [thread overview]
Message-ID: <20240913110350.GU572255@kernel.org> (raw)
In-Reply-To: <20240912215306.2060709-1-kuba@kernel.org>
On Thu, Sep 12, 2024 at 02:53:06PM -0700, Jakub Kicinski wrote:
> We run into an exhaustion problem with the kernel-allocated filter IDs.
> Our allocation problem can be fixed on the user space side,
> but the error message in this case was quite misleading:
>
> "Filter with specified priority/protocol not found" (EINVAL)
>
> Specifically when we can't allocate a _new_ ID because filter with
> lowest ID already _exists_, saying "filter not found", is confusing.
>
> Kernel allocates IDs in range of 0xc0000 -> 0x8000, giving out ID one
> lower than lowest existing in that range. The error message makes sense
> when tcf_chain_tp_find() gets called for GET and DEL but for NEW we
> need to provide more specific error messages for all three cases:
>
> - user wants the ID to be auto-allocated but filter with ID 0x8000
> already exists
>
> - filter already exists and can be replaced, but user asked
> for a protocol change
>
> - filter doesn't exist
>
> Caller of tcf_chain_tp_insert_unique() doesn't set extack today,
> so don't bother plumbing it in.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2024-09-13 11:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-12 21:53 [PATCH net-next] net: sched: cls_api: improve the error message for ID allocation failure Jakub Kicinski
2024-09-13 11:03 ` Simon Horman [this message]
2024-09-13 14:42 ` Jakub Kicinski
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=20240913110350.GU572255@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=xiyou.wangcong@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.