Lines Matching +full:rx +full:- +full:port +full:- +full:mapping

2 # SPDX-License-Identifier: GPL-2.0
4 # extended toeplitz test: test rxhash plus, optionally, either (1) rss mapping
5 # from rxhash to rx queue ('-rss') or (2) rps mapping from rxhash to cpu
6 # ('-rps <rps_map>')
8 # irq-pattern-prefix can be derived from /sys/kernel/irq/*/action,
9 # which is a driver-specific encoding.
11 # invoke as ./toeplitz.sh (-i <iface>) -u|-t -4|-6 \
12 # [(-rss -irq_prefix <irq-pattern-prefix>)|(-rps <rps_map>)]
23 PORT=8000
34 echo $(ethtool -x "${DEV}" |
35 grep -E [[:space:]]+[0-9]+:[[:space:]]+ |
36 cut -d: -f2- |
39 sort -u |
40 wc -l)
44 # The list is ordered by the irqs, so first rxq-0 cpu, then rxq-1 cpu, etc.
46 # irq_{rxq-0} < irq_{rxq-1}, etc.
50 SORTED_IRQS=$(for i in /sys/kernel/irq/*; do echo $i; done | sort -V)
52 # if RSS_CFG_NUM_RXQS=N, then RSS uses rxqs 0-(N-1).
58 [[ "${RXQ_COUNT}" -lt "${RSS_CFG_NUM_RXQS}" ]] || break
60 [[ -e "$i/actions" ]] || continue
61 cat "$i/actions" | grep -q "${IRQ_PATTERN}" || continue
65 irqcount=$(cat "$i/per_cpu_count" | tr -d '0,')
66 [[ -n "${irqcount}" ]] || continue
72 if [[ -z "${CPUS}" ]]; then
89 for i in /sys/class/net/${DEV}/queues/rx-*/rps_cpus
107 local -r pattern="receive-hashing:\ on"
109 ethtool -k "${DEV}" | grep -q "${pattern}" || die "rxhash must be enabled"
116 while [[ "$1" =~ "-" ]]; do
117 if [[ "$1" = "-irq_prefix" ]]; then
119 IRQ_PATTERN="^$1-[0-9]*$"
120 elif [[ "$1" = "-u" || "$1" = "-t" ]]; then
122 elif [[ "$1" = "-4" ]]; then
126 elif [[ "$1" = "-6" ]]; then
130 elif [[ "$1" = "-rss" ]]; then
132 elif [[ "$1" = "-rps" ]]; then
135 elif [[ "$1" = "-i" ]]; then
139 die "Usage: ${prog} (-i <iface>) -u|-t -4|-6 \
140 [(-rss -irq_prefix <irq-pattern-prefix>)|(-rps <rps_map>)]"
174 -d "${PORT}" -i "${DEV}" -k "${KEY}" -T 1000 \
175 -C "$(get_rx_irq_cpus)" -s -v &
176 elif [[ ! -z "${RPS_MAP}" ]]; then
179 -d "${PORT}" -i "${DEV}" -k "${KEY}" -T 1000 \
180 -r "0x${RPS_MAP}" -s -v &
183 -d "${PORT}" -i "${DEV}" -k "${KEY}" -T 1000 -s -v &
189 "${IP_FLAG}" "${SERVER_IP%%/*}" "${PORT}" &
195 kill -9 "${client_pid}"
196 if [[ "${exit_code}" -eq 0 ]]; then