mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: hangbin.liu@linux.dev
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, shuah@kernel.org,
	jv@jvosburgh.net, olteanv@gmail.com, leitao@debian.org,
	jiri@resnulli.us, mst@redhat.com, jasowangio@gmail.com,
	xuanzhuo@linux.alibaba.com, eperezma@redhat.com,
	petrm@nvidia.com, matttbe@kernel.org, netdev@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux.dev, liuhangbin@kylinos.cn
Subject: Re: [PATCH net] selftests/drivers/net: include lib/sh/*.sh
Date: Tue, 08 Sep 2026 07:29:16 +0000	[thread overview]
Message-ID: <178885255602.219967.561231920123759325@kernel.org> (raw)
In-Reply-To: <20260907-selftest_lib_defer-v1-1-8af94645aaa3@kylinos.cn>

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider:

Critical: 0 · High: 0 · Medium: 1 · Low: 0

- [Medium] Incomplete fix:
  `tools/testing/selftests/drivers/net/netdevsim/Makefile` is the only…

--

selftests/drivers/net: include lib/sh/*.sh

This adds $(wildcard ../../net/lib/sh/*.sh) to TEST_INCLUDES in the
drivers/net selftest Makefiles so that net/lib/sh/defer.sh gets installed
by "make install", and sorts the TEST_INCLUDES lists while at it.

> diff --git a/tools/testing/selftests/drivers/net/Makefile b/tools/testing/selftests/drivers/net/Makefile
> index d5bf4cb638a8c..ab39c2e508f0a 100644
> --- a/tools/testing/selftests/drivers/net/Makefile
> +++ b/tools/testing/selftests/drivers/net/Makefile
> @@ -3,6 +3,7 @@ CFLAGS += $(KHDR_INCLUDES)
>  
>  TEST_INCLUDES := $(wildcard lib/py/*.py) \
>  		 $(wildcard lib/sh/*.sh) \
> +		 $(wildcard ../../net/lib/sh/*.sh) \
>  		 ../../net/lib.sh \
>  
>  TEST_GEN_FILES := \

[Severity: Medium]
Was drivers/net/netdevsim intentionally left out?  It is the only Makefile
under tools/testing/selftests/drivers/net/ that this patch does not touch,
and it defines no TEST_INCLUDES at all:

tools/testing/selftests/drivers/net/netdevsim/Makefile:
	TEST_PROGS := \
		devlink.sh \
		...
		peer.sh \
		...
	# end of TEST_PROGS

	TEST_FILES := \
		ethtool-common.sh
	# end of TEST_FILES

	include ../../../lib.mk

Its installed scripts do consume the net shell libraries.  peer.sh does:

	lib_dir=$(dirname $0)/../../../net
	source $lib_dir/lib.sh

and devlink.sh, devlink_in_netns.sh, devlink_trap.sh, fib.sh,
fib_notifications.sh, hw_stats_l3.sh, nexthop.sh and psample.sh do:

	lib_dir=$(dirname $0)/../../../net/forwarding
	source $lib_dir/lib.sh

which reaches net/lib.sh, and that unconditionally sources defer.sh:

tools/testing/selftests/net/lib.sh:
	net_dir=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")
	source "$net_dir/lib/sh/defer.sh"

There is also no automatic fallback for this target, since the top-level
Makefile only matches the exact strings net, drivers/net and
drivers/net/hw:

tools/testing/selftests/Makefile:
	# Networking tests want the net/lib target, include it automatically
	ifneq ($(filter net drivers/net drivers/net/hw,$(TARGETS)),)
	ifeq ($(filter net/lib,$(TARGETS)),)
		INSTALL_DEP_TARGETS := net/lib
	endif
	endif

So does the failure quoted in the changelog still reproduce with:

	make INSTALL_PATH=/tmp/kself TARGETS=drivers/net/netdevsim \
		-C tools/testing/selftests install

The commit message says the patch "adds a wildcard to include all shell
files for drivers/net tests that consume net lib.sh" — should that claim be
narrowed, or netdevsim covered too?

Note the gap in netdevsim is wider than defer.sh: adding only
$(wildcard ../../../net/lib/sh/*.sh) would not be enough, since
../../../net/lib.sh and ../../../net/forwarding/lib.sh are not installed
either (plus devlink_lib.sh, fib_offload_lib.sh and tc_common.sh, which
several of those scripts source).

For reference, drivers/net/dsa is also not in the default TARGETS list and
this patch does cover it, and drivers/net/{mlxsw,ocelot,microchip} have no
Makefile so they are not installable targets at all.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260907-selftest_lib_defer-v1-1-8af94645aaa3%40kylinos.cn

  parent reply	other threads:[~2026-09-08  7:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07  7:28 Hangbin Liu
2026-09-07  8:55 ` Petr Machata
2026-09-07 12:05 ` Breno Leitao
2026-09-07 15:14 ` Matthieu Baerts
2026-09-08  7:29 ` netdev-bot+sashiko [this message]
2026-09-08  8:26   ` Hangbin Liu
2026-09-09  0:40 ` patchwork-bot+netdevbpf

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=178885255602.219967.561231920123759325@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eperezma@redhat.com \
    --cc=hangbin.liu@linux.dev \
    --cc=jasowangio@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=jv@jvosburgh.net \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=liuhangbin@kylinos.cn \
    --cc=matttbe@kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=shuah@kernel.org \
    --cc=virtualization@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.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

all inboxes | Powered by JetHome®