~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/drivers/net/netdevsim/tc-mq-visibility.sh

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #!/bin/bash
  2 # SPDX-License-Identifier: GPL-2.0-only
  3 
  4 source ethtool-common.sh
  5 
  6 set -o pipefail
  7 
  8 n_children() {
  9     n=$(tc qdisc show dev $NDEV | grep '^qdisc' | wc -l)
 10     echo $((n - 1))
 11 }
 12 
 13 tcq() {
 14     tc qdisc $1 dev $NDEV ${@:2}
 15 }
 16 
 17 n_child_assert() {
 18     n=$(n_children)
 19     if [ $n -ne $1 ]; then
 20         echo "ERROR ($root): ${@:2}, expected $1 have $n"
 21         ((num_errors++))
 22     else
 23         ((num_passes++))
 24     fi
 25 }
 26 
 27 
 28 for root in mq mqprio; do
 29     NDEV=$(make_netdev 1 4)
 30 
 31     opts=
 32     [ $root == "mqprio" ] && opts='hw 0 num_tc 1 map 0 0 0 0  queues 1@0'
 33 
 34     tcq add root handle 100: $root $opts
 35     n_child_assert 4 'Init'
 36 
 37     # All defaults
 38 
 39     for n in 3 2 1 2 3 4 1 4; do
 40         ethtool -L $NDEV combined $n
 41         n_child_assert $n "Change queues to $n while down"
 42     done
 43 
 44     ip link set dev $NDEV up
 45 
 46     for n in 3 2 1 2 3 4 1 4; do
 47         ethtool -L $NDEV combined $n
 48         n_child_assert $n "Change queues to $n while up"
 49     done
 50 
 51     # One real one
 52     tcq replace parent 100:4 handle 204: pfifo_fast
 53     n_child_assert 4 "One real queue"
 54 
 55     ethtool -L $NDEV combined 1
 56     n_child_assert 2 "One real queue, one default"
 57 
 58     ethtool -L $NDEV combined 4
 59     n_child_assert 4 "One real queue, rest default"
 60 
 61     # Graft some
 62     tcq replace parent 100:1 handle 204:
 63     n_child_assert 3 "Grafted"
 64 
 65     ethtool -L $NDEV combined 1
 66     n_child_assert 1 "Grafted, one"
 67 
 68     cleanup_nsim
 69 done
 70 
 71 if [ $num_errors -eq 0 ]; then
 72     echo "PASSED all $((num_passes)) checks"
 73     exit 0
 74 else
 75     echo "FAILED $num_errors/$((num_errors+num_passes)) checks"
 76     exit 1
 77 fi

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php