Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp656215lqt; Thu, 6 Jun 2024 14:31:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW/KZalSvoNcPF6vk6baUm9qS9fGIW+ZWvOTY7+tM4EdbfekafxQKqeYrAQM40A/A+GGgP/7HKaKoTMbCWDhVt+62jXxNEiEJxRjamwwg== X-Google-Smtp-Source: AGHT+IHOllRhTIia1HNIm1g81c6giM0AiYuR5p0UJrapJCKWbx7/lbsNZ6jql5npQ4e75DVvtKCN X-Received: by 2002:a50:d654:0:b0:578:6361:1364 with SMTP id 4fb4d7f45d1cf-57c50924953mr333984a12.21.1717709475051; Thu, 06 Jun 2024 14:31:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717709475; cv=pass; d=google.com; s=arc-20160816; b=Zadl/B6Y+jNFLb2K1LxacSwByvL5TKQjGX1WMr83T7FyodZqiJQt1YFYkXvXO8YrL/ R3rO32thbRHc7MAe5WRseOnmvqh638GxuBxGjLt7tPp1MopMqtHiYKpv+3hY8PZI/TBp zieAmqsPH+GPplWciyY3Nmlkd+iSldhQLl1mMbkUjb7/kttSONvTFi3kTxb5kRO5LrIs bjJ1Eat1LEQfMu6JSSRo9RvN1DHuPYDCeXGU64FQX7KG668MZQBLt6DfTxOC58/j1qmy wlXUT4LcFyIwQ1fsClT8x+UJzJ534U1cI/chI7x5kXZRN6aF+k3us2XRQ3fDihsZHR0q Gm4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=ANsPCcVU2AeDXu/+ajzXrVrzYIB9B0ViOyF0duLjfOA=; fh=yWDs58cDEdjd4WMoYVYxd5LwQWd1FuL1OHf6giMBmYM=; b=uHkCcQ9w+bDh9xJsbilTZjnS0QYmoACQQZF30Nor1s8xeV7AR+w2nlsgDt0L7T+CB6 6E6h9fDzZwzK2mLiu1QWGoE9Td3Aa/9nVJtP6rxV4qByPpYBsk/O6FMLvIIwfp/osW55 rT/vBeALx6JRVBBY1uFlBPCngsj3gvVuOv7LEYr5eB9PkaT2E6U5Jxychwop9VLtJS5V oppF8VJCbaWLaRzlQrQh0kbbSrv4t9RftaYK9W1kD7kXIzSZgjcSqU/Ek3soy4qjOUbY Juar5K6PG7kufpDK0+S+owLyRS379JbBE/3OcaSQyFSWCLclJ5MBeR803I+J4qsOzP/y yYjg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bqN+RtDV; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-205082-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205082-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae28a581si1085760a12.617.2024.06.06.14.31.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 14:31:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205082-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bqN+RtDV; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-205082-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205082-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C11DE1F2612F for ; Thu, 6 Jun 2024 21:31:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E2DD19A299; Thu, 6 Jun 2024 21:27:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bqN+RtDV" Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EB2C7173C; Thu, 6 Jun 2024 21:27:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717709271; cv=none; b=QkhcJfgZOifRG7eXqpqrC3d0S5qrI8HY+JgC5mCbgOMYPcWybUJo0tDSIB+SsYpHfc8GVGdY6ZNOrLUkbGCv7r/6as4KG51EvQ60RyBOZrqkzLUIAdVue6pdgDE9870tL5gCWmZ6JHfYFPHkS+QoXePA5r5isyw6sbxuWYD3Khk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717709271; c=relaxed/simple; bh=n1iT1QmXS98BBng5bKxBVrEJubKuUwB9yIop4gSG/ss=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=f5T0UXQowg1DQaqzFUSThOUo0e+IcPC4mnyU11cZi2z0qVvLu1RrGIeoCQ3Uu31BQg56jpaVnqRIiBWRn2sVo5Qxb8iVh8Ei8Uq6Xlr8/FwM7Im8men0SnEg27HPUGMQfiHePbkRNE9HSEzFwC0BqcZglXVIASaeIg4mJL7xGRM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bqN+RtDV; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-7024d571d8eso1239007b3a.0; Thu, 06 Jun 2024 14:27:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717709269; x=1718314069; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ANsPCcVU2AeDXu/+ajzXrVrzYIB9B0ViOyF0duLjfOA=; b=bqN+RtDVWefrhmD/TFPhnpHPbQDLdZSlPIvZBmfjRnuDqYBQd1m89gEw7VxuvlUBRu 7GZphS4jAuJHkoEEvjKVUg03wMxrvzOauAQCsZ3APCFdjzTOrofSlYnLy2d2nPkT+4zj kbh6qoeCuUhUbESIJTcfrAkHwf+YUSiunmeSESXikyV6Wzj6OpWND3d6bWEyYsO78U2c WBMFkN7HdctcxHDJC1jVbv9JuoJf0k36xDTJHJ3ZB1CySj28ex4YjYSxoA3rGONwhwZ/ kcHubdGZF1QZ3C9q2x0pY7Ujhg8egzvhyl8lzUjoB750jUwnMmqQ5YKqtSlFvDwhQ13Z VGsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717709269; x=1718314069; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ANsPCcVU2AeDXu/+ajzXrVrzYIB9B0ViOyF0duLjfOA=; b=wRVzXsfCERUMMbYBEBEsh9CEsN1YVMpTQaSPJFWQBdgrNTdPEXkhEtpEw2Qko3sjNC qu0nnRq5gac5e0+QGkQfzdwNpBtSCa7/gr8abH+gDqcJ06XD0WxFbP0r5wrZ7rHT9s7N QxkR4+myylqEV0JxxRO2LpO2ubgPPlyY3TMhUPMZH/NAUVkuUL2oACRt3bPEd++/y5AL Xtt89fuVrP/IU2lP1qZp9iccpPpm6j0HkayhsOQ9q/lG4Jg1CG5xXfzs/T0n94ZGZmMo adXvVpBeaonl7Ozljj5UqN46Q4SL5sWIGE0aUMscdx0f2fwVs2NbU3diG8atxskSGy4L axQw== X-Forwarded-Encrypted: i=1; AJvYcCXFcZV43m04U8twfTIKKoy1M9bLZJiSNZRE/ZQHKuEOc98M8IPAC4c6lFyrnGJxDIZDXn/4En3GdJdNKchDUO9T/36HfYlN0yyD45B9yZh4WZq6YdtjO93zhVFs7zC0bLfv+6QVoxBSbgpadkniaYqVuzodj53bzBHbp2HsF6M0BCDjDt+N X-Gm-Message-State: AOJu0YwrX0BdKWBgFVaKmcB+TJn0KvuE5+lD40sYFtYJyi7EhQiTlOpE HW2/4ayV1PIHmNxY4+Q+7kYS2eZq/BDBqNO4J7N0ucc0B9K0GlFk X-Received: by 2002:a05:6a20:2452:b0:1af:f514:6d96 with SMTP id adf61e73a8af0-1b2f97d71fbmr903737637.16.1717709269331; Thu, 06 Jun 2024 14:27:49 -0700 (PDT) Received: from dev0.. ([49.43.162.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-703fd3b2d17sm1506964b3a.84.2024.06.06.14.27.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 14:27:48 -0700 (PDT) From: Abhinav Jain To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: skhan@linuxfoundation.org, javier.carrasco.cruz@gmail.com, jain.abhinav177@gmail.com Subject: [PATCH] selftests: net: Add on/off checks for network interface non fixed features Date: Thu, 6 Jun 2024 21:27:14 +0000 Message-Id: <20240606212714.27472-1-jain.abhinav177@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This patch addresses the present TODO in the file. I have tested it manually on my system and added relevant filtering to ensure that the correct feature list is being checked. Signed-off-by: Abhinav Jain --- tools/testing/selftests/net/netdevice.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/netdevice.sh b/tools/testing/selftests/net/netdevice.sh index e3afcb424710..cbe2573c3827 100755 --- a/tools/testing/selftests/net/netdevice.sh +++ b/tools/testing/selftests/net/netdevice.sh @@ -117,14 +117,31 @@ kci_netdev_ethtool() return 1 fi - ethtool -k "$netdev" > "$TMP_ETHTOOL_FEATURES" + ethtool -k "$netdev" | tail -n +2 > "$TMP_ETHTOOL_FEATURES" if [ $? -ne 0 ];then echo "FAIL: $netdev: ethtool list features" rm "$TMP_ETHTOOL_FEATURES" return 1 fi echo "PASS: $netdev: ethtool list features" - #TODO for each non fixed features, try to turn them on/off + + for feature in $(grep -v fixed "$TMP_ETHTOOL_FEATURES" | \ + awk '{print $1}' | sed 's/://'); do + ethtool --offload "$netdev" "$feature" off + if [ $? -eq 0 ]; then + echo "PASS: $netdev: Turned off feature: $feature" + else + echo "FAIL: $netdev: Failed to turn off feature: $feature" + fi + + ethtool --offload "$netdev" "$feature" on + if [ $? -eq 0 ]; then + echo "PASS: $netdev: Turned on feature: $feature" + else + echo "FAIL: $netdev: Failed to turn on feature: $feature" + fi + done + rm "$TMP_ETHTOOL_FEATURES" kci_netdev_ethtool_test 74 'dump' "ethtool -d $netdev" -- 2.34.1