linux-stable/drivers/net/ethernet/ti
Grygorii Strashko 90bc21aaef net: ethernet: ti: am65-cpsw: add mqprio qdisc offload in channel mode
This patch adds MQPRIO Qdisc offload in full 'channel' mode which allows
not only setting up pri:tc mapping, but also configuring TX shapers on
external port FIFOs. The K3 CPSW MQPRIO Qdisc offload is expected to work
with VLAN/priority tagged packets. Non-tagged packets have to be mapped
only to TC0.

- TX traffic classes must be rated starting from TC that has highest
priority and with no gaps
- Traffic classes are used starting from 0, that has highest priority
- min_rate defines Committed Information Rate (guaranteed)
- max_rate defines Excess Information Rate (non guaranteed) and offloaded
as (max_rate[i] - tcX_min_rate[i])
- VLAN/priority tagged packets mapped to TC0 will exit switch with VLAN tag
priority 0

The configuration example:
 ethtool -L eth1 tx 5
 ethtool --set-priv-flags eth1 p0-rx-ptype-rrobin off

 tc qdisc add dev eth1 parent root handle 100: mqprio num_tc 3 \
 map 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0 \
 queues 1@0 1@1 1@2 hw 1 mode channel \
 shaper bw_rlimit min_rate 0 100mbit 200mbit max_rate 0 101mbit 202mbit

 tc qdisc replace dev eth2 handle 100: parent root mqprio num_tc 1 \
 map 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 queues 1@0 hw 1

 ip link add link eth1 name eth1.100 type vlan id 100
 ip link set eth1.100 type vlan egress 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7

In the above example two ports share the same TX CPPI queue 0 for low
priority traffic. 3 traffic classes are defined for eth1 and mapped to:
TC0 - low priority, TX CPPI queue 0 -> ext Port 1 fifo0, no rate limit
TC1 - prio 2, TX CPPI queue 1 -> ext Port 1 fifo1, CIR=100Mbit/s, EIR=1Mbit/s
TC2 - prio 3, TX CPPI queue 2 -> ext Port 1 fifo2, CIR=200Mbit/s, EIR=2Mbit/s

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-08-16 12:17:49 +01:00
..
icssg net: ti: icssg-prueth: Add Power management support 2023-08-02 10:38:11 +01:00
am65-cpsw-ethtool.c net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
am65-cpsw-nuss.c net: ethernet: ti: am65-cpsw: add mqprio qdisc offload in channel mode 2023-08-16 12:17:49 +01:00
am65-cpsw-nuss.h net: ethernet: ti: am65-cpsw: add .ndo to set dma per-queue rate 2023-03-28 15:29:22 +02:00
am65-cpsw-qos.c net: ethernet: ti: am65-cpsw: add mqprio qdisc offload in channel mode 2023-08-16 12:17:49 +01:00
am65-cpsw-qos.h net: ethernet: ti: am65-cpsw: add mqprio qdisc offload in channel mode 2023-08-16 12:17:49 +01:00
am65-cpsw-switchdev.c
am65-cpsw-switchdev.h
am65-cpts.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-03-24 10:10:20 -07:00
am65-cpts.h net: ethernet: ti: am65-cpsw/cpts: Fix CPTS release action 2023-01-24 10:08:50 +01:00
cpmac.c net: cpmac: Add __init/__exit annotations to module init/exit funcs 2022-09-29 13:39:58 +02:00
cpsw-common.c net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
cpsw-phy-sel.c net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
cpsw.c page_pool: split types and declarations from page_pool.h 2023-08-07 13:05:19 -07:00
cpsw.h
cpsw_ale.c net: ethernet: ti: cpsw_ale: Fix cpsw_ale_get_field()/cpsw_ale_set_field() 2023-07-14 08:36:43 +01:00
cpsw_ale.h net: ethernet: ti: cpsw_ale: Add cpsw_ale_restore() helper 2022-11-07 12:20:03 +00:00
cpsw_ethtool.c
cpsw_new.c page_pool: split types and declarations from page_pool.h 2023-08-07 13:05:19 -07:00
cpsw_priv.c page_pool: split types and declarations from page_pool.h 2023-08-07 13:05:19 -07:00
cpsw_priv.h eth: add missing xdp.h includes in drivers 2023-08-03 08:38:07 -07:00
cpsw_sl.c
cpsw_sl.h
cpsw_switchdev.c
cpsw_switchdev.h
cpts.c ptp: cpts: convert .adjfreq to .adjfine 2022-11-11 10:58:39 +00:00
cpts.h
davinci_cpdma.c
davinci_cpdma.h
davinci_emac.c net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
davinci_mdio.c net: Explicitly include correct DT includes 2023-07-27 20:33:16 -07:00
k3-cppi-desc-pool.c
k3-cppi-desc-pool.h
Kconfig net: ti: icssg-prueth: Add ICSSG ethernet driver 2023-08-02 10:38:11 +01:00
Makefile net: ti: icssg-prueth: Add ethtool ops for ICSSG Ethernet driver 2023-08-02 10:38:11 +01:00
netcp.h
netcp_core.c Revert "net: netcp: MAX_SKB_FRAGS is now 'int'" 2023-03-31 21:18:02 -07:00
netcp_ethss.c net: Use of_property_read_bool() for boolean properties 2023-03-16 17:41:28 +00:00
netcp_sgmii.c
netcp_xgbepcsr.c
tlan.c net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
tlan.h