__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ 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
NSIM_NETDEV=$(make_netdev)
[ a$ETHTOOL == a ] && ETHTOOL=ethtool
set -o pipefail
# Since commit 2b3ddcb35357 ("ethtool: fec: Change the prompt ...")
# in ethtool CLI the Configured lines start with Supported/Configured.
configured=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2 | head -1 | cut -d' ' -f1)
# netdevsim starts out with None/None
s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
check $? "$s" "$configured FEC encodings: None
Active FEC encoding: None"
# Test Auto
$ETHTOOL --set-fec $NSIM_NETDEV encoding auto
check $?
s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
check $? "$s" "$configured FEC encodings: Auto
Active FEC encoding: Off"
# Test case in-sensitivity
for o in off Off OFF; do
$ETHTOOL --set-fec $NSIM_NETDEV encoding $o
check $?
s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
check $? "$s" "$configured FEC encodings: Off
Active FEC encoding: Off"
done
for o in BaseR baser BAser; do
$ETHTOOL --set-fec $NSIM_NETDEV encoding $o
check $?
s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
check $? "$s" "$configured FEC encodings: BaseR
Active FEC encoding: BaseR"
done
for o in llrs rs; do
$ETHTOOL --set-fec $NSIM_NETDEV encoding $o
check $?
s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
check $? "$s" "$configured FEC encodings: ${o^^}
Active FEC encoding: ${o^^}"
done
# Test multiple bits
$ETHTOOL --set-fec $NSIM_NETDEV encoding rs llrs
check $?
s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
check $? "$s" "$configured FEC encodings: RS LLRS
Active FEC encoding: LLRS"
$ETHTOOL --set-fec $NSIM_NETDEV encoding rs off auto
check $?
s=$($ETHTOOL --show-fec $NSIM_NETDEV | tail -2)
check $? "$s" "$configured FEC encodings: Auto Off RS
Active FEC encoding: RS"
# Make sure other link modes are rejected
$ETHTOOL --set-fec $NSIM_NETDEV encoding FIBRE 2>/dev/null
check $? '' '' 1
$ETHTOOL --set-fec $NSIM_NETDEV encoding bla-bla-bla 2>/dev/null
check $? '' '' 1
# Try JSON
$ETHTOOL --json --show-fec $NSIM_NETDEV | jq empty >>/dev/null 2>&1
if [ $? -eq 0 ]; then
$ETHTOOL --set-fec $NSIM_NETDEV encoding auto
check $?
s=$($ETHTOOL --json --show-fec $NSIM_NETDEV | jq '.[].config[]')
check $? "$s" '"Auto"'
s=$($ETHTOOL --json --show-fec $NSIM_NETDEV | jq '.[].active[]')
check $? "$s" '"Off"'
$ETHTOOL --set-fec $NSIM_NETDEV encoding auto RS
check $?
s=$($ETHTOOL --json --show-fec $NSIM_NETDEV | jq '.[].config[]')
check $? "$s" '"Auto"
"RS"'
s=$($ETHTOOL --json --show-fec $NSIM_NETDEV | jq '.[].active[]')
check $? "$s" '"RS"'
fi
# Test error injection
echo 11 > $NSIM_DEV_DFS/ethtool/get_err
$ETHTOOL --show-fec $NSIM_NETDEV >>/dev/null 2>&1
check $? '' '' 1
echo 0 > $NSIM_DEV_DFS/ethtool/get_err
echo 11 > $NSIM_DEV_DFS/ethtool/set_err
$ETHTOOL --show-fec $NSIM_NETDEV >>/dev/null 2>&1
check $?
$ETHTOOL --set-fec $NSIM_NETDEV encoding RS 2>/dev/null
check $? '' '' 1
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 |
|