403Webshell
Server IP : 13.213.54.232  /  Your IP : 216.73.217.11
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux ip-172-31-17-110 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 7.1.33-67+ubuntu22.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/modules/6.8.0-1029-aws/build/tools/testing/selftests/drivers/net/netdevsim/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/modules/6.8.0-1029-aws/build/tools/testing/selftests/drivers/net/netdevsim/tc-mq-visibility.sh
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-only

source ethtool-common.sh

set -o pipefail

n_children() {
    n=$(tc qdisc show dev $NDEV | grep '^qdisc' | wc -l)
    echo $((n - 1))
}

tcq() {
    tc qdisc $1 dev $NDEV ${@:2}
}

n_child_assert() {
    n=$(n_children)
    if [ $n -ne $1 ]; then
	echo "ERROR ($root): ${@:2}, expected $1 have $n"
	((num_errors++))
    else
	((num_passes++))
    fi
}


for root in mq mqprio; do
    NDEV=$(make_netdev 1 4)

    opts=
    [ $root == "mqprio" ] && opts='hw 0 num_tc 1 map 0 0 0 0  queues 1@0'

    tcq add root handle 100: $root $opts
    n_child_assert 4 'Init'

    # All defaults

    for n in 3 2 1 2 3 4 1 4; do
	ethtool -L $NDEV combined $n
	n_child_assert $n "Change queues to $n while down"
    done

    ip link set dev $NDEV up

    for n in 3 2 1 2 3 4 1 4; do
	ethtool -L $NDEV combined $n
	n_child_assert $n "Change queues to $n while up"
    done

    # One real one
    tcq replace parent 100:4 handle 204: pfifo_fast
    n_child_assert 4 "One real queue"

    ethtool -L $NDEV combined 1
    n_child_assert 2 "One real queue, one default"

    ethtool -L $NDEV combined 4
    n_child_assert 4 "One real queue, rest default"

    # Graft some
    tcq replace parent 100:1 handle 204:
    n_child_assert 3 "Grafted"

    ethtool -L $NDEV combined 1
    n_child_assert 1 "Grafted, one"

    cleanup_nsim
done

if [ $num_errors -eq 0 ]; then
    echo "PASSED all $((num_passes)) checks"
    exit 0
else
    echo "FAILED $num_errors/$((num_errors+num_passes)) checks"
    exit 1
fi

Youez - 2016 - github.com/yon3zu
LinuXploit