From: Daniel Borkmann <daniel@iogearbox.net>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
Chris Mi <chrism@mellanox.com>,
Jamal Hadi Salim <jhs@mojatatu.com>
Subject: Re: [Patch net-next v2] net_sched: use idr to allocate bpf filter handles
Date: Tue, 26 Sep 2017 01:47:57 +0200 [thread overview]
Message-ID: <59C995AD.8090001@iogearbox.net> (raw)
In-Reply-To: <CAM_iQpUKURMfZOyTMbgVFG43rgUg8-3yAAVtEmPja5T6xkZpjA@mail.gmail.com>
On 09/26/2017 01:11 AM, Cong Wang wrote:
> On Mon, Sep 25, 2017 at 2:16 PM, Daniel Borkmann <daniel@iogearbox.net> wrote:
>> On 09/25/2017 07:13 PM, Cong Wang wrote:
[...]
>> There's this condition in the code before above idr allocations,
>> I think also in other classifiers:
>>
>> if (oldprog) {
>> if (handle && oldprog->handle != handle) {
>> ret = -EINVAL;
>> goto errout;
>> }
>> }
>
> Sure. If we use handle to find oldprog, it should have the
> same handle. cls_bpf_get() guarantees it. This check is
> redundant.
Good point, we should just test for 'oldprog && oldprog->handle !=
handle' and bail out then, otherwise it's just irritating. I can
see to fix this up later. Seems fine to me then, thanks!
next prev parent reply other threads:[~2017-09-25 23:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-25 17:13 [Patch net-next v2] net_sched: use idr to allocate bpf filter handles Cong Wang
2017-09-25 21:16 ` Daniel Borkmann
2017-09-25 23:11 ` Cong Wang
2017-09-25 23:47 ` Daniel Borkmann [this message]
2017-09-28 16:44 ` David Miller
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=59C995AD.8090001@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=chrism@mellanox.com \
--cc=jhs@mojatatu.com \
--cc=netdev@vger.kernel.org \
--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 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).