| 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 Strict Priority. |
| 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 mqprio 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 | hw 0 |
| 42 | |
| 43 | # |
| 44 | # Rx Queues Assignment. |
| 45 | # |
| 46 | # Rx Q 0 - RTC |
| 47 | # Rx Q 1 - RTA |
| 48 | # Rx Q 2 - DCP, LLDP, UDP High |
| 49 | # Rx Q 3 - Everything else |
| 50 | # |
| 51 | RXQUEUES=(2 2 2 0 1 2 2 3 2 2) |
| 52 | igc_rx_queues_assign "${INTERFACE}" RXQUEUES |
| 53 | |
| 54 | igc_end "${INTERFACE}" |
| 55 | |
| 56 | setup_irqs "${INTERFACE}" |
| 57 | |
| 58 | exit 0 |