Debian Codegraph @

tests/profinet_rt/flow_cml.sh

raw symbols SCIP
1 #!/bin/bash
2 #
3 # Copyright (C) 2023 Linutronix GmbH
4 # Author Kurt Kanzenbach <[email protected]>
5 #
6 # SPDX-License-Identifier: BSD-2-Clause
7 #
8 # Setup the Tx and Rx traffic flows for Intel i225 for PROFINET RT scenario.
9 #
10
11 set -e
12
13 source ../lib/common.sh
14 source ../lib/igc.sh
15
16 #
17 # Command line arguments.
18 #
19 INTERFACE=$1
20
21 [ -z $INTERFACE ] && INTERFACE="enp3s0" # default: enp3s0
22 BASETIME=$(date '+%s000000000' -d '-30 sec') # default: now - 30s
23
24 load_kernel_modules
25
26 setup_threaded_napi "${INTERFACE}"
27
28 igc_start "${INTERFACE}"
29
30 #
31 # Tx Assignment with Qbv and full hardware offload.
32 #
33 # Tx Q 0 - RTC
34 # Tx Q 1 - RTA
35 # Tx Q 2 - DCP, LLDP, UDP High
36 # Tx Q 3 - Everything else
37 #
38 tc qdisc replace dev ${INTERFACE} handle 100 parent root taprio num_tc 4 \
39 map 3 3 3 3 3 2 1 0 3 3 3 3 3 3 3 3 \
40 queues 1@0 1@1 1@2 1@3 \
41 base-time ${BASETIME} \
42 sched-entry S 0x01 100000 \
43 sched-entry S 0x02 100000 \
44 sched-entry S 0x04 400000 \
45 sched-entry S 0x08 400000 \
46 flags 0x02
47
48 #
49 # Rx Queues Assignment.
50 #
51 # Rx Q 0 - RTC
52 # Rx Q 1 - RTA
53 # Rx Q 2 - DCP, LLDP, UDP High
54 # Rx Q 3 - Everything else
55 #
56 RXQUEUES=(2 2 2 0 1 2 2 3 2 2)
57 igc_rx_queues_assign "${INTERFACE}" RXQUEUES
58
59 igc_end "${INTERFACE}"
60
61 setup_irqs "${INTERFACE}"
62
63 exit 0