OSDN Git Service

net: ethernet: ti: cpsw: add MQPRIO Qdisc offload
authorIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Mon, 23 Jul 2018 21:26:31 +0000 (00:26 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Jul 2018 03:34:36 +0000 (20:34 -0700)
commit7929a66871a131f692145599b6cc11c571dfbd71
tree6da23d616348ed6d8ae62556ea664a030b1f510b
parent4bb6c356a0393fe7ff5741ede700ba99352640a0
net: ethernet: ti: cpsw: add MQPRIO Qdisc offload

That's possible to offload vlan to tc priority mapping with
assumption sk_prio == L2 prio.

Example:
$ ethtool -L eth0 rx 1 tx 4

$ qdisc replace dev eth0 handle 100: parent root mqprio num_tc 3 \
map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 1

$ tc -g class show dev eth0
+---(100:ffe2) mqprio
|    +---(100:3) mqprio
|    +---(100:4) mqprio
|    
+---(100:ffe1) mqprio
|    +---(100:2) mqprio
|    
+---(100:ffe0) mqprio
     +---(100:1) mqprio

Here, 100:1 is txq0, 100:2 is txq1, 100:3 is txq2, 100:4 is txq3
txq0 belongs to tc0, txq1 to tc1, txq2 and txq3 to tc2
The offload part only maps L2 prio to classes of traffic, but not
to transmit queues, so to direct traffic to traffic class vlan has
to be created with appropriate egress map.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c