]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: fallback to qdisc noqueue if default qdisc setup fail
authorJesper Dangaard Brouer <brouer@redhat.com>
Thu, 30 Apr 2020 11:42:22 +0000 (13:42 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 May 2020 18:50:51 +0000 (11:50 -0700)
commitcd1fff5ed69c79031e115951c92577832d85a59d
tree508bb10d40e0b6ed31a688dca7a96257054fa6ab
parent5541bfc74b2ea095bd1d3fd084ed377946b3c3aa
net: sched: fallback to qdisc noqueue if default qdisc setup fail

Currently if the default qdisc setup/init fails, the device ends up with
qdisc "noop", which causes all TX packets to get dropped.

With the introduction of sysctl net/core/default_qdisc it is possible
to change the default qdisc to be more advanced, which opens for the
possibility that Qdisc_ops->init() can fail.

This patch detect these kind of failures, and choose to fallback to
qdisc "noqueue", which is so simple that its init call will not fail.
This allows the interface to continue functioning.

V2:
As this also captures memory failures, which are transient, the
device is not kept in IFF_NO_QUEUE state.  This allows the net_device
to retry to default qdisc assignment.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_generic.c