Merge pull request #81 from ifupdown-ng/feature/ethtool
Ethtool support
This commit is contained in:
commit
850b20d5a8
5 changed files with 597 additions and 0 deletions
1
Makefile
1
Makefile
|
@ -90,6 +90,7 @@ EXECUTOR_SCRIPTS_OPT ?= \
|
||||||
tunnel \
|
tunnel \
|
||||||
gre \
|
gre \
|
||||||
wireguard \
|
wireguard \
|
||||||
|
ethtool \
|
||||||
batman
|
batman
|
||||||
|
|
||||||
EXECUTOR_SCRIPTS ?= ${EXECUTOR_SCRIPTS_CORE} ${EXECUTOR_SCRIPTS_OPT}
|
EXECUTOR_SCRIPTS ?= ${EXECUTOR_SCRIPTS_CORE} ${EXECUTOR_SCRIPTS_OPT}
|
||||||
|
|
60
executor-scripts/linux/ethtool
Executable file
60
executor-scripts/linux/ethtool
Executable file
|
@ -0,0 +1,60 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# gather params for a given prefix, based on executor-scripts/linux/tunnel.
|
||||||
|
gather_params() {
|
||||||
|
env | sed -E "
|
||||||
|
s/^IF_${1}_([A-Z0-9_]+)=(.+)/\1\n\2/
|
||||||
|
ta
|
||||||
|
d
|
||||||
|
:a
|
||||||
|
h
|
||||||
|
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
||||||
|
P
|
||||||
|
g
|
||||||
|
s/.*\n//" | sed -E "s/_/-/g"
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$PHASE" in
|
||||||
|
pre-up)
|
||||||
|
settings="\
|
||||||
|
${IF_ETHTOOL_ETHERNET_PORT:+ port $IF_ETHTOOL_ETHERNET_PORT}
|
||||||
|
${IF_ETHTOOL_MSGLVL:+ msglvl $IF_ETHTOOL_MSGLVL}
|
||||||
|
"
|
||||||
|
[ -z "$settings" ] || $MOCK ethtool --change "$IFACE" $settings
|
||||||
|
;;
|
||||||
|
up)
|
||||||
|
# first do the link settings.
|
||||||
|
link_settings="${IF_ETHTOOL_LINK_SPEED:+ speed $IF_ETHTOOL_LINK_SPEED}${IF_ETHTOOL_LINK_DUPLEX:+ duplex $IF_ETHTOOL_LINK_DUPLEX}"
|
||||||
|
|
||||||
|
# ethernet-wol can have a second arg (key), split into $1 and $2
|
||||||
|
set -- $IF_ETHTOOL_ETHERNET_WOL
|
||||||
|
link_settings="$link_settings${1:+ wol $1}${2:+ sopass $2}"
|
||||||
|
|
||||||
|
# handle ethtool-ethernet-autoneg like Debian would
|
||||||
|
case "$IF_ETHTOOL_ETHERNET_AUTONEG" in
|
||||||
|
'')
|
||||||
|
;;
|
||||||
|
on|off)
|
||||||
|
link_settings="$link_settings autoneg $IF_ETHTOOL_ETHERNET_AUTONEG"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
link_settings="$link_settings autoneg on advertise $IF_ETHTOOL_ETHERNET_AUTONEG"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
[ -z "$link_settings" ] || $MOCK ethtool --change "$IFACE" $link_settings
|
||||||
|
|
||||||
|
pause_settings=$(gather_params ETHTOOL_PAUSE)
|
||||||
|
[ -z "$pause_settings" ] || $MOCK ethtool --pause "$IFACE" $pause_settings
|
||||||
|
|
||||||
|
offload_settings=$(gather_params ETHTOOL_OFFLOAD)
|
||||||
|
[ -z "$offload_settings" ] || $MOCK ethtool --offload "$IFACE" $offload_settings
|
||||||
|
|
||||||
|
dma_settings=$(gather_params ETHTOOL_DMA_RING)
|
||||||
|
[ -z "$dma_settings" ] || $MOCK ethtool --set-ring "$IFACE" $dma_settings
|
||||||
|
|
||||||
|
coalesce_settings=$(gather_params ETHTOOL_COALESCE)
|
||||||
|
[ -z "$coalesce_settings" ] || $MOCK ethtool --coalesce "$IFACE" $coalesce_settings
|
||||||
|
;;
|
||||||
|
esac
|
|
@ -27,13 +27,65 @@ struct remap_token {
|
||||||
|
|
||||||
/* this list must be in alphabetical order for bsearch */
|
/* this list must be in alphabetical order for bsearch */
|
||||||
static const struct remap_token tokens[] = {
|
static const struct remap_token tokens[] = {
|
||||||
|
{"driver-message-level", "ethtool-msglvl"}, /* Debian ethtool integration */
|
||||||
{"endpoint", "tunnel-remote"}, /* legacy ifupdown */
|
{"endpoint", "tunnel-remote"}, /* legacy ifupdown */
|
||||||
|
{"ethernet-autoneg", "ethtool-ethernet-autoneg"}, /* Debian ethtool integration */
|
||||||
|
{"ethernet-pause-autoneg", "ethtool-pause-autoneg"}, /* Debian ethtool integration */
|
||||||
|
{"ethernet-pause-rx", "ethtool-pause-rx"}, /* Debian ethtool integration */
|
||||||
|
{"ethernet-pause-tx", "ethtool-pause-tx"}, /* Debian ethtool integration */
|
||||||
|
{"ethernet-port", "ethtool-ethernet-port"}, /* Debian ethtool integration */
|
||||||
|
{"ethernet-wol", "ethtool-ethernet-wol"}, /* Debian ethtool integration */
|
||||||
|
{"gro-offload", "ethtool-offload-gro"}, /* ifupdown2 */
|
||||||
|
{"gso-offload", "ethtool-offload-gso"}, /* ifupdown2 */
|
||||||
|
{"hardware-dma-ring-rx", "ethtool-dma-ring-rx"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-dma-ring-rx-jumbo", "ethtool-dma-ring-rx-jumbo"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-dma-ring-rx-mini", "ethtool-dma-ring-rx-mini"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-dma-ring-tx", "ethtool-dma-ring-tx"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-adaptive-rx", "ethtool-coalesce-adaptive-rx"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-adaptive-tx", "ethtool-coalesce-adaptive-tx"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-pkt-rate-high", "ethtool-coalesce-pkt-rate-high"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-pkt-rate-low", "ethtool-coalesce-pkt-rate-low"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-rx-frames", "ethtool-coalesce-rx-frames"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-rx-frames-high", "ethtool-coalesce-rx-frames-high"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-rx-frames-irq", "ethtool-coalesce-rx-frames-irq"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-rx-frames-low", "ethtool-coalesce-rx-frames-low"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-rx-usecs", "ethtool-coalesce-rx-usecs"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-rx-usecs-high", "ethtool-coalesce-rx-usecs-high"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-rx-usecs-irq", "ethtool-coalesce-rx-usecs-irq"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-rx-usecs-low", "ethtool-coalesce-rx-usecs-low"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-sample-interval", "ethtool-coalesce-sample-interval"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-stats-block-usecs", "ethtool-coalesce-stats-block-usecs"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-tx-frames", "ethtool-coalesce-tx-frames"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-tx-frames-high", "ethtool-coalesce-tx-frames-high"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-tx-frames-irq", "ethtool-coalesce-tx-frames-irq"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-tx-frames-low", "ethtool-coalesce-tx-frames-low"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-tx-usecs", "ethtool-coalesce-tx-usecs"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-tx-usecs-high", "ethtool-coalesce-tx-usecs-high"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-tx-usecs-irq", "ethtool-coalesce-tx-usecs-irq"}, /* Debian ethtool integration */
|
||||||
|
{"hardware-irq-coalesce-tx-usecs-low", "ethtool-coalesce-tx-usecs-low"}, /* Debian ethtool integration */
|
||||||
|
{"link-autoneg", "ethtool-ethernet-autoneg"}, /* ifupdown2 */
|
||||||
|
{"link-duplex", "ethtool-link-duplex"}, /* Debian ethtool integration */
|
||||||
|
{"link-fec", "ethtool-link-fec"}, /* ifupdown2 */
|
||||||
|
{"link-speed", "ethtool-link-speed"}, /* Debian ethtool integration */
|
||||||
{"local", "tunnel-local"}, /* legacy ifupdown */
|
{"local", "tunnel-local"}, /* legacy ifupdown */
|
||||||
|
{"lro-offload", "ethtool-offload-lro"}, /* ifupdown2 */
|
||||||
{"mode", "tunnel-mode"}, /* legacy ifupdown */
|
{"mode", "tunnel-mode"}, /* legacy ifupdown */
|
||||||
|
{"offload-gro", "ethtool-offload-gro"}, /* Debian ethtool integration */
|
||||||
|
{"offload-gso", "ethtool-offload-gso"}, /* Debian ethtool integration */
|
||||||
|
{"offload-lro", "ethtool-offload-lro"}, /* Debian ethtool integration */
|
||||||
|
{"offload-rx", "ethtool-offload-rx"}, /* Debian ethtool integration */
|
||||||
|
{"offload-sg", "ethtool-offload-sg"}, /* Debian ethtool integration */
|
||||||
|
{"offload-tso", "ethtool-offload-tso"}, /* Debian ethtool integration */
|
||||||
|
{"offload-tx", "ethtool-offload-tx"}, /* Debian ethtool integration */
|
||||||
|
{"offload-ufo", "ethtool-offload-ufo"}, /* Debian ethtool integration */
|
||||||
{"provider", "ppp-provider"}, /* legacy ifupdown, ifupdown2 */
|
{"provider", "ppp-provider"}, /* legacy ifupdown, ifupdown2 */
|
||||||
|
{"rx-offload", "ethtool-offload-rx"}, /* ifupdown2 */
|
||||||
|
{"tso-offload", "ethtool-offload-tso"}, /* ifupdown2 */
|
||||||
{"ttl", "tunnel-ttl"}, /* legacy ifupdown */
|
{"ttl", "tunnel-ttl"}, /* legacy ifupdown */
|
||||||
{"tunnel-endpoint", "tunnel-remote"}, /* ifupdown2 */
|
{"tunnel-endpoint", "tunnel-remote"}, /* ifupdown2 */
|
||||||
{"tunnel-physdev", "tunnel-dev"}, /* ifupdown2 */
|
{"tunnel-physdev", "tunnel-dev"}, /* ifupdown2 */
|
||||||
|
{"tx-offload", "ethtool-offload-tx"}, /* ifupdown2 */
|
||||||
|
{"ufo-offload", "ethtool-offload-ufo"}, /* ifupdown2 */
|
||||||
{"vrf", "vrf-member"}, /* ifupdown2 */
|
{"vrf", "vrf-member"}, /* ifupdown2 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -11,3 +11,4 @@ atf_test_program{name='ppp_test'}
|
||||||
atf_test_program{name='tunnel_test'}
|
atf_test_program{name='tunnel_test'}
|
||||||
atf_test_program{name='gre_test'}
|
atf_test_program{name='gre_test'}
|
||||||
atf_test_program{name='wireguard_test'}
|
atf_test_program{name='wireguard_test'}
|
||||||
|
atf_test_program{name='ethtool_test'}
|
||||||
|
|
483
tests/linux/ethtool_test
Executable file
483
tests/linux/ethtool_test
Executable file
|
@ -0,0 +1,483 @@
|
||||||
|
#!/usr/bin/env atf-sh
|
||||||
|
|
||||||
|
. $(atf_get_srcdir)/../test_env.sh
|
||||||
|
EXECUTOR="$(atf_get_srcdir)/../../executor-scripts/linux/ethtool"
|
||||||
|
|
||||||
|
tests_init \
|
||||||
|
pre_up_msglvl \
|
||||||
|
pre_up_ethernet_port \
|
||||||
|
up_speed \
|
||||||
|
up_duplex \
|
||||||
|
up_wol \
|
||||||
|
up_wol_sopass \
|
||||||
|
up_autoneg_simple \
|
||||||
|
up_autoneg_mask \
|
||||||
|
up_pause_autoneg \
|
||||||
|
up_pause_tx \
|
||||||
|
up_pause_rx \
|
||||||
|
up_offload_gro \
|
||||||
|
up_offload_gso \
|
||||||
|
up_offload_lro \
|
||||||
|
up_offload_rx \
|
||||||
|
up_offload_sg \
|
||||||
|
up_offload_tso \
|
||||||
|
up_offload_tx \
|
||||||
|
up_offload_ufo \
|
||||||
|
up_dma_ring_rx \
|
||||||
|
up_dma_ring_rx_jumbo \
|
||||||
|
up_dma_ring_rx_mini \
|
||||||
|
up_dma_ring_tx \
|
||||||
|
up_coalesce_adaptive_rx \
|
||||||
|
up_coalesce_adaptive_tx \
|
||||||
|
up_coalesce_pkt_rate_low \
|
||||||
|
up_coalesce_pkt_rate_high \
|
||||||
|
up_coalesce_sample_interval \
|
||||||
|
up_coalesce_stats_block_usecs \
|
||||||
|
up_coalesce_rx_frames \
|
||||||
|
up_coalesce_rx_frames_low \
|
||||||
|
up_coalesce_rx_frames_irq \
|
||||||
|
up_coalesce_rx_frames_high \
|
||||||
|
up_coalesce_rx_usecs \
|
||||||
|
up_coalesce_rx_usecs_low \
|
||||||
|
up_coalesce_rx_usecs_irq \
|
||||||
|
up_coalesce_rx_usecs_high \
|
||||||
|
up_coalesce_tx_frames \
|
||||||
|
up_coalesce_tx_frames_low \
|
||||||
|
up_coalesce_tx_frames_irq \
|
||||||
|
up_coalesce_tx_frames_high \
|
||||||
|
up_coalesce_tx_usecs \
|
||||||
|
up_coalesce_tx_usecs_low \
|
||||||
|
up_coalesce_tx_usecs_irq \
|
||||||
|
up_coalesce_tx_usecs_high
|
||||||
|
|
||||||
|
pre_up_msglvl_body() {
|
||||||
|
export IFACE="eth0" PHASE="pre-up" IF_ETHTOOL_MSGLVL="debug on" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --change eth0' \
|
||||||
|
-o match:'msglvl debug on' \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
pre_up_ethernet_port_body() {
|
||||||
|
export IFACE="eth0" PHASE="pre-up" IF_ETHTOOL_ETHERNET_PORT="4" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --change eth0' \
|
||||||
|
-o match:'port 4' \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_speed_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_LINK_SPEED="1000" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --change eth0' \
|
||||||
|
-o match:'speed 1000' \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_duplex_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_LINK_DUPLEX="full" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --change eth0' \
|
||||||
|
-o match:'duplex full' \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_wol_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_ETHERNET_WOL="g" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --change eth0' \
|
||||||
|
-o match:'wol g' \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_wol_sopass_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_ETHERNET_WOL="s abc123" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --change eth0' \
|
||||||
|
-o match:'wol s sopass abc123' \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_autoneg_simple_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_ETHERNET_AUTONEG="on" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --change eth0' \
|
||||||
|
-o match:'autoneg on' \
|
||||||
|
${EXECUTOR}
|
||||||
|
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_ETHERNET_AUTONEG="off" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --change eth0' \
|
||||||
|
-o match:'autoneg off' \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_autoneg_mask_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_ETHERNET_AUTONEG="1000/full" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --change eth0' \
|
||||||
|
-o match:'autoneg on advertise 1000/full' \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_pause_autoneg_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_PAUSE_AUTONEG="on" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --pause eth0' \
|
||||||
|
-o match:"autoneg on" \
|
||||||
|
${EXECUTOR}
|
||||||
|
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_PAUSE_AUTONEG="off" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --pause eth0' \
|
||||||
|
-o match:"autoneg off" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_pause_tx_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_PAUSE_TX="on" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --pause eth0' \
|
||||||
|
-o match:"tx on" \
|
||||||
|
${EXECUTOR}
|
||||||
|
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_PAUSE_TX="off" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --pause eth0' \
|
||||||
|
-o match:"tx off" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_pause_rx_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_PAUSE_RX="on" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --pause eth0' \
|
||||||
|
-o match:"rx on" \
|
||||||
|
${EXECUTOR}
|
||||||
|
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_PAUSE_RX="off" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --pause eth0' \
|
||||||
|
-o match:"rx off" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_offload_gro_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_GRO="on" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"gro on" \
|
||||||
|
${EXECUTOR}
|
||||||
|
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_GRO="off" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"gro off" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_offload_gso_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_GSO="on" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"gso on" \
|
||||||
|
${EXECUTOR}
|
||||||
|
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_GSO="off" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"gso off" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_offload_lro_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_LRO="on" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"lro on" \
|
||||||
|
${EXECUTOR}
|
||||||
|
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_LRO="off" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"lro off" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_offload_rx_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_RX="on" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"rx on" \
|
||||||
|
${EXECUTOR}
|
||||||
|
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_RX="off" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"rx off" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_offload_sg_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_SG="on" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"sg on" \
|
||||||
|
${EXECUTOR}
|
||||||
|
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_SG="off" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"sg off" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_offload_tso_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_TSO="on" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"tso on" \
|
||||||
|
${EXECUTOR}
|
||||||
|
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_TSO="off" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"tso off" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_offload_tx_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_TX="on" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"tx on" \
|
||||||
|
${EXECUTOR}
|
||||||
|
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_TX="off" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"tx off" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_offload_ufo_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_UFO="on" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"ufo on" \
|
||||||
|
${EXECUTOR}
|
||||||
|
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_OFFLOAD_UFO="off" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --offload eth0' \
|
||||||
|
-o match:"ufo off" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_dma_ring_rx_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_DMA_RING_RX="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --set-ring eth0' \
|
||||||
|
-o match:"rx 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_dma_ring_rx_jumbo_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_DMA_RING_RX_JUMBO="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --set-ring eth0' \
|
||||||
|
-o match:"rx-jumbo 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_dma_ring_rx_mini_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_DMA_RING_RX_MINI="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --set-ring eth0' \
|
||||||
|
-o match:"rx-mini 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_dma_ring_tx_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_DMA_RING_TX="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --set-ring eth0' \
|
||||||
|
-o match:"tx 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_adaptive_rx_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_ADAPTIVE_RX="on" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"adaptive-rx on" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_adaptive_tx_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_ADAPTIVE_TX="on" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"adaptive-tx on" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_pkt_rate_low_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_PKT_RATE_LOW="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"pkt-rate-low 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_pkt_rate_high_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_PKT_RATE_HIGH="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"pkt-rate-high 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_sample_interval_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_SAMPLE_INTERVAL="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"sample-interval 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_stats_block_usecs_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_STATS_BLOCK_USECS="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"stats-block-usecs 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_rx_frames_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_RX_FRAMES="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"rx-frames 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_rx_frames_low_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_RX_FRAMES_LOW="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"rx-frames-low 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_rx_frames_irq_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_RX_FRAMES_IRQ="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"rx-frames-irq 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_rx_frames_high_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_RX_FRAMES_HIGH="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"rx-frames-high 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_rx_usecs_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_RX_USECS="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"rx-usecs 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_rx_usecs_low_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_RX_USECS_LOW="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"rx-usecs-low 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_rx_usecs_irq_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_RX_USECS_IRQ="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"rx-usecs-irq 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_rx_usecs_high_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_RX_USECS_HIGH="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"rx-usecs-high 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_tx_frames_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_TX_FRAMES="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"tx-frames 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_tx_frames_low_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_TX_FRAMES_LOW="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"tx-frames-low 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_tx_frames_irq_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_TX_FRAMES_IRQ="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"tx-frames-irq 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_tx_frames_high_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_TX_FRAMES_HIGH="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"tx-frames-high 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_tx_usecs_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_TX_USECS="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"tx-usecs 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_tx_usecs_low_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_TX_USECS_LOW="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"tx-usecs-low 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_tx_usecs_irq_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_TX_USECS_IRQ="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"tx-usecs-irq 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
||||||
|
|
||||||
|
up_coalesce_tx_usecs_high_body() {
|
||||||
|
export IFACE="eth0" PHASE="up" IF_ETHTOOL_COALESCE_TX_USECS_HIGH="1024" MOCK="echo"
|
||||||
|
atf_check -s exit:0 \
|
||||||
|
-o match:'ethtool --coalesce eth0' \
|
||||||
|
-o match:"tx-usecs-high 1024" \
|
||||||
|
${EXECUTOR}
|
||||||
|
}
|
Loading…
Reference in a new issue