From a69c81b6be126a8d38fdec300e68a92e75f1f01c Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Mon, 21 Sep 2020 09:38:39 -0600 Subject: [PATCH] tests: ethtool: add dma ring tests --- executor-scripts/linux/ethtool | 2 +- tests/linux/ethtool_test | 38 +++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/executor-scripts/linux/ethtool b/executor-scripts/linux/ethtool index 3f8d284..8ad8593 100755 --- a/executor-scripts/linux/ethtool +++ b/executor-scripts/linux/ethtool @@ -12,7 +12,7 @@ gather_params() { y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ P g - s/.*\n//" + s/.*\n//" | sed -E "s/_/-/g" } case "$PHASE" in diff --git a/tests/linux/ethtool_test b/tests/linux/ethtool_test index 3d7f219..197ca2e 100755 --- a/tests/linux/ethtool_test +++ b/tests/linux/ethtool_test @@ -22,7 +22,11 @@ tests_init \ up_offload_sg \ up_offload_tso \ up_offload_tx \ - up_offload_ufo + up_offload_ufo \ + up_dma_ring_rx \ + up_dma_ring_rx_jumbo \ + up_dma_ring_rx_mini \ + up_dma_ring_tx pre_up_msglvl_body() { export IFACE="eth0" PHASE="pre-up" IF_ETHTOOL_MSGLVL="debug on" MOCK="echo" @@ -247,3 +251,35 @@ up_offload_ufo_body() { -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} +}