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 :  /proc/246939/root/lib/modules/6.8.0-1029-aws/build/tools/testing/selftests/net/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/246939/root/lib/modules/6.8.0-1029-aws/build/tools/testing/selftests/net/fq_band_pktlimit.sh
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
#
# Verify that FQ has a packet limit per band:
#
# 1. set the limit to 10 per band
# 2. send 20 pkts on band A: verify that 10 are queued, 10 dropped
# 3. send 20 pkts on band A: verify that  0 are queued, 20 dropped
# 4. send 20 pkts on band B: verify that 10 are queued, 10 dropped
#
# Send packets with a 100ms delay to ensure that previously sent
# packets are still queued when later ones are sent.
# Use SO_TXTIME for this.

die() {
	echo "$1"
	exit 1
}

# run inside private netns
if [[ $# -eq 0 ]]; then
	./in_netns.sh "$0" __subprocess
	exit
fi

ip link add type dummy
ip link set dev dummy0 up
ip -6 addr add fdaa::1/128 dev dummy0
ip -6 route add fdaa::/64 dev dummy0
tc qdisc replace dev dummy0 root handle 1: fq quantum 1514 initial_quantum 1514 limit 10

./cmsg_sender -6 -p u -d 100000 -n 20 fdaa::2 8000
OUT1="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')"

./cmsg_sender -6 -p u -d 100000 -n 20 fdaa::2 8000
OUT2="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')"

./cmsg_sender -6 -p u -d 100000 -n 20 -P 7 fdaa::2 8000
OUT3="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')"

# Initial stats will report zero sent, as all packets are still
# queued in FQ. Sleep for the delay period (100ms) and see that
# twenty are now sent.
sleep 0.1
OUT4="$(tc -s qdisc show dev dummy0 | grep '^\ Sent')"

# Log the output after the test
echo "${OUT1}"
echo "${OUT2}"
echo "${OUT3}"
echo "${OUT4}"

# Test the output for expected values
echo "${OUT1}" | grep -q '0\ pkt\ (dropped\ 10'  || die "unexpected drop count at 1"
echo "${OUT2}" | grep -q '0\ pkt\ (dropped\ 30'  || die "unexpected drop count at 2"
echo "${OUT3}" | grep -q '0\ pkt\ (dropped\ 40'  || die "unexpected drop count at 3"
echo "${OUT4}" | grep -q '20\ pkt\ (dropped\ 40' || die "unexpected accept count at 4"

Youez - 2016 - github.com/yon3zu
LinuXploit