]> git.baikalelectronics.ru Git - kernel.git/commit
taprio: Fix enabling offload with wrong number of traffic classes
authorVinicius Costa Gomes <vinicius.gomes@intel.com>
Thu, 6 Feb 2020 21:46:06 +0000 (13:46 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Feb 2020 10:30:03 +0000 (11:30 +0100)
commit55d27673fcf51d2938190ba2067a7acab701b3a4
tree384c1716aaec37aebd74be17b88a87d5329f7a6c
parentbd16e34652d02a80a6a895851e205f89e6dd2486
taprio: Fix enabling offload with wrong number of traffic classes

If the driver implementing taprio offloading depends on the value of
the network device number of traffic classes (dev->num_tc) for
whatever reason, it was going to receive the value zero. The value was
only set after the offloading function is called.

So, moving setting the number of traffic classes to before the
offloading function is called fixes this issue. This is safe because
this only happens when taprio is instantiated (we don't allow this
configuration to be changed without first removing taprio).

Fixes: 6f3f73366f14 ("taprio: Add support for hardware offloading")
Reported-by: Po Liu <po.liu@nxp.com>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Acked-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_taprio.c