• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0-or-later
3# Copyright (c) 2016-2018 Oracle and/or its affiliates. All Rights Reserved.
4
5TST_SETUP="setup"
6TST_TESTFUNC="test"
7TST_CLEANUP="cleanup"
8TST_MIN_KVER="3.11"
9TST_NEEDS_TMPDIR=1
10TST_NEEDS_ROOT=1
11TST_NEEDS_CMDS="pkill sysctl ethtool"
12# for more stable results set to a single thread
13TST_NETLOAD_CLN_NUMBER=1
14
15. tst_net.sh
16
17busy_poll_check_config()
18{
19	if [ ! -f "/proc/sys/net/core/busy_read" -a \
20	     ! -f "/proc/sys/net/core/busy_poll" ]; then
21		tst_brk TCONF "busy poll not configured, CONFIG_NET_RX_BUSY_POLL"
22	fi
23
24	if tst_kvcmp -lt "4.5"; then
25		ethtool --show-features $(tst_iface) | \
26			grep -q 'busy-poll.*on' || \
27			tst_brk TCONF "busy poll not supported by driver"
28	else
29		drvs="bnx2x|bnxt|cxgb4|enic|benet|ixgbe|ixgbevf|mlx4|mlx5|myri10ge|sfc|virtio"
30		ethtool -i $(tst_iface) | grep -qE "driver: ($drvs)" || \
31			tst_brk TCONF "busy poll not supported"
32	fi
33}
34