OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: no-reply@sashiko.virtuozzo.com
To: Eva Kurchatova <eva.kurchatova@virtuozzo.com>, khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v5 1/1] selftests: drv-net-hw: skip the tests that need a real interface
Date: Fri, 23 Oct 2026 19:25:46 +0000	[thread overview]
Message-ID: <010701a16a39f7e9-54fa1894-3cdb-4114-ac8a-424bf293d4eb-000000@eu-central-1.amazonses.com> (raw)
In-Reply-To: <20261023192121.356062-2-eva.kurchatova@virtuozzo.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] selftests: skip_on_veth() skips explicit veth setups with misleading advice
- [Low] selftests: skip_on_veth() honours NETIF_FIND_DRIVER set only in forwarding.config
--

commit 8d2d6696991f9f7d35e072ffc95cdbdbfc7bbe48
Author: Eva Kurchatova <eva.kurchatova@virtuozzo.com>

selftests: drv-net-hw: skip the tests that need a real interface

This adds a skip_on_veth() helper. The ethtool, ethtool_extended_state,
ethtool_rmon, hw_stats_l3 and hw_stats_l3_gre tests call it before sourcing
lib.sh. The helper skips the test when the first interface is a veth, or
when lib.sh would create a veth pair.

> diff --git a/tools/testing/selftests/drivers/net/hw/skip_on_veth.sh b/tools/testing/selftests/drivers/net/hw/skip_on_veth.sh
> new file mode 100644
> index 0000000000000..b65d474ac7b24
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/net/hw/skip_on_veth.sh

[ ... ]

> +skip_on_veth()
> +{
> +	# lib.sh takes the command line, then forwarding.config, then the driver
> +	local p1=${1:-${NETIFS[p1]-}}
> +	local kind
> +
> +	# lib.sh skips by itself when the driver has no interfaces
> +	[[ -z $p1 && -n $NETIF_FIND_DRIVER ]] && return

[Severity: Low]
Can this early return run the test on a veth pair that lib.sh creates?

skip_on_veth.sh sources forwarding.config at file scope, so
NETIF_FIND_DRIVER is non-empty here when only forwarding.config sets it,
and NETIFS[p1] is empty. The helper then returns without skipping.

lib.sh checks NETIF_FIND_DRIVER before it sources forwarding.config:

    : "${NETIF_FIND_DRIVER:=}"

    if [[ $NETIF_FIND_DRIVER ]]; then
        unset NETIFS
        declare -A NETIFS
        netif_find_driver
    fi

At that point the variable is empty unless it was exported in the
environment, so discovery is skipped. NETIFS keeps the default veth0..veth9.
forwarding.config is only sourced after that check, and nothing repeats it.

Then lib.sh reaches:

    if [[ "$NETIF_CREATE" = "yes" ]]; then
        create_netif
    fi

and the test runs on the auto-created veth pair and fails, which is the
failure this patch is meant to remove. The helper's comment says it should
keep in step with lib.sh, but it doesn't here. The environment and command
line cases look correct, so only the config-file-only case differs.

Should the early return only apply when NETIF_FIND_DRIVER is set the way
lib.sh will see it?

[ ... ]

> +	[[ $kind == veth ]] || return 0
> +	echo "SKIP: needs a real interface, set NETIFS in forwarding.config"
> +	exit 4 # ksft_skip, lib.sh is not sourced yet
> +}

[Severity: Low]
This isn't a functional bug, but is the SKIP message accurate in all cases
where it is printed?

The same message is printed when NETIFS[p1] or $1 already names an existing
veth. In that case the advice to set NETIFS in forwarding.config doesn't
apply, because it is already set.

Also, only p1 is checked. If p1 is a real interface and p2 or p3 is a veth,
skip_on_veth() returns 0 and the test still fails the way the patch tries to
avoid.

Could the message distinguish an explicitly named veth from the default
case, and could the other interfaces be checked as well?

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261023192121.356062-1-eva.kurchatova@virtuozzo.com?part=1

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  reply	other threads:[~2026-10-23 19:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23 19:20 [Devel] [PATCH hci-8.1 v5 0/1] " Eva Kurchatova
2026-10-23 19:20 ` [Devel] [PATCH hci-8.1 v5 1/1] " Eva Kurchatova
2026-10-23 19:25   ` no-reply [this message]
2026-10-26 12:19     ` Eva Kurchatova (Virtuozzo)
2026-10-27 12:00 ` [Devel] [PATCH hci-8.1 v5 0/1] " Konstantin Khorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=010701a16a39f7e9-54fa1894-3cdb-4114-ac8a-424bf293d4eb-000000@eu-central-1.amazonses.com \
    --to=no-reply@sashiko.virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=eva.kurchatova@virtuozzo.com \
    --cc=khorenko@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox