diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-06-04 01:27:18 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-06-04 01:27:18 +0200 |
commit | cb8e59cc87201af93dfbb6c3dccc8fcad72a09c2 (patch) | |
tree | a334db9022f89654b777bbce8c4c6632e65b9031 /Documentation/networking/device_drivers/ti | |
parent | Merge branch 'uaccess.comedi' of git://git.kernel.org/pub/scm/linux/kernel/gi... (diff) | |
parent | selftests: net: ip_defrag: ignore EPERM (diff) | |
download | linux-cb8e59cc87201af93dfbb6c3dccc8fcad72a09c2.tar.xz linux-cb8e59cc87201af93dfbb6c3dccc8fcad72a09c2.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next
Pull networking updates from David Miller:
1) Allow setting bluetooth L2CAP modes via socket option, from Luiz
Augusto von Dentz.
2) Add GSO partial support to igc, from Sasha Neftin.
3) Several cleanups and improvements to r8169 from Heiner Kallweit.
4) Add IF_OPER_TESTING link state and use it when ethtool triggers a
device self-test. From Andrew Lunn.
5) Start moving away from custom driver versions, use the globally
defined kernel version instead, from Leon Romanovsky.
6) Support GRO vis gro_cells in DSA layer, from Alexander Lobakin.
7) Allow hard IRQ deferral during NAPI, from Eric Dumazet.
8) Add sriov and vf support to hinic, from Luo bin.
9) Support Media Redundancy Protocol (MRP) in the bridging code, from
Horatiu Vultur.
10) Support netmap in the nft_nat code, from Pablo Neira Ayuso.
11) Allow UDPv6 encapsulation of ESP in the ipsec code, from Sabrina
Dubroca. Also add ipv6 support for espintcp.
12) Lots of ReST conversions of the networking documentation, from Mauro
Carvalho Chehab.
13) Support configuration of ethtool rxnfc flows in bcmgenet driver,
from Doug Berger.
14) Allow to dump cgroup id and filter by it in inet_diag code, from
Dmitry Yakunin.
15) Add infrastructure to export netlink attribute policies to
userspace, from Johannes Berg.
16) Several optimizations to sch_fq scheduler, from Eric Dumazet.
17) Fallback to the default qdisc if qdisc init fails because otherwise
a packet scheduler init failure will make a device inoperative. From
Jesper Dangaard Brouer.
18) Several RISCV bpf jit optimizations, from Luke Nelson.
19) Correct the return type of the ->ndo_start_xmit() method in several
drivers, it's netdev_tx_t but many drivers were using
'int'. From Yunjian Wang.
20) Add an ethtool interface for PHY master/slave config, from Oleksij
Rempel.
21) Add BPF iterators, from Yonghang Song.
22) Add cable test infrastructure, including ethool interfaces, from
Andrew Lunn. Marvell PHY driver is the first to support this
facility.
23) Remove zero-length arrays all over, from Gustavo A. R. Silva.
24) Calculate and maintain an explicit frame size in XDP, from Jesper
Dangaard Brouer.
25) Add CAP_BPF, from Alexei Starovoitov.
26) Support terse dumps in the packet scheduler, from Vlad Buslov.
27) Support XDP_TX bulking in dpaa2 driver, from Ioana Ciornei.
28) Add devm_register_netdev(), from Bartosz Golaszewski.
29) Minimize qdisc resets, from Cong Wang.
30) Get rid of kernel_getsockopt and kernel_setsockopt in order to
eliminate set_fs/get_fs calls. From Christoph Hellwig.
* git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (2517 commits)
selftests: net: ip_defrag: ignore EPERM
net_failover: fixed rollback in net_failover_open()
Revert "tipc: Fix potential tipc_aead refcnt leak in tipc_crypto_rcv"
Revert "tipc: Fix potential tipc_node refcnt leak in tipc_rcv"
vmxnet3: allow rx flow hash ops only when rss is enabled
hinic: add set_channels ethtool_ops support
selftests/bpf: Add a default $(CXX) value
tools/bpf: Don't use $(COMPILE.c)
bpf, selftests: Use bpf_probe_read_kernel
s390/bpf: Use bcr 0,%0 as tail call nop filler
s390/bpf: Maintain 8-byte stack alignment
selftests/bpf: Fix verifier test
selftests/bpf: Fix sample_cnt shared between two threads
bpf, selftests: Adapt cls_redirect to call csum_level helper
bpf: Add csum_level helper for fixing up csum levels
bpf: Fix up bpf_skb_adjust_room helper's skb csum setting
sfc: add missing annotation for efx_ef10_try_update_nic_stats_vf()
crypto/chtls: IPv6 support for inline TLS
Crypto/chcr: Fixes a coccinile check error
Crypto/chcr: Fixes compilations warnings
...
Diffstat (limited to 'Documentation/networking/device_drivers/ti')
-rw-r--r-- | Documentation/networking/device_drivers/ti/cpsw.rst | 587 | ||||
-rw-r--r-- | Documentation/networking/device_drivers/ti/cpsw.txt | 541 | ||||
-rw-r--r-- | Documentation/networking/device_drivers/ti/cpsw_switchdev.rst (renamed from Documentation/networking/device_drivers/ti/cpsw_switchdev.txt) | 243 | ||||
-rw-r--r-- | Documentation/networking/device_drivers/ti/tlan.rst (renamed from Documentation/networking/device_drivers/ti/tlan.txt) | 73 |
4 files changed, 773 insertions, 671 deletions
diff --git a/Documentation/networking/device_drivers/ti/cpsw.rst b/Documentation/networking/device_drivers/ti/cpsw.rst new file mode 100644 index 000000000000..a88946bd188b --- /dev/null +++ b/Documentation/networking/device_drivers/ti/cpsw.rst @@ -0,0 +1,587 @@ +.. SPDX-License-Identifier: GPL-2.0 + +====================================== +Texas Instruments CPSW ethernet driver +====================================== + +Multiqueue & CBS & MQPRIO +========================= + + +The cpsw has 3 CBS shapers for each external ports. This document +describes MQPRIO and CBS Qdisc offload configuration for cpsw driver +based on examples. It potentially can be used in audio video bridging +(AVB) and time sensitive networking (TSN). + +The following examples were tested on AM572x EVM and BBB boards. + +Test setup +========== + +Under consideration two examples with AM572x EVM running cpsw driver +in dual_emac mode. + +Several prerequisites: + +- TX queues must be rated starting from txq0 that has highest priority +- Traffic classes are used starting from 0, that has highest priority +- CBS shapers should be used with rated queues +- The bandwidth for CBS shapers has to be set a little bit more then + potential incoming rate, thus, rate of all incoming tx queues has + to be a little less +- Real rates can differ, due to discreetness +- Map skb-priority to txq is not enough, also skb-priority to l2 prio + map has to be created with ip or vconfig tool +- Any l2/socket prio (0 - 7) for classes can be used, but for + simplicity default values are used: 3 and 2 +- only 2 classes tested: A and B, but checked and can work with more, + maximum allowed 4, but only for 3 rate can be set. + +Test setup for examples +======================= + +:: + + +-------------------------------+ + |--+ | + | | Workstation0 | + |E | MAC 18:03:73:66:87:42 | + +-----------------------------+ +--|t | | + | | 1 | E | | |h |./tsn_listener -d \ | + | Target board: | 0 | t |--+ |0 | 18:03:73:66:87:42 -i eth0 \| + | AM572x EVM | 0 | h | | | -s 1500 | + | | 0 | 0 | |--+ | + | Only 2 classes: |Mb +---| +-------------------------------+ + | class A, class B | | + | | +---| +-------------------------------+ + | | 1 | E | |--+ | + | | 0 | t | | | Workstation1 | + | | 0 | h |--+ |E | MAC 20:cf:30:85:7d:fd | + | |Mb | 1 | +--|t | | + +-----------------------------+ |h |./tsn_listener -d \ | + |0 | 20:cf:30:85:7d:fd -i eth0 \| + | | -s 1500 | + |--+ | + +-------------------------------+ + + +Example 1: One port tx AVB configuration scheme for target board +---------------------------------------------------------------- + +(prints and scheme for AM572x evm, applicable for single port boards) + +- tc - traffic class +- txq - transmit queue +- p - priority +- f - fifo (cpsw fifo) +- S - shaper configured + +:: + + +------------------------------------------------------------------+ u + | +---------------+ +---------------+ +------+ +------+ | s + | | | | | | | | | | e + | | App 1 | | App 2 | | Apps | | Apps | | r + | | Class A | | Class B | | Rest | | Rest | | + | | Eth0 | | Eth0 | | Eth0 | | Eth1 | | s + | | VLAN100 | | VLAN100 | | | | | | | | p + | | 40 Mb/s | | 20 Mb/s | | | | | | | | a + | | SO_PRIORITY=3 | | SO_PRIORITY=2 | | | | | | | | c + | | | | | | | | | | | | | | e + | +---|-----------+ +---|-----------+ +---|--+ +---|--+ | + +-----|------------------|------------------|--------|-------------+ + +-+ +------------+ | | + | | +-----------------+ +--+ + | | | | + +---|-------|-------------|-----------------------|----------------+ + | +----+ +----+ +----+ +----+ +----+ | + | | p3 | | p2 | | p1 | | p0 | | p0 | | k + | \ / \ / \ / \ / \ / | e + | \ / \ / \ / \ / \ / | r + | \/ \/ \/ \/ \/ | n + | | | | | | e + | | | +-----+ | | l + | | | | | | + | +----+ +----+ +----+ +----+ | s + | |tc0 | |tc1 | |tc2 | |tc0 | | p + | \ / \ / \ / \ / | a + | \ / \ / \ / \ / | c + | \/ \/ \/ \/ | e + | | | +-----+ | | + | | | | | | | + | | | | | | | + | | | | | | | + | +----+ +----+ +----+ +----+ +----+ | + | |txq0| |txq1| |txq2| |txq3| |txq4| | + | \ / \ / \ / \ / \ / | + | \ / \ / \ / \ / \ / | + | \/ \/ \/ \/ \/ | + | +-|------|------|------|--+ +--|--------------+ | + | | | | | | | Eth0.100 | | Eth1 | | + +---|------|------|------|------------------------|----------------+ + | | | | | + p p p p | + 3 2 0-1, 4-7 <- L2 priority | + | | | | | + | | | | | + +---|------|------|------|------------------------|----------------+ + | | | | | |----------+ | + | +----+ +----+ +----+ +----+ +----+ | + | |dma7| |dma6| |dma5| |dma4| |dma3| | + | \ / \ / \ / \ / \ / | c + | \S / \S / \ / \ / \ / | p + | \/ \/ \/ \/ \/ | s + | | | | +----- | | w + | | | | | | | + | | | | | | | d + | +----+ +----+ +----+p p+----+ | r + | | | | | | |o o| | | i + | | f3 | | f2 | | f0 |r r| f0 | | v + | |tc0 | |tc1 | |tc2 |t t|tc0 | | e + | \CBS / \CBS / \CBS /1 2\CBS / | r + | \S / \S / \ / \ / | + | \/ \/ \/ \/ | + +------------------------------------------------------------------+ + + +1) :: + + + // Add 4 tx queues, for interface Eth0, and 1 tx queue for Eth1 + $ ethtool -L eth0 rx 1 tx 5 + rx unmodified, ignoring + +2) :: + + // Check if num of queues is set correctly: + $ ethtool -l eth0 + Channel parameters for eth0: + Pre-set maximums: + RX: 8 + TX: 8 + Other: 0 + Combined: 0 + Current hardware settings: + RX: 1 + TX: 5 + Other: 0 + Combined: 0 + +3) :: + + // TX queues must be rated starting from 0, so set bws for tx0 and tx1 + // Set rates 40 and 20 Mb/s appropriately. + // Pay attention, real speed can differ a bit due to discreetness. + // Leave last 2 tx queues not rated. + $ echo 40 > /sys/class/net/eth0/queues/tx-0/tx_maxrate + $ echo 20 > /sys/class/net/eth0/queues/tx-1/tx_maxrate + +4) :: + + // Check maximum rate of tx (cpdma) queues: + $ cat /sys/class/net/eth0/queues/tx-*/tx_maxrate + 40 + 20 + 0 + 0 + 0 + +5) :: + + // Map skb->priority to traffic class: + // 3pri -> tc0, 2pri -> tc1, (0,1,4-7)pri -> tc2 + // Map traffic class to transmit queue: + // tc0 -> txq0, tc1 -> txq1, tc2 -> (txq2, txq3) + $ tc 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 + +5a) :: + + // As two interface sharing same set of tx queues, assign all traffic + // coming to interface Eth1 to separate queue in order to not mix it + // with traffic from interface Eth0, so use separate txq to send + // packets to Eth1, so all prio -> tc0 and tc0 -> txq4 + // Here hw 0, so here still default configuration for eth1 in hw + $ tc qdisc replace dev eth1 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@4 hw 0 + +6) :: + + // Check classes settings + $ 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 + + $ tc -g class show dev eth1 + +---(100:ffe0) mqprio + +---(100:5) mqprio + +7) :: + + // Set rate for class A - 41 Mbit (tc0, txq0) using CBS Qdisc + // Set it +1 Mb for reserve (important!) + // here only idle slope is important, others arg are ignored + // Pay attention, real speed can differ a bit due to discreetness + $ tc qdisc add dev eth0 parent 100:1 cbs locredit -1438 \ + hicredit 62 sendslope -959000 idleslope 41000 offload 1 + net eth0: set FIFO3 bw = 50 + +8) :: + + // Set rate for class B - 21 Mbit (tc1, txq1) using CBS Qdisc: + // Set it +1 Mb for reserve (important!) + $ tc qdisc add dev eth0 parent 100:2 cbs locredit -1468 \ + hicredit 65 sendslope -979000 idleslope 21000 offload 1 + net eth0: set FIFO2 bw = 30 + +9) :: + + // Create vlan 100 to map sk->priority to vlan qos + $ ip link add link eth0 name eth0.100 type vlan id 100 + 8021q: 802.1Q VLAN Support v1.8 + 8021q: adding VLAN 0 to HW filter on device eth0 + 8021q: adding VLAN 0 to HW filter on device eth1 + net eth0: Adding vlanid 100 to vlan filter + +10) :: + + // Map skb->priority to L2 prio, 1 to 1 + $ ip link set eth0.100 type vlan \ + egress 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7 + +11) :: + + // Check egress map for vlan 100 + $ cat /proc/net/vlan/eth0.100 + [...] + INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0 + EGRESS priority mappings: 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7 + +12) :: + + // Run your appropriate tools with socket option "SO_PRIORITY" + // to 3 for class A and/or to 2 for class B + // (I took at https://www.spinics.net/lists/netdev/msg460869.html) + ./tsn_talker -d 18:03:73:66:87:42 -i eth0.100 -p3 -s 1500& + ./tsn_talker -d 18:03:73:66:87:42 -i eth0.100 -p2 -s 1500& + +13) :: + + // run your listener on workstation (should be in same vlan) + // (I took at https://www.spinics.net/lists/netdev/msg460869.html) + ./tsn_listener -d 18:03:73:66:87:42 -i enp5s0 -s 1500 + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39000 kbps + +14) :: + + // Restore default configuration if needed + $ ip link del eth0.100 + $ tc qdisc del dev eth1 root + $ tc qdisc del dev eth0 root + net eth0: Prev FIFO2 is shaped + net eth0: set FIFO3 bw = 0 + net eth0: set FIFO2 bw = 0 + $ ethtool -L eth0 rx 1 tx 1 + +Example 2: Two port tx AVB configuration scheme for target board +---------------------------------------------------------------- + +(prints and scheme for AM572x evm, for dual emac boards only) + +:: + + +------------------------------------------------------------------+ u + | +----------+ +----------+ +------+ +----------+ +----------+ | s + | | | | | | | | | | | | e + | | App 1 | | App 2 | | Apps | | App 3 | | App 4 | | r + | | Class A | | Class B | | Rest | | Class B | | Class A | | + | | Eth0 | | Eth0 | | | | | Eth1 | | Eth1 | | s + | | VLAN100 | | VLAN100 | | | | | VLAN100 | | VLAN100 | | p + | | 40 Mb/s | | 20 Mb/s | | | | | 10 Mb/s | | 30 Mb/s | | a + | | SO_PRI=3 | | SO_PRI=2 | | | | | SO_PRI=3 | | SO_PRI=2 | | c + | | | | | | | | | | | | | | | | | e + | +---|------+ +---|------+ +---|--+ +---|------+ +---|------+ | + +-----|-------------|-------------|---------|-------------|--------+ + +-+ +-------+ | +----------+ +----+ + | | +-------+------+ | | + | | | | | | + +---|-------|-------------|--------------|-------------|-------|---+ + | +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ | + | | p3 | | p2 | | p1 | | p0 | | p0 | | p1 | | p2 | | p3 | | k + | \ / \ / \ / \ / \ / \ / \ / \ / | e + | \ / \ / \ / \ / \ / \ / \ / \ / | r + | \/ \/ \/ \/ \/ \/ \/ \/ | n + | | | | | | | | e + | | | +----+ +----+ | | | l + | | | | | | | | + | +----+ +----+ +----+ +----+ +----+ +----+ | s + | |tc0 | |tc1 | |tc2 | |tc2 | |tc1 | |tc0 | | p + | \ / \ / \ / \ / \ / \ / | a + | \ / \ / \ / \ / \ / \ / | c + | \/ \/ \/ \/ \/ \/ | e + | | | +-----+ +-----+ | | | + | | | | | | | | | | + | | | | | | | | | | + | | | | | E E | | | | | + | +----+ +----+ +----+ +----+ t t +----+ +----+ +----+ +----+ | + | |txq0| |txq1| |txq4| |txq5| h h |txq6| |txq7| |txq3| |txq2| | + | \ / \ / \ / \ / 0 1 \ / \ / \ / \ / | + | \ / \ / \ / \ / . . \ / \ / \ / \ / | + | \/ \/ \/ \/ 1 1 \/ \/ \/ \/ | + | +-|------|------|------|--+ 0 0 +-|------|------|------|--+ | + | | | | | | | 0 0 | | | | | | | + +---|------|------|------|---------------|------|------|------|----+ + | | | | | | | | + p p p p p p p p + 3 2 0-1, 4-7 <-L2 pri-> 0-1, 4-7 2 3 + | | | | | | | | + | | | | | | | | + +---|------|------|------|---------------|------|------|------|----+ + | | | | | | | | | | + | +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ | + | |dma7| |dma6| |dma3| |dma2| |dma1| |dma0| |dma4| |dma5| | + | \ / \ / \ / \ / \ / \ / \ / \ / | c + | \S / \S / \ / \ / \ / \ / \S / \S / | p + | \/ \/ \/ \/ \/ \/ \/ \/ | s + | | | | +----- | | | | | w + | | | | | +----+ | | | | + | | | | | | | | | | d + | +----+ +----+ +----+p p+----+ +----+ +----+ | r + | | | | | | |o o| | | | | | | i + | | f3 | | f2 | | f0 |r CPSW r| f3 | | f2 | | f0 | | v + | |tc0 | |tc1 | |tc2 |t t|tc0 | |tc1 | |tc2 | | e + | \CBS / \CBS / \CBS /1 2\CBS / \CBS / \CBS / | r + | \S / \S / \ / \S / \S / \ / | + | \/ \/ \/ \/ \/ \/ | + +------------------------------------------------------------------+ + ========================================Eth==========================> + +1) :: + + // Add 8 tx queues, for interface Eth0, but they are common, so are accessed + // by two interfaces Eth0 and Eth1. + $ ethtool -L eth1 rx 1 tx 8 + rx unmodified, ignoring + +2) :: + + // Check if num of queues is set correctly: + $ ethtool -l eth0 + Channel parameters for eth0: + Pre-set maximums: + RX: 8 + TX: 8 + Other: 0 + Combined: 0 + Current hardware settings: + RX: 1 + TX: 8 + Other: 0 + Combined: 0 + +3) :: + + // TX queues must be rated starting from 0, so set bws for tx0 and tx1 for Eth0 + // and for tx2 and tx3 for Eth1. That is, rates 40 and 20 Mb/s appropriately + // for Eth0 and 30 and 10 Mb/s for Eth1. + // Real speed can differ a bit due to discreetness + // Leave last 4 tx queues as not rated + $ echo 40 > /sys/class/net/eth0/queues/tx-0/tx_maxrate + $ echo 20 > /sys/class/net/eth0/queues/tx-1/tx_maxrate + $ echo 30 > /sys/class/net/eth1/queues/tx-2/tx_maxrate + $ echo 10 > /sys/class/net/eth1/queues/tx-3/tx_maxrate + +4) :: + + // Check maximum rate of tx (cpdma) queues: + $ cat /sys/class/net/eth0/queues/tx-*/tx_maxrate + 40 + 20 + 30 + 10 + 0 + 0 + 0 + 0 + +5) :: + + // Map skb->priority to traffic class for Eth0: + // 3pri -> tc0, 2pri -> tc1, (0,1,4-7)pri -> tc2 + // Map traffic class to transmit queue: + // tc0 -> txq0, tc1 -> txq1, tc2 -> (txq4, txq5) + $ tc 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@4 hw 1 + +6) :: + + // Check classes settings + $ tc -g class show dev eth0 + +---(100:ffe2) mqprio + | +---(100:5) mqprio + | +---(100:6) mqprio + | + +---(100:ffe1) mqprio + | +---(100:2) mqprio + | + +---(100:ffe0) mqprio + +---(100:1) mqprio + +7) :: + + // Set rate for class A - 41 Mbit (tc0, txq0) using CBS Qdisc for Eth0 + // here only idle slope is important, others ignored + // Real speed can differ a bit due to discreetness + $ tc qdisc add dev eth0 parent 100:1 cbs locredit -1470 \ + hicredit 62 sendslope -959000 idleslope 41000 offload 1 + net eth0: set FIFO3 bw = 50 + +8) :: + + // Set rate for class B - 21 Mbit (tc1, txq1) using CBS Qdisc for Eth0 + $ tc qdisc add dev eth0 parent 100:2 cbs locredit -1470 \ + hicredit 65 sendslope -979000 idleslope 21000 offload 1 + net eth0: set FIFO2 bw = 30 + +9) :: + + // Create vlan 100 to map sk->priority to vlan qos for Eth0 + $ ip link add link eth0 name eth0.100 type vlan id 100 + net eth0: Adding vlanid 100 to vlan filter + +10) :: + + // Map skb->priority to L2 prio for Eth0.100, one to one + $ ip link set eth0.100 type vlan \ + egress 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7 + +11) :: + + // Check egress map for vlan 100 + $ cat /proc/net/vlan/eth0.100 + [...] + INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0 + EGRESS priority mappings: 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7 + +12) :: + + // Map skb->priority to traffic class for Eth1: + // 3pri -> tc0, 2pri -> tc1, (0,1,4-7)pri -> tc2 + // Map traffic class to transmit queue: + // tc0 -> txq2, tc1 -> txq3, tc2 -> (txq6, txq7) + $ tc qdisc replace dev eth1 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@2 1@3 2@6 hw 1 + +13) :: + + // Check classes settings + $ tc -g class show dev eth1 + +---(100:ffe2) mqprio + | +---(100:7) mqprio + | +---(100:8) mqprio + | + +---(100:ffe1) mqprio + | +---(100:4) mqprio + | + +---(100:ffe0) mqprio + +---(100:3) mqprio + +14) :: + + // Set rate for class A - 31 Mbit (tc0, txq2) using CBS Qdisc for Eth1 + // here only idle slope is important, others ignored, but calculated + // for interface speed - 100Mb for eth1 port. + // Set it +1 Mb for reserve (important!) + $ tc qdisc add dev eth1 parent 100:3 cbs locredit -1035 \ + hicredit 465 sendslope -69000 idleslope 31000 offload 1 + net eth1: set FIFO3 bw = 31 + +15) :: + + // Set rate for class B - 11 Mbit (tc1, txq3) using CBS Qdisc for Eth1 + // Set it +1 Mb for reserve (important!) + $ tc qdisc add dev eth1 parent 100:4 cbs locredit -1335 \ + hicredit 405 sendslope -89000 idleslope 11000 offload 1 + net eth1: set FIFO2 bw = 11 + +16) :: + + // Create vlan 100 to map sk->priority to vlan qos for Eth1 + $ ip link add link eth1 name eth1.100 type vlan id 100 + net eth1: Adding vlanid 100 to vlan filter + +17) :: + + // Map skb->priority to L2 prio for Eth1.100, one to one + $ ip link set eth1.100 type vlan \ + egress 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7 + +18) :: + + // Check egress map for vlan 100 + $ cat /proc/net/vlan/eth1.100 + [...] + INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0 + EGRESS priority mappings: 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7 + +19) :: + + // Run appropriate tools with socket option "SO_PRIORITY" to 3 + // for class A and to 2 for class B. For both interfaces + ./tsn_talker -d 18:03:73:66:87:42 -i eth0.100 -p2 -s 1500& + ./tsn_talker -d 18:03:73:66:87:42 -i eth0.100 -p3 -s 1500& + ./tsn_talker -d 20:cf:30:85:7d:fd -i eth1.100 -p2 -s 1500& + ./tsn_talker -d 20:cf:30:85:7d:fd -i eth1.100 -p3 -s 1500& + +20) :: + + // run your listener on workstation (should be in same vlan) + // (I took at https://www.spinics.net/lists/netdev/msg460869.html) + ./tsn_listener -d 18:03:73:66:87:42 -i enp5s0 -s 1500 + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39012 kbps + Receiving data rate: 39000 kbps + +21) :: + + // Restore default configuration if needed + $ ip link del eth1.100 + $ ip link del eth0.100 + $ tc qdisc del dev eth1 root + net eth1: Prev FIFO2 is shaped + net eth1: set FIFO3 bw = 0 + net eth1: set FIFO2 bw = 0 + $ tc qdisc del dev eth0 root + net eth0: Prev FIFO2 is shaped + net eth0: set FIFO3 bw = 0 + net eth0: set FIFO2 bw = 0 + $ ethtool -L eth0 rx 1 tx 1 diff --git a/Documentation/networking/device_drivers/ti/cpsw.txt b/Documentation/networking/device_drivers/ti/cpsw.txt deleted file mode 100644 index d4d4c0751a09..000000000000 --- a/Documentation/networking/device_drivers/ti/cpsw.txt +++ /dev/null @@ -1,541 +0,0 @@ -* Texas Instruments CPSW ethernet driver - -Multiqueue & CBS & MQPRIO -===================================================================== -===================================================================== - -The cpsw has 3 CBS shapers for each external ports. This document -describes MQPRIO and CBS Qdisc offload configuration for cpsw driver -based on examples. It potentially can be used in audio video bridging -(AVB) and time sensitive networking (TSN). - -The following examples were tested on AM572x EVM and BBB boards. - -Test setup -========== - -Under consideration two examples with AM572x EVM running cpsw driver -in dual_emac mode. - -Several prerequisites: -- TX queues must be rated starting from txq0 that has highest priority -- Traffic classes are used starting from 0, that has highest priority -- CBS shapers should be used with rated queues -- The bandwidth for CBS shapers has to be set a little bit more then - potential incoming rate, thus, rate of all incoming tx queues has - to be a little less -- Real rates can differ, due to discreetness -- Map skb-priority to txq is not enough, also skb-priority to l2 prio - map has to be created with ip or vconfig tool -- Any l2/socket prio (0 - 7) for classes can be used, but for - simplicity default values are used: 3 and 2 -- only 2 classes tested: A and B, but checked and can work with more, - maximum allowed 4, but only for 3 rate can be set. - -Test setup for examples -======================= - +-------------------------------+ - |--+ | - | | Workstation0 | - |E | MAC 18:03:73:66:87:42 | -+-----------------------------+ +--|t | | -| | 1 | E | | |h |./tsn_listener -d \ | -| Target board: | 0 | t |--+ |0 | 18:03:73:66:87:42 -i eth0 \| -| AM572x EVM | 0 | h | | | -s 1500 | -| | 0 | 0 | |--+ | -| Only 2 classes: |Mb +---| +-------------------------------+ -| class A, class B | | -| | +---| +-------------------------------+ -| | 1 | E | |--+ | -| | 0 | t | | | Workstation1 | -| | 0 | h |--+ |E | MAC 20:cf:30:85:7d:fd | -| |Mb | 1 | +--|t | | -+-----------------------------+ |h |./tsn_listener -d \ | - |0 | 20:cf:30:85:7d:fd -i eth0 \| - | | -s 1500 | - |--+ | - +-------------------------------+ - -********************************************************************* -********************************************************************* -********************************************************************* -Example 1: One port tx AVB configuration scheme for target board ----------------------------------------------------------------------- -(prints and scheme for AM572x evm, applicable for single port boards) - -tc - traffic class -txq - transmit queue -p - priority -f - fifo (cpsw fifo) -S - shaper configured - -+------------------------------------------------------------------+ u -| +---------------+ +---------------+ +------+ +------+ | s -| | | | | | | | | | e -| | App 1 | | App 2 | | Apps | | Apps | | r -| | Class A | | Class B | | Rest | | Rest | | -| | Eth0 | | Eth0 | | Eth0 | | Eth1 | | s -| | VLAN100 | | VLAN100 | | | | | | | | p -| | 40 Mb/s | | 20 Mb/s | | | | | | | | a -| | SO_PRIORITY=3 | | SO_PRIORITY=2 | | | | | | | | c -| | | | | | | | | | | | | | e -| +---|-----------+ +---|-----------+ +---|--+ +---|--+ | -+-----|------------------|------------------|--------|-------------+ - +-+ +------------+ | | - | | +-----------------+ +--+ - | | | | -+---|-------|-------------|-----------------------|----------------+ -| +----+ +----+ +----+ +----+ +----+ | -| | p3 | | p2 | | p1 | | p0 | | p0 | | k -| \ / \ / \ / \ / \ / | e -| \ / \ / \ / \ / \ / | r -| \/ \/ \/ \/ \/ | n -| | | | | | e -| | | +-----+ | | l -| | | | | | -| +----+ +----+ +----+ +----+ | s -| |tc0 | |tc1 | |tc2 | |tc0 | | p -| \ / \ / \ / \ / | a -| \ / \ / \ / \ / | c -| \/ \/ \/ \/ | e -| | | +-----+ | | -| | | | | | | -| | | | | | | -| | | | | | | -| +----+ +----+ +----+ +----+ +----+ | -| |txq0| |txq1| |txq2| |txq3| |txq4| | -| \ / \ / \ / \ / \ / | -| \ / \ / \ / \ / \ / | -| \/ \/ \/ \/ \/ | -| +-|------|------|------|--+ +--|--------------+ | -| | | | | | | Eth0.100 | | Eth1 | | -+---|------|------|------|------------------------|----------------+ - | | | | | - p p p p | - 3 2 0-1, 4-7 <- L2 priority | - | | | | | - | | | | | -+---|------|------|------|------------------------|----------------+ -| | | | | |----------+ | -| +----+ +----+ +----+ +----+ +----+ | -| |dma7| |dma6| |dma5| |dma4| |dma3| | -| \ / \ / \ / \ / \ / | c -| \S / \S / \ / \ / \ / | p -| \/ \/ \/ \/ \/ | s -| | | | +----- | | w -| | | | | | | -| | | | | | | d -| +----+ +----+ +----+p p+----+ | r -| | | | | | |o o| | | i -| | f3 | | f2 | | f0 |r r| f0 | | v -| |tc0 | |tc1 | |tc2 |t t|tc0 | | e -| \CBS / \CBS / \CBS /1 2\CBS / | r -| \S / \S / \ / \ / | -| \/ \/ \/ \/ | -+------------------------------------------------------------------+ -========================================Eth==========================> - -1) -// Add 4 tx queues, for interface Eth0, and 1 tx queue for Eth1 -$ ethtool -L eth0 rx 1 tx 5 -rx unmodified, ignoring - -2) -// Check if num of queues is set correctly: -$ ethtool -l eth0 -Channel parameters for eth0: -Pre-set maximums: -RX: 8 -TX: 8 -Other: 0 -Combined: 0 -Current hardware settings: -RX: 1 -TX: 5 -Other: 0 -Combined: 0 - -3) -// TX queues must be rated starting from 0, so set bws for tx0 and tx1 -// Set rates 40 and 20 Mb/s appropriately. -// Pay attention, real speed can differ a bit due to discreetness. -// Leave last 2 tx queues not rated. -$ echo 40 > /sys/class/net/eth0/queues/tx-0/tx_maxrate -$ echo 20 > /sys/class/net/eth0/queues/tx-1/tx_maxrate - -4) -// Check maximum rate of tx (cpdma) queues: -$ cat /sys/class/net/eth0/queues/tx-*/tx_maxrate -40 -20 -0 -0 -0 - -5) -// Map skb->priority to traffic class: -// 3pri -> tc0, 2pri -> tc1, (0,1,4-7)pri -> tc2 -// Map traffic class to transmit queue: -// tc0 -> txq0, tc1 -> txq1, tc2 -> (txq2, txq3) -$ tc 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 - -5a) -// As two interface sharing same set of tx queues, assign all traffic -// coming to interface Eth1 to separate queue in order to not mix it -// with traffic from interface Eth0, so use separate txq to send -// packets to Eth1, so all prio -> tc0 and tc0 -> txq4 -// Here hw 0, so here still default configuration for eth1 in hw -$ tc qdisc replace dev eth1 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@4 hw 0 - -6) -// Check classes settings -$ 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 - -$ tc -g class show dev eth1 -+---(100:ffe0) mqprio - +---(100:5) mqprio - -7) -// Set rate for class A - 41 Mbit (tc0, txq0) using CBS Qdisc -// Set it +1 Mb for reserve (important!) -// here only idle slope is important, others arg are ignored -// Pay attention, real speed can differ a bit due to discreetness -$ tc qdisc add dev eth0 parent 100:1 cbs locredit -1438 \ -hicredit 62 sendslope -959000 idleslope 41000 offload 1 -net eth0: set FIFO3 bw = 50 - -8) -// Set rate for class B - 21 Mbit (tc1, txq1) using CBS Qdisc: -// Set it +1 Mb for reserve (important!) -$ tc qdisc add dev eth0 parent 100:2 cbs locredit -1468 \ -hicredit 65 sendslope -979000 idleslope 21000 offload 1 -net eth0: set FIFO2 bw = 30 - -9) -// Create vlan 100 to map sk->priority to vlan qos -$ ip link add link eth0 name eth0.100 type vlan id 100 -8021q: 802.1Q VLAN Support v1.8 -8021q: adding VLAN 0 to HW filter on device eth0 -8021q: adding VLAN 0 to HW filter on device eth1 -net eth0: Adding vlanid 100 to vlan filter - -10) -// Map skb->priority to L2 prio, 1 to 1 -$ ip link set eth0.100 type vlan \ -egress 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7 - -11) -// Check egress map for vlan 100 -$ cat /proc/net/vlan/eth0.100 -[...] -INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0 -EGRESS priority mappings: 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7 - -12) -// Run your appropriate tools with socket option "SO_PRIORITY" -// to 3 for class A and/or to 2 for class B -// (I took at https://www.spinics.net/lists/netdev/msg460869.html) -./tsn_talker -d 18:03:73:66:87:42 -i eth0.100 -p3 -s 1500& -./tsn_talker -d 18:03:73:66:87:42 -i eth0.100 -p2 -s 1500& - -13) -// run your listener on workstation (should be in same vlan) -// (I took at https://www.spinics.net/lists/netdev/msg460869.html) -./tsn_listener -d 18:03:73:66:87:42 -i enp5s0 -s 1500 -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39000 kbps - -14) -// Restore default configuration if needed -$ ip link del eth0.100 -$ tc qdisc del dev eth1 root -$ tc qdisc del dev eth0 root -net eth0: Prev FIFO2 is shaped -net eth0: set FIFO3 bw = 0 -net eth0: set FIFO2 bw = 0 -$ ethtool -L eth0 rx 1 tx 1 - -********************************************************************* -********************************************************************* -********************************************************************* -Example 2: Two port tx AVB configuration scheme for target board ----------------------------------------------------------------------- -(prints and scheme for AM572x evm, for dual emac boards only) - -+------------------------------------------------------------------+ u -| +----------+ +----------+ +------+ +----------+ +----------+ | s -| | | | | | | | | | | | e -| | App 1 | | App 2 | | Apps | | App 3 | | App 4 | | r -| | Class A | | Class B | | Rest | | Class B | | Class A | | -| | Eth0 | | Eth0 | | | | | Eth1 | | Eth1 | | s -| | VLAN100 | | VLAN100 | | | | | VLAN100 | | VLAN100 | | p -| | 40 Mb/s | | 20 Mb/s | | | | | 10 Mb/s | | 30 Mb/s | | a -| | SO_PRI=3 | | SO_PRI=2 | | | | | SO_PRI=3 | | SO_PRI=2 | | c -| | | | | | | | | | | | | | | | | e -| +---|------+ +---|------+ +---|--+ +---|------+ +---|------+ | -+-----|-------------|-------------|---------|-------------|--------+ - +-+ +-------+ | +----------+ +----+ - | | +-------+------+ | | - | | | | | | -+---|-------|-------------|--------------|-------------|-------|---+ -| +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ | -| | p3 | | p2 | | p1 | | p0 | | p0 | | p1 | | p2 | | p3 | | k -| \ / \ / \ / \ / \ / \ / \ / \ / | e -| \ / \ / \ / \ / \ / \ / \ / \ / | r -| \/ \/ \/ \/ \/ \/ \/ \/ | n -| | | | | | | | e -| | | +----+ +----+ | | | l -| | | | | | | | -| +----+ +----+ +----+ +----+ +----+ +----+ | s -| |tc0 | |tc1 | |tc2 | |tc2 | |tc1 | |tc0 | | p -| \ / \ / \ / \ / \ / \ / | a -| \ / \ / \ / \ / \ / \ / | c -| \/ \/ \/ \/ \/ \/ | e -| | | +-----+ +-----+ | | | -| | | | | | | | | | -| | | | | | | | | | -| | | | | E E | | | | | -| +----+ +----+ +----+ +----+ t t +----+ +----+ +----+ +----+ | -| |txq0| |txq1| |txq4| |txq5| h h |txq6| |txq7| |txq3| |txq2| | -| \ / \ / \ / \ / 0 1 \ / \ / \ / \ / | -| \ / \ / \ / \ / . . \ / \ / \ / \ / | -| \/ \/ \/ \/ 1 1 \/ \/ \/ \/ | -| +-|------|------|------|--+ 0 0 +-|------|------|------|--+ | -| | | | | | | 0 0 | | | | | | | -+---|------|------|------|---------------|------|------|------|----+ - | | | | | | | | - p p p p p p p p - 3 2 0-1, 4-7 <-L2 pri-> 0-1, 4-7 2 3 - | | | | | | | | - | | | | | | | | -+---|------|------|------|---------------|------|------|------|----+ -| | | | | | | | | | -| +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ | -| |dma7| |dma6| |dma3| |dma2| |dma1| |dma0| |dma4| |dma5| | -| \ / \ / \ / \ / \ / \ / \ / \ / | c -| \S / \S / \ / \ / \ / \ / \S / \S / | p -| \/ \/ \/ \/ \/ \/ \/ \/ | s -| | | | +----- | | | | | w -| | | | | +----+ | | | | -| | | | | | | | | | d -| +----+ +----+ +----+p p+----+ +----+ +----+ | r -| | | | | | |o o| | | | | | | i -| | f3 | | f2 | | f0 |r CPSW r| f3 | | f2 | | f0 | | v -| |tc0 | |tc1 | |tc2 |t t|tc0 | |tc1 | |tc2 | | e -| \CBS / \CBS / \CBS /1 2\CBS / \CBS / \CBS / | r -| \S / \S / \ / \S / \S / \ / | -| \/ \/ \/ \/ \/ \/ | -+------------------------------------------------------------------+ -========================================Eth==========================> - -1) -// Add 8 tx queues, for interface Eth0, but they are common, so are accessed -// by two interfaces Eth0 and Eth1. -$ ethtool -L eth1 rx 1 tx 8 -rx unmodified, ignoring - -2) -// Check if num of queues is set correctly: -$ ethtool -l eth0 -Channel parameters for eth0: -Pre-set maximums: -RX: 8 -TX: 8 -Other: 0 -Combined: 0 -Current hardware settings: -RX: 1 -TX: 8 -Other: 0 -Combined: 0 - -3) -// TX queues must be rated starting from 0, so set bws for tx0 and tx1 for Eth0 -// and for tx2 and tx3 for Eth1. That is, rates 40 and 20 Mb/s appropriately -// for Eth0 and 30 and 10 Mb/s for Eth1. -// Real speed can differ a bit due to discreetness -// Leave last 4 tx queues as not rated -$ echo 40 > /sys/class/net/eth0/queues/tx-0/tx_maxrate -$ echo 20 > /sys/class/net/eth0/queues/tx-1/tx_maxrate -$ echo 30 > /sys/class/net/eth1/queues/tx-2/tx_maxrate -$ echo 10 > /sys/class/net/eth1/queues/tx-3/tx_maxrate - -4) -// Check maximum rate of tx (cpdma) queues: -$ cat /sys/class/net/eth0/queues/tx-*/tx_maxrate -40 -20 -30 -10 -0 -0 -0 -0 - -5) -// Map skb->priority to traffic class for Eth0: -// 3pri -> tc0, 2pri -> tc1, (0,1,4-7)pri -> tc2 -// Map traffic class to transmit queue: -// tc0 -> txq0, tc1 -> txq1, tc2 -> (txq4, txq5) -$ tc 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@4 hw 1 - -6) -// Check classes settings -$ tc -g class show dev eth0 -+---(100:ffe2) mqprio -| +---(100:5) mqprio -| +---(100:6) mqprio -| -+---(100:ffe1) mqprio -| +---(100:2) mqprio -| -+---(100:ffe0) mqprio - +---(100:1) mqprio - -7) -// Set rate for class A - 41 Mbit (tc0, txq0) using CBS Qdisc for Eth0 -// here only idle slope is important, others ignored -// Real speed can differ a bit due to discreetness -$ tc qdisc add dev eth0 parent 100:1 cbs locredit -1470 \ -hicredit 62 sendslope -959000 idleslope 41000 offload 1 -net eth0: set FIFO3 bw = 50 - -8) -// Set rate for class B - 21 Mbit (tc1, txq1) using CBS Qdisc for Eth0 -$ tc qdisc add dev eth0 parent 100:2 cbs locredit -1470 \ -hicredit 65 sendslope -979000 idleslope 21000 offload 1 -net eth0: set FIFO2 bw = 30 - -9) -// Create vlan 100 to map sk->priority to vlan qos for Eth0 -$ ip link add link eth0 name eth0.100 type vlan id 100 -net eth0: Adding vlanid 100 to vlan filter - -10) -// Map skb->priority to L2 prio for Eth0.100, one to one -$ ip link set eth0.100 type vlan \ -egress 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7 - -11) -// Check egress map for vlan 100 -$ cat /proc/net/vlan/eth0.100 -[...] -INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0 -EGRESS priority mappings: 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7 - -12) -// Map skb->priority to traffic class for Eth1: -// 3pri -> tc0, 2pri -> tc1, (0,1,4-7)pri -> tc2 -// Map traffic class to transmit queue: -// tc0 -> txq2, tc1 -> txq3, tc2 -> (txq6, txq7) -$ tc qdisc replace dev eth1 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@2 1@3 2@6 hw 1 - -13) -// Check classes settings -$ tc -g class show dev eth1 -+---(100:ffe2) mqprio -| +---(100:7) mqprio -| +---(100:8) mqprio -| -+---(100:ffe1) mqprio -| +---(100:4) mqprio -| -+---(100:ffe0) mqprio - +---(100:3) mqprio - -14) -// Set rate for class A - 31 Mbit (tc0, txq2) using CBS Qdisc for Eth1 -// here only idle slope is important, others ignored, but calculated -// for interface speed - 100Mb for eth1 port. -// Set it +1 Mb for reserve (important!) -$ tc qdisc add dev eth1 parent 100:3 cbs locredit -1035 \ -hicredit 465 sendslope -69000 idleslope 31000 offload 1 -net eth1: set FIFO3 bw = 31 - -15) -// Set rate for class B - 11 Mbit (tc1, txq3) using CBS Qdisc for Eth1 -// Set it +1 Mb for reserve (important!) -$ tc qdisc add dev eth1 parent 100:4 cbs locredit -1335 \ -hicredit 405 sendslope -89000 idleslope 11000 offload 1 -net eth1: set FIFO2 bw = 11 - -16) -// Create vlan 100 to map sk->priority to vlan qos for Eth1 -$ ip link add link eth1 name eth1.100 type vlan id 100 -net eth1: Adding vlanid 100 to vlan filter - -17) -// Map skb->priority to L2 prio for Eth1.100, one to one -$ ip link set eth1.100 type vlan \ -egress 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7 - -18) -// Check egress map for vlan 100 -$ cat /proc/net/vlan/eth1.100 -[...] -INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0 -EGRESS priority mappings: 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7 - -19) -// Run appropriate tools with socket option "SO_PRIORITY" to 3 -// for class A and to 2 for class B. For both interfaces -./tsn_talker -d 18:03:73:66:87:42 -i eth0.100 -p2 -s 1500& -./tsn_talker -d 18:03:73:66:87:42 -i eth0.100 -p3 -s 1500& -./tsn_talker -d 20:cf:30:85:7d:fd -i eth1.100 -p2 -s 1500& -./tsn_talker -d 20:cf:30:85:7d:fd -i eth1.100 -p3 -s 1500& - -20) -// run your listener on workstation (should be in same vlan) -// (I took at https://www.spinics.net/lists/netdev/msg460869.html) -./tsn_listener -d 18:03:73:66:87:42 -i enp5s0 -s 1500 -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39012 kbps -Receiving data rate: 39000 kbps - -21) -// Restore default configuration if needed -$ ip link del eth1.100 -$ ip link del eth0.100 -$ tc qdisc del dev eth1 root -net eth1: Prev FIFO2 is shaped -net eth1: set FIFO3 bw = 0 -net eth1: set FIFO2 bw = 0 -$ tc qdisc del dev eth0 root -net eth0: Prev FIFO2 is shaped -net eth0: set FIFO3 bw = 0 -net eth0: set FIFO2 bw = 0 -$ ethtool -L eth0 rx 1 tx 1 diff --git a/Documentation/networking/device_drivers/ti/cpsw_switchdev.txt b/Documentation/networking/device_drivers/ti/cpsw_switchdev.rst index 12855ab268b8..1241ecac73bd 100644 --- a/Documentation/networking/device_drivers/ti/cpsw_switchdev.txt +++ b/Documentation/networking/device_drivers/ti/cpsw_switchdev.rst @@ -1,30 +1,44 @@ -* Texas Instruments CPSW switchdev based ethernet driver 2.0 +.. SPDX-License-Identifier: GPL-2.0 + +====================================================== +Texas Instruments CPSW switchdev based ethernet driver +====================================================== + +:Version: 2.0 + +Port renaming +============= -- Port renaming On older udev versions renaming of ethX to swXpY will not be automatically supported -In order to rename via udev: -ip -d link show dev sw0p1 | grep switchid -SUBSYSTEM=="net", ACTION=="add", ATTR{phys_switch_id}==<switchid>, \ - ATTR{phys_port_name}!="", NAME="sw0$attr{phys_port_name}" +In order to rename via udev:: + + ip -d link show dev sw0p1 | grep switchid + + SUBSYSTEM=="net", ACTION=="add", ATTR{phys_switch_id}==<switchid>, \ + ATTR{phys_port_name}!="", NAME="sw0$attr{phys_port_name}" + +Dual mac mode +============= -==================== -# Dual mac mode -==================== - The new (cpsw_new.c) driver is operating in dual-emac mode by default, thus -working as 2 individual network interfaces. Main differences from legacy CPSW -driver are: + working as 2 individual network interfaces. Main differences from legacy CPSW + driver are: + - optimized promiscuous mode: The P0_UNI_FLOOD (both ports) is enabled in -addition to ALLMULTI (current port) instead of ALE_BYPASS. -So, Ports in promiscuous mode will keep possibility of mcast and vlan filtering, -which is provides significant benefits when ports are joined to the same bridge, -but without enabling "switch" mode, or to different bridges. + addition to ALLMULTI (current port) instead of ALE_BYPASS. + So, Ports in promiscuous mode will keep possibility of mcast and vlan + filtering, which is provides significant benefits when ports are joined + to the same bridge, but without enabling "switch" mode, or to different + bridges. - learning disabled on ports as it make not too much sense for segregated ports - no forwarding in HW. - enabled basic support for devlink. + :: + devlink dev show platform/48484000.switch @@ -38,22 +52,25 @@ but without enabling "switch" mode, or to different bridges. cmode runtime value false Devlink configuration parameters -==================== +================================ + See Documentation/networking/devlink/ti-cpsw-switch.rst -==================== -# Bridging in dual mac mode -==================== +Bridging in dual mac mode +========================= + The dual_mac mode requires two vids to be reserved for internal purposes, which, by default, equal CPSW Port numbers. As result, bridge has to be -configured in vlan unaware mode or default_pvid has to be adjusted. +configured in vlan unaware mode or default_pvid has to be adjusted:: ip link add name br0 type bridge ip link set dev br0 type bridge vlan_filtering 0 echo 0 > /sys/class/net/br0/bridge/default_pvid ip link set dev sw0p1 master br0 ip link set dev sw0p2 master br0 - - or - + +or:: + ip link add name br0 type bridge ip link set dev br0 type bridge vlan_filtering 0 echo 100 > /sys/class/net/br0/bridge/default_pvid @@ -61,11 +78,12 @@ configured in vlan unaware mode or default_pvid has to be adjusted. ip link set dev sw0p1 master br0 ip link set dev sw0p2 master br0 -==================== -# Enabling "switch" -==================== +Enabling "switch" +================= + The Switch mode can be enabled by configuring devlink driver parameter -"switch_mode" to 1/true: +"switch_mode" to 1/true:: + devlink dev param set platform/48484000.switch \ name switch_mode value 1 cmode runtime @@ -79,9 +97,11 @@ marking packets with offload_fwd_mark flag unless "ale_bypass=0" All configuration is implemented via switchdev API. -==================== -# Bridge setup -==================== +Bridge setup +============ + +:: + devlink dev param set platform/48484000.switch \ name switch_mode value 1 cmode runtime @@ -91,56 +111,65 @@ All configuration is implemented via switchdev API. ip link set dev sw0p2 up ip link set dev sw0p1 master br0 ip link set dev sw0p2 master br0 + [*] bridge vlan add dev br0 vid 1 pvid untagged self -[*] if vlan_filtering=1. where default_pvid=1 + [*] if vlan_filtering=1. where default_pvid=1 -================= -# On/off STP -================= -ip link set dev BRDEV type bridge stp_state 1/0 + Note. Steps [*] are mandatory. + + +On/off STP +========== -Note. Steps [*] are mandatory. +:: -==================== -# VLAN configuration -==================== -bridge vlan add dev br0 vid 1 pvid untagged self <---- add cpu port to VLAN 1 + ip link set dev BRDEV type bridge stp_state 1/0 + +VLAN configuration +================== + +:: + + bridge vlan add dev br0 vid 1 pvid untagged self <---- add cpu port to VLAN 1 Note. This step is mandatory for bridge/default_pvid. -================= -# Add extra VLANs -================= - 1. untagged: - bridge vlan add dev sw0p1 vid 100 pvid untagged master - bridge vlan add dev sw0p2 vid 100 pvid untagged master - bridge vlan add dev br0 vid 100 pvid untagged self <---- Add cpu port to VLAN100 +Add extra VLANs +=============== - 2. tagged: - bridge vlan add dev sw0p1 vid 100 master - bridge vlan add dev sw0p2 vid 100 master - bridge vlan add dev br0 vid 100 pvid tagged self <---- Add cpu port to VLAN100 + 1. untagged:: + + bridge vlan add dev sw0p1 vid 100 pvid untagged master + bridge vlan add dev sw0p2 vid 100 pvid untagged master + bridge vlan add dev br0 vid 100 pvid untagged self <---- Add cpu port to VLAN100 + + 2. tagged:: + + bridge vlan add dev sw0p1 vid 100 master + bridge vlan add dev sw0p2 vid 100 master + bridge vlan add dev br0 vid 100 pvid tagged self <---- Add cpu port to VLAN100 -==== FDBs -==== +---- + FDBs are automatically added on the appropriate switch port upon detection -Manually adding FDBs: -bridge fdb add aa:bb:cc:dd:ee:ff dev sw0p1 master vlan 100 -bridge fdb add aa:bb:cc:dd:ee:fe dev sw0p2 master <---- Add on all VLANs +Manually adding FDBs:: + + bridge fdb add aa:bb:cc:dd:ee:ff dev sw0p1 master vlan 100 + bridge fdb add aa:bb:cc:dd:ee:fe dev sw0p2 master <---- Add on all VLANs -==== MDBs -==== +---- + MDBs are automatically added on the appropriate switch port upon detection -Manually adding MDBs: -bridge mdb add dev br0 port sw0p1 grp 239.1.1.1 permanent vid 100 -bridge mdb add dev br0 port sw0p1 grp 239.1.1.1 permanent <---- Add on all VLANs +Manually adding MDBs:: + + bridge mdb add dev br0 port sw0p1 grp 239.1.1.1 permanent vid 100 + bridge mdb add dev br0 port sw0p1 grp 239.1.1.1 permanent <---- Add on all VLANs -================== Multicast flooding ================== CPU port mcast_flooding is always on @@ -148,9 +177,11 @@ CPU port mcast_flooding is always on Turning flooding on/off on swithch ports: bridge link set dev sw0p1 mcast_flood on/off -================== Access and Trunk port -================== +===================== + +:: + bridge vlan add dev sw0p1 vid 100 pvid untagged master bridge vlan add dev sw0p2 vid 100 master @@ -158,52 +189,54 @@ Access and Trunk port bridge vlan add dev br0 vid 100 self ip link add link br0 name br0.100 type vlan id 100 - Note. Setting PVID on Bridge device itself working only for - default VLAN (default_pvid). +Note. Setting PVID on Bridge device itself working only for +default VLAN (default_pvid). + +NFS +=== -===================== - NFS -===================== The only way for NFS to work is by chrooting to a minimal environment when switch configuration that will affect connectivity is needed. Assuming you are booting NFS with eth1 interface(the script is hacky and it's just there to prove NFS is doable). -setup.sh: -#!/bin/sh -mkdir proc -mount -t proc none /proc -ifconfig br0 > /dev/null -if [ $? -ne 0 ]; then - echo "Setting up bridge" - ip link add name br0 type bridge - ip link set dev br0 type bridge ageing_time 1000 - ip link set dev br0 type bridge vlan_filtering 1 - - ip link set eth1 down - ip link set eth1 name sw0p1 - ip link set dev sw0p1 up - ip link set dev sw0p2 up - ip link set dev sw0p2 master br0 - ip link set dev sw0p1 master br0 - bridge vlan add dev br0 vid 1 pvid untagged self - ifconfig sw0p1 0.0.0.0 - udhchc -i br0 -fi -umount /proc - -run_nfs.sh: -#!/bin/sh -mkdir /tmp/root/bin -p -mkdir /tmp/root/lib -p - -cp -r /lib/ /tmp/root/ -cp -r /bin/ /tmp/root/ -cp /sbin/ip /tmp/root/bin -cp /sbin/bridge /tmp/root/bin -cp /sbin/ifconfig /tmp/root/bin -cp /sbin/udhcpc /tmp/root/bin -cp /path/to/setup.sh /tmp/root/bin -chroot /tmp/root/ busybox sh /bin/setup.sh - -run ./run_nfs.sh +setup.sh:: + + #!/bin/sh + mkdir proc + mount -t proc none /proc + ifconfig br0 > /dev/null + if [ $? -ne 0 ]; then + echo "Setting up bridge" + ip link add name br0 type bridge + ip link set dev br0 type bridge ageing_time 1000 + ip link set dev br0 type bridge vlan_filtering 1 + + ip link set eth1 down + ip link set eth1 name sw0p1 + ip link set dev sw0p1 up + ip link set dev sw0p2 up + ip link set dev sw0p2 master br0 + ip link set dev sw0p1 master br0 + bridge vlan add dev br0 vid 1 pvid untagged self + ifconfig sw0p1 0.0.0.0 + udhchc -i br0 + fi + umount /proc + +run_nfs.sh::: + + #!/bin/sh + mkdir /tmp/root/bin -p + mkdir /tmp/root/lib -p + + cp -r /lib/ /tmp/root/ + cp -r /bin/ /tmp/root/ + cp /sbin/ip /tmp/root/bin + cp /sbin/bridge /tmp/root/bin + cp /sbin/ifconfig /tmp/root/bin + cp /sbin/udhcpc /tmp/root/bin + cp /path/to/setup.sh /tmp/root/bin + chroot /tmp/root/ busybox sh /bin/setup.sh + + run ./run_nfs.sh diff --git a/Documentation/networking/device_drivers/ti/tlan.txt b/Documentation/networking/device_drivers/ti/tlan.rst index 34550dfcef74..4fdc0907f4fc 100644 --- a/Documentation/networking/device_drivers/ti/tlan.txt +++ b/Documentation/networking/device_drivers/ti/tlan.rst @@ -1,20 +1,33 @@ +.. SPDX-License-Identifier: GPL-2.0 + +===================== +TLAN driver for Linux +===================== + +:Version: 1.14a + (C) 1997-1998 Caldera, Inc. + (C) 1998 James Banks + (C) 1999-2001 Torben Mathiasen <tmm@image.dk, torben.mathiasen@compaq.com> For driver information/updates visit http://www.compaq.com -TLAN driver for Linux, version 1.14a -README -I. Supported Devices. + +I. Supported Devices +==================== Only PCI devices will work with this driver. Supported: + + ========= ========= =========================================== Vendor ID Device ID Name + ========= ========= =========================================== 0e11 ae32 Compaq Netelligent 10/100 TX PCI UTP 0e11 ae34 Compaq Netelligent 10 T PCI UTP 0e11 ae35 Compaq Integrated NetFlex 3/P @@ -25,13 +38,14 @@ I. Supported Devices. 0e11 b030 Compaq Netelligent 10/100 TX UTP 0e11 f130 Compaq NetFlex 3/P 0e11 f150 Compaq NetFlex 3/P - 108d 0012 Olicom OC-2325 + 108d 0012 Olicom OC-2325 108d 0013 Olicom OC-2183 - 108d 0014 Olicom OC-2326 + 108d 0014 Olicom OC-2326 + ========= ========= =========================================== Caveats: - + I am not sure if 100BaseTX daughterboards (for those cards which support such things) will work. I haven't had any solid evidence either way. @@ -41,21 +55,25 @@ I. Supported Devices. The "Netelligent 10 T/2 PCI UTP/Coax" (b012) device is untested, but I do not expect any problems. - -II. Driver Options + +II. Driver Options +================== + 1. You can append debug=x to the end of the insmod line to get - debug messages, where x is a bit field where the bits mean + debug messages, where x is a bit field where the bits mean the following: - + + ==== ===================================== 0x01 Turn on general debugging messages. 0x02 Turn on receive debugging messages. 0x04 Turn on transmit debugging messages. 0x08 Turn on list debugging messages. + ==== ===================================== 2. You can append aui=1 to the end of the insmod line to cause - the adapter to use the AUI interface instead of the 10 Base T - interface. This is also what to do if you want to use the BNC + the adapter to use the AUI interface instead of the 10 Base T + interface. This is also what to do if you want to use the BNC connector on a TLAN based device. (Setting this option on a device that does not have an AUI/BNC connector will probably cause it to not function correctly.) @@ -70,41 +88,45 @@ II. Driver Options 5. You have to use speed=X duplex=Y together now. If you just do "insmod tlan.o speed=100" the driver will do Auto-Neg. - To force a 10Mbps Half-Duplex link do "insmod tlan.o speed=10 + To force a 10Mbps Half-Duplex link do "insmod tlan.o speed=10 duplex=1". 6. If the driver is built into the kernel, you can use the 3rd and 4th parameters to set aui and debug respectively. For - example: + example:: - ether=0,0,0x1,0x7,eth0 + ether=0,0,0x1,0x7,eth0 This sets aui to 0x1 and debug to 0x7, assuming eth0 is a supported TLAN device. The bits in the third byte are assigned as follows: - 0x01 = aui - 0x02 = use half duplex - 0x04 = use full duplex - 0x08 = use 10BaseT - 0x10 = use 100BaseTx + ==== =============== + 0x01 aui + 0x02 use half duplex + 0x04 use full duplex + 0x08 use 10BaseT + 0x10 use 100BaseTx + ==== =============== You also need to set both speed and duplex settings when forcing - speeds with kernel-parameters. + speeds with kernel-parameters. ether=0,0,0x12,0,eth0 will force link to 100Mbps Half-Duplex. 7. If you have more than one tlan adapter in your system, you can use the above options on a per adapter basis. To force a 100Mbit/HD - link with your eth1 adapter use: - - insmod tlan speed=0,100 duplex=0,1 + link with your eth1 adapter use:: + + insmod tlan speed=0,100 duplex=0,1 Now eth0 will use auto-neg and eth1 will be forced to 100Mbit/HD. Note that the tlan driver supports a maximum of 8 adapters. -III. Things to try if you have problems. +III. Things to try if you have problems +======================================= + 1. Make sure your card's PCI id is among those listed in section I, above. 2. Make sure routing is correct. @@ -113,5 +135,6 @@ III. Things to try if you have problems. There is also a tlan mailing list which you can join by sending "subscribe tlan" in the body of an email to majordomo@vuser.vu.union.edu. + There is also a tlan website at http://www.compaq.com |