From: Jiri Pirko <jiri@resnulli.us>
To: "Christian König" <christian.koenig@amd.com>
Cc: Chris Mi <chrism@mellanox.com>, netdev@vger.kernel.org
Subject: Re: [patch net-next 0/3] net/sched: Improve getting objects by indexes
Date: Wed, 16 Aug 2017 10:16:31 +0200 [thread overview]
Message-ID: <20170816081631.GC1868@nanopsycho> (raw)
In-Reply-To: <144b87a3-bbe4-a194-ed83-e54840d7c7c2@amd.com>
Wed, Aug 16, 2017 at 09:49:07AM CEST, christian.koenig@amd.com wrote:
>Am 16.08.2017 um 04:12 schrieb Chris Mi:
>> Using current TC code, it is very slow to insert a lot of rules.
>>
>> In order to improve the rules update rate in TC,
>> we introduced the following two changes:
>> 1) changed cls_flower to use IDR to manage the filters.
>> 2) changed all act_xxx modules to use IDR instead of
>> a small hash table
>>
>> But IDR has a limitation that it uses int. TC handle uses u32.
>> To make sure there is no regression, we also changed IDR to use
>> unsigned long. All clients of IDR are changed to use new IDR API.
>
>WOW, wait a second. The idr change is touching a lot of drivers and to be
>honest doesn't looks correct at all.
>
>Just look at the first chunk of your modification:
>> @@ -998,8 +999,9 @@ int bsg_register_queue(struct request_queue *q, struct device *parent,
>> mutex_lock(&bsg_mutex);
>> - ret = idr_alloc(&bsg_minor_idr, bcd, 0, BSG_MAX_DEVS, GFP_KERNEL);
>> - if (ret < 0) {
>> + ret = idr_alloc(&bsg_minor_idr, bcd, &idr_index, 0, BSG_MAX_DEVS,
>> + GFP_KERNEL);
>> + if (ret) {
>> if (ret == -ENOSPC) {
>> printk(KERN_ERR "bsg: too many bsg devices\n");
>> ret = -EINVAL;
>The condition "if (ret)" will now always be true after the first allocation
>and so we always run into the error handling after that.
On success, idr_alloc returns 0.
>
>I've never read the bsg code before, but that's certainly not correct. And
>that incorrect pattern repeats over and over again in this code.
>
>Apart from that why the heck do you want to allocate more than 1<<31 handles?
tc action indexes for example. That is part of this patchset.
next prev parent reply other threads:[~2017-08-16 8:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-16 2:12 [patch net-next 0/3] net/sched: Improve getting objects by indexes Chris Mi
[not found] ` <1502849538-14284-1-git-send-email-chrism-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-08-16 2:12 ` [patch net-next 1/3] idr: Use unsigned long instead of int Chris Mi
2017-08-16 21:44 ` Alexey Dobriyan
2017-08-16 2:12 ` [patch net-next 2/3] net/sched: Change cls_flower to use IDR Chris Mi
2017-08-16 2:12 ` [patch net-next 3/3] net/sched: Change act_api and act_xxx modules " Chris Mi
2017-08-16 7:49 ` [patch net-next 0/3] net/sched: Improve getting objects by indexes Christian König
2017-08-16 8:16 ` Jiri Pirko [this message]
2017-08-16 8:31 ` Christian König
2017-08-16 8:39 ` Jiri Pirko
2017-08-16 8:55 ` Christian König
2017-08-16 9:31 ` Jiri Pirko
2017-08-16 9:41 ` Christian König
2017-08-16 14:28 ` David Laight
2017-08-16 9:19 ` Chris Wilson
2017-08-16 3:05 ` David Miller
2017-08-16 3:38 ` Chris Mi
-- strict thread matches above, loose matches on Subject: below --
2017-08-28 6:41 Chris Mi
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=20170816081631.GC1868@nanopsycho \
--to=jiri@resnulli.us \
--cc=chrism@mellanox.com \
--cc=christian.koenig@amd.com \
--cc=netdev@vger.kernel.org \
/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