From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 0383B80067 for ; Thu, 24 Sep 2026 13:24:47 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 68ODNRXK016467; Thu, 24 Sep 2026 16:23:28 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68ODNRXK016467 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="c6sqM8Cj" Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 68ODNPiu016463 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 24 Sep 2026 16:23:25 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68ODNPiu016463 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-486f3dbf7d2so1855769f8f.0 for ; Thu, 24 Sep 2026 06:23:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvByH3OzaeS/fSjIkstG2sKpr5Htp8rVBHB/6bj9jw4PKPhWlA8t+wyz6ix0VXJT/c/kdQpO63w==@openvz.org X-Gm-Message-State: AFuF++k22snUH68JYGI5t+KnSce3YuMCtukYCBJEIHnKM0jXNY8RaP45 vvdV/lanmIz5kf/Mqz4tzWTZQZEo6+q18zGvF4ffWiAgkO3SzKrD299X4ZYmOeTQsaN2vCS3+C7 VfkHYl44XULVPnVuxtMMTdEr60Yjxwd7JZAaLtsWiH9Sy5FdP1SzNnQ== X-Gm-Gg: AYBFou0Cet6+kBtPHEW5wTLe1Gj06J/1p2K9gG3l5DPvwyD0Bzq3RCrkO3X7+vcqbQM RbPrln2GGmzsCNDaYT8Xcgg3fNaHSoZ+Y65Sqdn7Lj7A7SO1kWMB0edqJ/tqmDo26YbxWuCFecv HUPQSXMYnbnqSi3gh70kL8W1/sGBO/pBcCnQKtEZXl6KrI5E1wceVn3EOlSgvN4OkBzjMcUwR++ wQjMXwmbGBMbMjc3DYegCkECscvU2qkvlSLPc/U5B5kV0/vnSjogNlE1z+WWe6mMOSpiZ1uYk0t 14E34GQ1l5BFfNGq/GO3h2OFhyyRM91Uykq+WOf6wpLvB6yhC7fH136Yc78NZLrDr69PDfJRaa5 37jBA4obuAAKX/9512A== X-Received: by 2002:a05:6000:2885:b0:487:834:9307 with SMTP id ffacd0b85a97d-48871973efbmr4406489f8f.50.1790256204942; Thu, 24 Sep 2026 06:23:24 -0700 (PDT) X-Received: by 2002:a05:6000:2885:b0:487:834:9307 with SMTP id ffacd0b85a97d-48871973efbmr4406437f8f.50.1790256204291; Thu, 24 Sep 2026 06:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1790256204; cv=none; d=google.com; s=arc-20260327; b=X2F0JAy22fL7UC7uEy+Ag8T2/5Ishr9eBSMHgpLzx0sNmCc8BT8uKNvIRakwJNy+hi nMzVbAN45/xQ5MjUnQy8jbMpjQNcIRbt9hPgZYlCwdsAdvtc8RZPK25QaAALfV3QZV/t daY5H+pmItyVI+PBfPTO+Zv5dvnDRdQrJt0d9jAsA+ikAJOmteCh6tnXZF0CMjjiWciP YTdRlu4XQakVjUuSuhq5tWEx3xRwBhPgxkhkbrU72SuX3BAi3myRs7KEiy4Ub+BNgYPm 4tX3ntxCkID9pR+JvDS7UZxyEXD3QXgyPfB3TWMapmFyyCBD3IxRvXN5mL9JMbIWYZF0 PRRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:mime-version:dkim-signature; bh=5c6GWhNI4WezWk4+davRxx3HytBr47tjjBRzadcZeSo=; fh=CTF2GHyV+XdzB5TROrdG4fdLri6JSHNOBC+LNuNq5bA=; b=joKrGRTQYKNEZyKpd3tGWXzPf8Qk+V8XWGps4pT6LM0mN20+KYyW/JNXZWxCfKLAi4 46TEZEFe5fbdVaO3yg0msuqi7jUkWpxgPxpx1S1DBpFIrDd//96uOhjQu7lS9t8/NwW5 efwD7hDCvGJGw+BvXrzJU8Ll3OpOAgXziGfztythjoLcbPYFWpZC5eiQW8INoVBzh1DP 5Xhebti0TswZhvVK61NtsiRiQVbo60f2u8IV3RAkaTNTrc2nktniti4l5Q5ZCX4Xs3zO CmhVACv6pW3soJJkPrUqUJhkYbvcKR9mYv4Iw/YLDRBLIHfsAHp2epLa8YdHwLFUSb+g clvQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=c6sqM8Cj; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-4886f6bb827si5666264f8f.400.2026.09.24.06.23.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 06:23:24 -0700 (PDT) Received-SPF: pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=c6sqM8Cj; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Date:From:Subject:Content-Type: MIME-Version; bh=5c6GWhNI4WezWk4+davRxx3HytBr47tjjBRzadcZeSo=; b=c6sqM8CjKcAF n6IOdzP2vjSafRh2vfnBRejDTv6JMEMMr6mZJHTtip8IIdQr7zoL8JjQO/VXf/Dwu0odOFcrdMjnT YrzGXPtXbnUHn//9US3fGfG8rQVblj78m+Q9ok2Fk8PMvH8DoICxjSA+n7onGe1mXQPyY+iiKLEGH rPSs770Vcnq7Bri4DRq5N+9XQ2MEP106IlZscsgqUSPcXwMfPKbdVS0OeaKtpOcfVS7DguISGjTXH Gi17Kf1Z2NLxKbwcItPBRz5syOnXURmo4jaTZBt32JPiRJmkOew9CzIDZ+lA8CeyCqNmplJgFGKmN OnDWimuqty4q5G1lLa4X7Q==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1x9jN7-00FJKV-0b; Thu, 24 Sep 2026 15:23:21 +0200 MIME-Version: 1.0 From: Konstantin Khorenko To: Eva Kurchatova In-Reply-To: <20260831225137.1642608-4-eva.kurchatova@virtuozzo.com> References: <20260831225137.1642608-1-eva.kurchatova@virtuozzo.com> <20260831225137.1642608-4-eva.kurchatova@virtuozzo.com> Date: Thu, 24 Sep 2026 15:23:20 +0200 Message-Id: <179025620086.3205218.16213268269189225766.b4-review@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6658; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=8Yn1UEfkWZOwXoX0JwLRtIVvLODnBPHF8ed1kTTN9FA=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBqtSRLIAz6FU4sgU1rntm94JGPzDs5bgdgz1odX C6nF1MUtFCJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCarUkSwAKCRBRlgpH+WFc Klj+D/0ezQPndmpnNF8kASfV8NI40lC99+uAPU3PY+hdKaHFy5ZKfSf2iArf/udGGlADFfgSjB6 DhgS8Hui17z+PExlwFKOir4K1lBxXBykXJBZkTvhzx72ooxZtfcqgyW2/ebSyRhDauwa0Ba/9ca hW9v1VKjifHCU58pXvB/PeoKriIOuorPRBqg0BuW4IEY1Lu7MeJNiNEpdsmKnctlnBjKviHITNF AU91kCGB+dShaFQWAQs9+LUspj0mz3EKu2EHcxNfJpCD/V4ozTy25D6J4XPReH7Py99yXbleUBW xJ2HRx/eQ8rVHN1py4yhLzHj+emQ3e3eqsh2DvOxArq6O0eItTp8SPdagdoku7C9GCvidHccJQg rkes1L2pTEdtmIISCiBw0TzyPj5FaxUDN912MRkQsr236HxZx0uwokr2hpkeHmcN3YcaQS1xThl b1k2v5dT2A/+dS9TL2dis72TjwIAm1FbLBcChRnbkXibcFXmrPilDA23l/GA9Fq2GPYNEbIh5W7 udrJjOqXDPq/f2J+6C9xgIg7ISyQhTiCS34cPeNR+04I3LLJoo8Hgh7adAavWnxSTkzS4GUOKcT 85CGGjhNHWQI1zgd/jpTJKpp0qw9n849SWNSoayLfwtgKtrp5x3tle5EnE+zQH/TRHmc/BtfBkO cBumoXKFDKKORXw== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: devel@openvz.org Subject: Re: [Devel] [PATCH vz10 4/4] selftests: drv-net-hw: skip the tests that need a real interface X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org > ethtool, ethtool_extended_state, hw_stats_l3 and hw_stats_l3_gre need a > device that can set link speed and autonegotiation, report an extended > link state, or offload L3 statistics. Where none is configured, lib.sh > creates a veth pair instead, which supports none of that, so every case > fails on something the kernel correctly refuses. > > Upstream answers this by keeping such tests in drivers/net/hw and not > running them on veth at all: commit 0c499a351777 ("selftests: > forwarding: Ditch skip_on_veth()") removed the equivalent check once the > directory was split out. This guard is therefore not for upstream, it > only stops a run that substitutes veth pairs from reporting failures. > > Skip before sourcing lib.sh, because lib.sh makes the veth pair as it is > sourced. Exiting afterwards leaves the devices behind - vrf_cleanup() > removes them and a test that skips never gets there - and a later test > that adds a veth by one of those names then cannot. hw_stats_l3_gre > asks for six interfaces, so one run left veth0 to veth5 in the initial > namespace and the netfilter suite failed on it. > > https://virtuozzo.atlassian.net/browse/VSTOR-139651 > Feature: fix selftests > Signed-off-by: Eva Kurchatova > > diff --git a/tools/testing/selftests/drivers/net/hw/ethtool.sh b/tools/testing/selftests/drivers/net/hw/ethtool.sh > index fa6953de6b6dd..b1744758627c2 100755 > --- a/tools/testing/selftests/drivers/net/hw/ethtool.sh > +++ b/tools/testing/selftests/drivers/net/hw/ethtool.sh > @@ -11,6 +11,22 @@ ALL_TESTS=" > " > NUM_NETIFS=2 > lib_dir=$(dirname "$0") > + > +# The test needs a device capable of setting link speed and > +# autonegotiation. Where no real interfaces are configured, lib.sh makes > +# a veth pair instead, which cannot, and every case then fails on > +# something the kernel correctly refuses. Check this before sourcing > +# lib.sh: it creates that pair as it is sourced, so exiting afterwards > +# leaves the devices behind, and the next test that wants one of those > +# names cannot create it. This is the commit message pasted into the test, four times. The rationale belongs in the commit message only. In the code one line is enough, something like: > + > +: "${NETIF_CREATE:=yes}" > +: "${NETIF_TYPE:=veth}" > +if [[ "$NETIF_CREATE" = yes && "$NETIF_TYPE" = veth ]]; then > + echo "SKIP: needs a real interface, set NETIFS in forwarding.config" > + exit 4 # ksft_skip, lib.sh is not sourced yet > +fi > + > source "$lib_dir"/../../../net/forwarding/lib.sh > source ethtool_lib.sh > > diff --git a/tools/testing/selftests/drivers/net/hw/ethtool_extended_state.sh b/tools/testing/selftests/drivers/net/hw/ethtool_extended_state.sh > index a7584448416ea..c6c96117b1f12 100755 > --- a/tools/testing/selftests/drivers/net/hw/ethtool_extended_state.sh > +++ b/tools/testing/selftests/drivers/net/hw/ethtool_extended_state.sh > @@ -9,6 +9,22 @@ ALL_TESTS=" > > NUM_NETIFS=2 > lib_dir=$(dirname "$0") > + > +# The test needs a device capable of reporting an extended link state. > +# Where no real interfaces are configured, lib.sh makes a veth pair > +# instead, which cannot, and every case then fails on something the > +# kernel correctly refuses. Check this before sourcing lib.sh: it > +# creates that pair as it is sourced, so exiting afterwards leaves the > +# devices behind, and the next test that wants one of those names cannot > +# create it. > + > +: "${NETIF_CREATE:=yes}" > +: "${NETIF_TYPE:=veth}" > +if [[ "$NETIF_CREATE" = yes && "$NETIF_TYPE" = veth ]]; then > + echo "SKIP: needs a real interface, set NETIFS in forwarding.config" > + exit 4 # ksft_skip, lib.sh is not sourced yet > +fi > + > source "$lib_dir"/../../../net/forwarding/lib.sh > source ethtool_lib.sh > > diff --git a/tools/testing/selftests/drivers/net/hw/hw_stats_l3.sh b/tools/testing/selftests/drivers/net/hw/hw_stats_l3.sh > index 67fafefc80bea..1776a4954601b 100755 > --- a/tools/testing/selftests/drivers/net/hw/hw_stats_l3.sh > +++ b/tools/testing/selftests/drivers/net/hw/hw_stats_l3.sh > @@ -49,6 +49,22 @@ ALL_TESTS=" > " > NUM_NETIFS=4 > lib_dir=$(dirname "$0") > + > +# The test needs a device capable of offloading L3 statistics. Where no > +# real interfaces are configured, lib.sh makes a veth pair instead, > +# which cannot, and every case then fails on something the kernel > +# correctly refuses. Check this before sourcing lib.sh: it creates that > +# pair as it is sourced, so exiting afterwards leaves the devices > +# behind, and the next test that wants one of those names cannot create > +# it. > + > +: "${NETIF_CREATE:=yes}" > +: "${NETIF_TYPE:=veth}" > +if [[ "$NETIF_CREATE" = yes && "$NETIF_TYPE" = veth ]]; then > + echo "SKIP: needs a real interface, set NETIFS in forwarding.config" > + exit 4 # ksft_skip, lib.sh is not sourced yet > +fi > + The check does not see forwarding.config. lib.sh sets these defaults (lib.sh:54-55), then sources net/forwarding/forwarding.config (lib.sh:126), and only then creates the interfaces (lib.sh:433). Here lib.sh has not been sourced yet, so the config file has not been read and the two variables fall back to yes/veth unless they are exported in the environment. So a user who does what the SKIP line tells them to, puts real NETIFS into forwarding.config and sets NETIF_CREATE=no there, still gets the skip: on real hardware all four tests never run. Only an exported NETIF_CREATE=no would get past it, and forwarding.config is not sourced into the environment anywhere. Read the same file lib.sh reads before deciding: forwarding_dir=$lib_dir/../../../net/forwarding [[ -f $forwarding_dir/forwarding.config ]] && \ source "$forwarding_dir/forwarding.config" : "${NETIF_CREATE:=yes}" : "${NETIF_TYPE:=veth}" Since the same block goes into four files, put it into a small helper next to ethtool_lib.sh and source that before lib.sh, instead of copying it. > source "$lib_dir"/../../../net/forwarding/lib.sh > source "$lib_dir"/../../../net/forwarding/tc_common.sh > Two more notes on the set of tests: ethtool_rmon.sh in the same directory reads rmon histogram counters via "ethtool -S --groups rmon" and has no skip of its own, so on veth it fails the same way. If it fails in your runs too, it belongs in this patch. ethtool_mm.sh and loopback.sh already skip by themselves. The reference to 0c499a351777 is correct and the "why not upstream" paragraph is useful, keep it. -- Konstantin Khorenko _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel