~ [ 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 ] ~

Diff markup

Differences between /tools/testing/selftests/drivers/net/netdevsim/tc-mq-visibility.sh (Architecture i386) and /tools/testing/selftests/drivers/net/netdevsim/tc-mq-visibility.sh (Architecture m68k)


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