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)
commitbf6dba76d278d296b385b436d3ac7de56c190d44
tree508bb10d40e0b6ed31a688dca7a96257054fa6ab
parent09be4c47abe384fe8bd6a6f25012013acacc7729
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