Debian Codegraph @

tests/busypolling_1ms_rtworkload/flow_cml.sh

raw symbols SCIP
1 #!/bin/bash
2 #
3 # Copyright (C) 2024 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 testing XDP busy polling.
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 CYCLETIME_NS=$2
21 BASETIME=$3
22
23 [ -z $INTERFACE ] && INTERFACE="enp3s0" # default: enp3s0
24 [ -z $CYCLETIME_NS ] && CYCLETIME_NS="1000000" # default: 125us
25 [ -z $BASETIME ] && BASETIME=$(date '+%s000000000' -d '-30 sec') # default: now - 30s
26
27 load_kernel_modules
28
29 napi_defer_hard_irqs "${INTERFACE}" "${CYCLETIME_NS}"
30
31 igc_start "${INTERFACE}"
32
33 #
34 # Split traffic between TSN streams, priority and everything else.
35 #
36 ENTRY1_NS="500000" # TSN Streams / Prio
37 ENTRY2_NS="500000" # Everything else
38
39 #
40 # Tx Assignment with Qbv and full hardware offload.
41 #
42 # PCP 6 - Tx Q 1 - TSN High
43 # PCP X - Tx Q 0 - Everything else
44 #
45 tc qdisc replace dev ${INTERFACE} handle 100 parent root taprio num_tc 2 \
46 map 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 \
47 queues 1@0 1@1 \
48 base-time ${BASETIME} \
49 sched-entry S 0x02 ${ENTRY1_NS} \
50 sched-entry S 0x03 ${ENTRY2_NS} \
51 flags 0x02
52
53 #
54 # Rx Queues Assignment.
55 #
56 # PCP 6 - Rx Q 1 - TSN High
57 # PCP X - Rx Q 0 - Everything else
58 #
59 RXQUEUES=(0 1 0 0 0 0 0 0 0 0)
60 igc_rx_queues_assign "${INTERFACE}" RXQUEUES
61
62 igc_end "${INTERFACE}"
63
64 setup_irqs "${INTERFACE}"
65
66 exit 0