From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-eopbgr50044.outbound.protection.outlook.com ([40.107.5.44]:26432 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752048AbeBZJA5 (ORCPT ); Mon, 26 Feb 2018 04:00:57 -0500 From: Ido Schimmel To: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: davem@davemloft.net, shuah@kernel.org, jiri@mellanox.com, dsahern@gmail.com, roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com, f.fainelli@gmail.com, andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, mlxsw@mellanox.com, Ido Schimmel Subject: [PATCH net-next 08/14] selftests: forwarding: Add tc offload check helper Date: Mon, 26 Feb 2018 10:59:42 +0200 Message-Id: <20180226085948.19368-9-idosch@mellanox.com> In-Reply-To: <20180226085948.19368-1-idosch@mellanox.com> References: <20180226085948.19368-1-idosch@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain Sender: netdev-owner@vger.kernel.org List-ID: From: Jiri Pirko Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- tools/testing/selftests/net/forwarding/lib.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index b601f6ad9630..141dd33bf6c4 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -296,6 +296,19 @@ forwarding_restore() sysctl -q -w net.ipv4.conf.all.forwarding=$ipv4_fwd } +tc_offload_check() +{ + for i in $(eval echo {1..$NUM_NETIFS}); do + ethtool -k ${NETIFS[p$i]} \ + | grep "hw-tc-offload: on" &> /dev/null + if [[ $? -ne 0 ]]; then + return 1 + fi + done + + return 0 +} + ############################################################################## # Tests -- 2.14.3