__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-only
source ethtool-common.sh
function get_value {
local query="${SETTINGS_MAP[$1]}"
echo $(ethtool -c $NSIM_NETDEV | \
awk -F':' -v pattern="$query:" '$0 ~ pattern {gsub(/[ \t]/, "", $2); print $2}')
}
function update_current_settings {
for key in ${!SETTINGS_MAP[@]}; do
CURRENT_SETTINGS[$key]=$(get_value $key)
done
echo ${CURRENT_SETTINGS[@]}
}
if ! ethtool -h | grep -q coalesce; then
echo "SKIP: No --coalesce support in ethtool"
exit 4
fi
NSIM_NETDEV=$(make_netdev)
set -o pipefail
declare -A SETTINGS_MAP=(
["rx-frames-low"]="rx-frame-low"
["tx-frames-low"]="tx-frame-low"
["rx-frames-high"]="rx-frame-high"
["tx-frames-high"]="tx-frame-high"
["rx-usecs"]="rx-usecs"
["rx-frames"]="rx-frames"
["rx-usecs-irq"]="rx-usecs-irq"
["rx-frames-irq"]="rx-frames-irq"
["tx-usecs"]="tx-usecs"
["tx-frames"]="tx-frames"
["tx-usecs-irq"]="tx-usecs-irq"
["tx-frames-irq"]="tx-frames-irq"
["stats-block-usecs"]="stats-block-usecs"
["pkt-rate-low"]="pkt-rate-low"
["rx-usecs-low"]="rx-usecs-low"
["tx-usecs-low"]="tx-usecs-low"
["pkt-rate-high"]="pkt-rate-high"
["rx-usecs-high"]="rx-usecs-high"
["tx-usecs-high"]="tx-usecs-high"
["sample-interval"]="sample-interval"
)
declare -A CURRENT_SETTINGS=(
["rx-frames-low"]=""
["tx-frames-low"]=""
["rx-frames-high"]=""
["tx-frames-high"]=""
["rx-usecs"]=""
["rx-frames"]=""
["rx-usecs-irq"]=""
["rx-frames-irq"]=""
["tx-usecs"]=""
["tx-frames"]=""
["tx-usecs-irq"]=""
["tx-frames-irq"]=""
["stats-block-usecs"]=""
["pkt-rate-low"]=""
["rx-usecs-low"]=""
["tx-usecs-low"]=""
["pkt-rate-high"]=""
["rx-usecs-high"]=""
["tx-usecs-high"]=""
["sample-interval"]=""
)
declare -A EXPECTED_SETTINGS=(
["rx-frames-low"]=""
["tx-frames-low"]=""
["rx-frames-high"]=""
["tx-frames-high"]=""
["rx-usecs"]=""
["rx-frames"]=""
["rx-usecs-irq"]=""
["rx-frames-irq"]=""
["tx-usecs"]=""
["tx-frames"]=""
["tx-usecs-irq"]=""
["tx-frames-irq"]=""
["stats-block-usecs"]=""
["pkt-rate-low"]=""
["rx-usecs-low"]=""
["tx-usecs-low"]=""
["pkt-rate-high"]=""
["rx-usecs-high"]=""
["tx-usecs-high"]=""
["sample-interval"]=""
)
# populate the expected settings map
for key in ${!SETTINGS_MAP[@]}; do
EXPECTED_SETTINGS[$key]=$(get_value $key)
done
# test
for key in ${!SETTINGS_MAP[@]}; do
value=$((RANDOM % $((2**32-1))))
ethtool -C $NSIM_NETDEV "$key" "$value"
EXPECTED_SETTINGS[$key]="$value"
expected=${EXPECTED_SETTINGS[@]}
current=$(update_current_settings)
check $? "$current" "$expected"
set +x
done
# bool settings which ethtool displays on the same line
ethtool -C $NSIM_NETDEV adaptive-rx on
s=$(ethtool -c $NSIM_NETDEV | grep -q "Adaptive RX: on TX: off")
check $? "$s" ""
ethtool -C $NSIM_NETDEV adaptive-tx on
s=$(ethtool -c $NSIM_NETDEV | grep -q "Adaptive RX: on TX: on")
check $? "$s" ""
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
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Makefile | File | 396 B | 0644 |
|
| devlink.sh | File | 19.29 KB | 0755 |
|
| devlink_in_netns.sh | File | 1.34 KB | 0755 |
|
| devlink_trap.sh | File | 12.62 KB | 0755 |
|
| ethtool-coalesce.sh | File | 3.19 KB | 0755 |
|
| ethtool-common.sh | File | 1.06 KB | 0644 |
|
| ethtool-features.sh | File | 665 B | 0644 |
|
| ethtool-fec.sh | File | 3.1 KB | 0755 |
|
| ethtool-pause.sh | File | 1.27 KB | 0755 |
|
| ethtool-ring.sh | File | 1.79 KB | 0755 |
|
| fib.sh | File | 7.54 KB | 0755 |
|
| fib_notifications.sh | File | 10.13 KB | 0755 |
|
| hw_stats_l3.sh | File | 9.16 KB | 0755 |
|
| macsec-offload.sh | File | 2.84 KB | 0755 |
|
| nexthop.sh | File | 26.37 KB | 0755 |
|
| peer.sh | File | 3.26 KB | 0755 |
|
| psample.sh | File | 4.02 KB | 0755 |
|
| tc-mq-visibility.sh | File | 1.64 KB | 0755 |
|
| udp_tunnel_nic.sh | File | 20.27 KB | 0755 |
|