Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1163453lqs; Fri, 14 Jun 2024 18:50:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVo0vA2mEAP1EkXyGIzLFJi4sG5TqUVrVZDftR7OQ8pn6tzfi0950QafK6fpd4hF3FIwqnIodTOOAXiMSTvs3gCXIy7OZZOy7njQEBVHg== X-Google-Smtp-Source: AGHT+IF7kjt6WCbyvRgLC77YFjLT2+ZLdLGAOqeMx8nnGTzWsEXX9wURcOu4yfJVmBeWoyMoOdZq X-Received: by 2002:a17:906:a213:b0:a6f:e1f:8190 with SMTP id a640c23a62f3a-a6f60d41703mr312002066b.44.1718416220760; Fri, 14 Jun 2024 18:50:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718416220; cv=pass; d=google.com; s=arc-20160816; b=WkGHc5frYCAVgQk2edV3o+zaGeomRPRB75zDl/GGnNcrbtIipP1qzmix3qzfmADoYB eYRnxNhepp7F/O0tZ9bwGEq9XzBV7XuPDygmx/zdxLl359hFYt1T8BbpCY0DXzvQMC8O IgK26+BBnhtV8t/xEN7sCKpFH/cW+VbRAui5ZUXnzoN4LIwQVgwEKSvV1R5L0/TBnzEe vLLBXRaul1Rho3SjJLBr1UtG44Pry9m5NPE/bi8C0Iw5MWfnG0Lm0NJ+EFGOO5B7dlxQ pcRHcv3lAqBHqaRIbxnHEjGt/xV//MRsuHwmDNMmtwcy59BeZ8NmqOpNQDqH0E72rFEj gSBw== 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:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=H95JbpUfPvmMmnuMecQXKiZjt94xXvhhCxq/sXoMvdc=; fh=PeWwbp8HR3DRYCISBBEKCxoVDvs9WmmvMAtz+XZ+4kI=; b=BPA899KySQJY+V3LAxjLOt3XJCiA8cYAEMeKG4OFLU6WoHwWKz7QuXGwOG0GmmGmXH 5Zo3zAK1G6+Zzb/Y3gt2RiwqbN/MlQspAMS3cOr1JpTMtIgAIzjauXu8CZoHnn3Idxs8 n4cmwXF2f/A3n8kx999akNGe8CNlrtUbe6eUPqzWq7/NX7E6F1EcM7nLCfBAWpppcrHm HPOl7WUOUdzTwJ3s7tFnIqIJRUhk1IF8TDwxUC5rS+ZMi0OXY6GSr77acMYHs7NYrazo ckuhcvg/yALHFQnwmbA3+DgN43vdLRqbwv6wVHQIGlo9Mk0lJ5/NmirxNFD9UWrJ9ObS qp/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=So3+g9Gh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215640-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215640-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56e26d51si223314766b.739.2024.06.14.18.50.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 18:50:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215640-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=So3+g9Gh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215640-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215640-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 721BB1F23764 for ; Sat, 15 Jun 2024 01:50:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 73CAE53A7; Sat, 15 Jun 2024 01:50:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="So3+g9Gh" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90DA41C2E; Sat, 15 Jun 2024 01:50:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718416209; cv=none; b=imqBSjnyzft1NUswN2YtjhzZrvQf/p9iSpOEz1FSCUTQ4b3M9yNbd6K9FK3YsAzkwGfYb+qPbCWUJ0Fxc6MBIetqstn1/Sh5n+g9cTTFg6dGE/nIo6hZE5lcSaGHwFr94KvpdRfDvyEDMuzM+e8qWqKtIKuTjxfHcGIa5CM5P1o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718416209; c=relaxed/simple; bh=tFlDY76kDC9E0mU7n/GrN42HtoZ9U0s1OHQi9+QON7c=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GVcnC4HbxD7gcp/PqXpSy0nm8g+s980cBgc04MHMlL4efMwv6fpIKrWg14Mb+JbQJLqY798mldwmdyV5F0oMGkv9qBrY47I+VTABYFQfaYV5PyQmNsltq1Kbm5rF5/FJSc+nxvcp1skCRlVVAWvbG06o8F/Nrt04S0o9CUtUDd8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=So3+g9Gh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5B61C2BD10; Sat, 15 Jun 2024 01:50:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718416209; bh=tFlDY76kDC9E0mU7n/GrN42HtoZ9U0s1OHQi9+QON7c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=So3+g9GhfAcH0wNdoUIsjXg9thhCFqBnhxcpBoXtVCpnT1Xz1KMaL5boepAW3NnET pfHecvo8JwrDdMqZgmA8vSOzEoeVAxE0XYs30NrfIwKGAehSORksghJfJdELHApP2u kZENaGskhQDnpeIjd1HRcXsWEauyLpINFgp9PXw9la5dtC0DR3xHKQJ4eiA7k9dbk7 xMqqzaD+zsVclacDIhI7U/h0IxAlUiv3BNZwbrKxOc33g/bfXDwV+mGGvO/FfBnfAG euK0TvNrb3mrEpyqwPtaTO90l9TBW28kWLVOj6QDwIZl4AuKHsY47SWEOskqmjMSaj Wgfi0CTf8Fviw== Date: Fri, 14 Jun 2024 18:50:07 -0700 From: Jakub Kicinski To: Abhinav Jain Cc: horms@kernel.org, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, shuah@kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, skhan@linuxfoundation.org, javier.carrasco.cruz@gmail.com Subject: Re: [PATCH v3] sefltests: net: Add on/off checks for network interface non fixed features Message-ID: <20240614185007.36ef425a@kernel.org> In-Reply-To: <20240614113240.41550-1-jain.abhinav177@gmail.com> References: <20240614113240.41550-1-jain.abhinav177@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 14 Jun 2024 11:32:40 +0000 Abhinav Jain wrote: > This patch addresses the TODO (add non fixed feature on/off check). > I have tested it manually on my system after making changes as suggested > in v1 and v2 linked below for reference. > Patch now restores the features being tested to their initial state. Can you separate the features on/off and auto-adding veth into two commits/patches? Then send them as a series? > diff --git a/tools/testing/selftests/net/netdevice.sh b/tools/testing/selftests/net/netdevice.sh > index e3afcb424710..d937d39dda6a 100755 > --- a/tools/testing/selftests/net/netdevice.sh > +++ b/tools/testing/selftests/net/netdevice.sh > @@ -104,6 +104,20 @@ kci_netdev_ethtool() > { > netdev=$1 > > + #check if netdev is provided as an argument > + if [ -z "$netdev" ]; then > + echo "No network device provided, creating a veth pair" > + ip link add veth0 type veth peer name veth1 > + netdev="veth0" > + veth_created=1 > + else > + #check if the provided netdev exists > + if ! ip link show "$netdev" > /dev/null 2>&1; then > + echo "Network device $netdev does not exist." > + return 1 > + fi > + fi I don't think this will work, since the function won't get called at all if there is no netdev. You need to do the auto-adding around the while read netdev loop. To test locally you can use network namespaces, or build and boot a network-less kernel using vng: https://github.com/linux-netdev/nipa/wiki/How-to-run-netdev-selftests-CI-style