Re: [Patch net-next 4/5] net_sched: forbid setting default qdisc to inappropriate ones
From: Cong Wang <hidden>
Date: 2015-08-27 22:39:13
On Thu, Aug 27, 2015 at 3:30 PM, David Miller [off-list ref] wrote:
I don't like this. The situation is that some sophisticated qdiscs can function without explicit parameters, some cannot.
This is exactly what this patch tries to solve... I already mark those with a DEFAULTABLE flag.
That is the problem you need to solve. For example, if "opts" is NULL HTB should use a reasonable set of defaults instead of failing. Furthermore, you can improve the behavior when this happens. When qdisc_create_dflt() returns NULL because ops->init() fails, do something reasonable. I'm not applying this patch series, it papers over the issue rather than actually addressing it properly.
I wish I never mention that crash, which leads you to think I am trying to fix a crash rather than a more important issue, usability. See below. Forget about the crash, consider the current behavior: # echo htb > default_qdisc # succeed without any error (then add a root qdisc and remove it) # failure shown here in dmesg And compare it with the behavior after my patch: # echo htb > default_qdisc Invalid arguments I think this is clearly an improvement. Thanks.