From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: "Guedes\, Andre" <andre.guedes@intel.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
"jhs\@mojatatu.com" <jhs@mojatatu.com>,
"xiyou.wangcong\@gmail.com" <xiyou.wangcong@gmail.com>,
"jiri\@resnulli.us" <jiri@resnulli.us>,
"davem\@davemloft.net" <davem@davemloft.net>
Subject: Re: [PATCH net v3] net/sched: cbs: Fix not adding cbs instance to list
Date: Wed, 25 Sep 2019 10:31:45 -0700 [thread overview]
Message-ID: <87d0fo8epq.fsf@linux.intel.com> (raw)
In-Reply-To: <99755D97-F59A-4E68-87AE-6CE88EDE66A3@intel.com>
Hi Andre,
"Guedes, Andre" <andre.guedes@intel.com> writes:
> Hi Vinicius,
>
>> On Sep 23, 2019, at 10:04 PM, Vinicius Costa Gomes <vinicius.gomes@intel.com> wrote:
>>
>> The problem happens because that when offloading is enabled, the cbs
>> instance is not added to the list.
>>
>> Also, the current code doesn't handle correctly the case when offload
>> is disabled without removing the qdisc: if the link speed changes the
>> credit calculations will be wrong. When we create the cbs instance
>> with offloading enabled, it's not added to the notification list, when
>> later we disable offloading, it's not in the list, so link speed
>> changes will not affect it.
>>
>> The solution for both issues is the same, add the cbs instance being
>> created unconditionally to the global list, even if the link state
>> notification isn't useful "right now".
>
> I believe we could fix both issues described above and still don’t
> notify the qdisc about link state if we handled the list
> insertion/removal in cbs_change() instead.
>
> Reading the cbs code more carefully, it seems it would be beneficial
> to refactor the offload handling. For example, we currently init the
> qdisc_watchdog even if it’s not useful when offload is enabled. Now,
> we’re going to notify the qdisc even if it’s not useful too.
I like your idea, but even after reading your email and the code a
couple of times, I couldn't come up with anything quickly that wouldn't
complicate things (i.e. add more code), I would need to experiment a
bit. (btw, qdisc_watchdog_init() is just initializing some fields in a
struct, and the notification part should be quite rare in practice).
So my suggestion is to keep this patch as is, as it solves a real crash
that a colleague faced. Later, we can try and simplify things even more.
Cheers,
--
Vinicius
P.S.: I think I am still a bit traumatized but getting the init() and
destroy() right were the hardest parts when we were trying to uptream
this. That's why I am hesitant about adding more code to those flows.
next prev parent reply other threads:[~2019-09-25 17:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-24 5:04 [PATCH net v3] net/sched: cbs: Fix not adding cbs instance to list Vinicius Costa Gomes
2019-09-24 5:13 ` Cong Wang
2019-09-24 18:12 ` Guedes, Andre
2019-09-25 17:31 ` Vinicius Costa Gomes [this message]
2019-09-26 7:04 ` 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=87d0fo8epq.fsf@linux.intel.com \
--to=vinicius.gomes@intel.com \
--cc=andre.guedes@intel.com \
--cc=davem@davemloft.net \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--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 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.