mbox series

[net,0/2] When ungrafting from PRIO, replace child with FIFO

Message ID cover.1578333529.git.petrm@mellanox.com
Headers show
Series When ungrafting from PRIO, replace child with FIFO | expand

Message

Petr Machata Jan. 6, 2020, 6:01 p.m. UTC
When a child Qdisc is removed from one of the PRIO Qdisc's bands, it is
replaced unconditionally by a NOOP qdisc. As a result, any traffic hitting
that band gets dropped. That is incorrect--no Qdisc was explicitly added
when PRIO was created, and after removal, none should have to be added
either.

In patch #2, this problem is fixed for PRIO by first attempting to create a
default Qdisc and only falling back to noop when that fails. This pattern
of attempting to create an invisible FIFO, using NOOP only as a fallback,
is also seen in some other Qdiscs.

The only driver currently offloading PRIO (and thus presumably the only one
impacted by this) is mlxsw. Therefore patch #1 extends mlxsw to handle the
replacement by an invisible FIFO gracefully.

Petr Machata (2):
  mlxsw: spectrum_qdisc: Ignore grafting of invisible FIFO
  net: sch_prio: When ungrafting, replace with FIFO

 drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c |  7 +++++++
 net/sched/sch_prio.c                                 | 10 ++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

Comments

David Miller Jan. 8, 2020, 8:47 p.m. UTC | #1
From: Petr Machata <petrm@mellanox.com>
Date: Mon, 6 Jan 2020 18:01:53 +0000

> When a child Qdisc is removed from one of the PRIO Qdisc's bands, it is
> replaced unconditionally by a NOOP qdisc. As a result, any traffic hitting
> that band gets dropped. That is incorrect--no Qdisc was explicitly added
> when PRIO was created, and after removal, none should have to be added
> either.
> 
> In patch #2, this problem is fixed for PRIO by first attempting to create a
> default Qdisc and only falling back to noop when that fails. This pattern
> of attempting to create an invisible FIFO, using NOOP only as a fallback,
> is also seen in some other Qdiscs.
> 
> The only driver currently offloading PRIO (and thus presumably the only one
> impacted by this) is mlxsw. Therefore patch #1 extends mlxsw to handle the
> replacement by an invisible FIFO gracefully.

Series applied, and queued up for -stable, thanks!
David Miller Jan. 8, 2020, 8:48 p.m. UTC | #2
From: Petr Machata <petrm@mellanox.com>
Date: Mon, 6 Jan 2020 18:09:14 +0000

> Dave, when / if you decide to take this, note that it applies cleanly to
> net-next, however the code ends up being wrong and does not build. I put
> a patch with resolution here:
> 
>     https://github.com/jpirko/linux_mlxsw/commit/733d628ce37c38abab486c13a35b83da4b3ed161.patch
> 
> It's meant to be squashed to the merge commit.

Thanks, this will help me a lot when I do my next merge.