diff mbox series

[net-next,12/13] selftests: ncdevmem: Move ncdevmem under drivers/net

Message ID 20240912171251.937743-13-sdf@fomichev.me (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series selftests: ncdevmem: Add ncdevmem to ksft | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success Errors and warnings before: 2 this patch: 1
netdev/cc_maintainers warning 2 maintainers not CCed: shuah@kernel.org linux-kselftest@vger.kernel.org
netdev/build_clang success Errors and warnings before: 17 this patch: 17
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 22 this patch: 22
netdev/checkpatch warning WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest warning net-next-2024-09-13--00-00 (tests: 536)

Commit Message

Stanislav Fomichev Sept. 12, 2024, 5:12 p.m. UTC
This is where all the tests that depend on the HW functionality live in
and this is where the automated test is gonna be added in the next
patch.

Cc: Mina Almasry <almasrymina@google.com>
Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
---
 tools/testing/selftests/drivers/net/.gitignore       | 1 +
 tools/testing/selftests/drivers/net/Makefile         | 9 +++++++++
 tools/testing/selftests/{ => drivers}/net/ncdevmem.c | 0
 tools/testing/selftests/net/.gitignore               | 1 -
 tools/testing/selftests/net/Makefile                 | 9 ---------
 5 files changed, 10 insertions(+), 10 deletions(-)
 create mode 100644 tools/testing/selftests/drivers/net/.gitignore
 rename tools/testing/selftests/{ => drivers}/net/ncdevmem.c (100%)

Comments

Mina Almasry Sept. 13, 2024, 3:38 p.m. UTC | #1
On Thu, Sep 12, 2024 at 10:13 AM Stanislav Fomichev <sdf@fomichev.me> wrote:
>
> This is where all the tests that depend on the HW functionality live in

Is this true? My impression is that selftests/net verifies core
functionality and drivers/net verifies more lower level driver
(specific?) functionality. There are tests in selftests/net that
depend on HW functionality, I think like bpf_offload.py.

devmem tcp in my mind is primarily a core functionality and a lot of
effort was put into making the driver bits of it as minimal as
possible. Is there a need to move it or is this preference?
Stanislav Fomichev Sept. 13, 2024, 5:19 p.m. UTC | #2
On 09/13, Mina Almasry wrote:
> On Thu, Sep 12, 2024 at 10:13 AM Stanislav Fomichev <sdf@fomichev.me> wrote:
> >
> > This is where all the tests that depend on the HW functionality live in
> 
> Is this true? My impression is that selftests/net verifies core
> functionality and drivers/net verifies more lower level driver
> (specific?) functionality. There are tests in selftests/net that
> depend on HW functionality, I think like bpf_offload.py.
> 
> devmem tcp in my mind is primarily a core functionality and a lot of
> effort was put into making the driver bits of it as minimal as
> possible. Is there a need to move it or is this preference?

I'm wrong and it is actually drivers/net/hw, not drivers/net. But yes,
the driver/net/hw is the directory for the tests that depend on some
HW functionality (NIPA doesn't run the tests in this directory; but
the vendors eventually will). And until/if we get to loopback mode [1],
there is no way to run ncdevmem without special HW :-(

1: https://lore.kernel.org/netdev/20240913150913.1280238-5-sdf@fomichev.me/T/#m4fc52463857c19ad432db656c433cffdf74477a4
diff mbox series

Patch

diff --git a/tools/testing/selftests/drivers/net/.gitignore b/tools/testing/selftests/drivers/net/.gitignore
new file mode 100644
index 000000000000..e9fe6ede681a
--- /dev/null
+++ b/tools/testing/selftests/drivers/net/.gitignore
@@ -0,0 +1 @@ 
+ncdevmem
diff --git a/tools/testing/selftests/drivers/net/Makefile b/tools/testing/selftests/drivers/net/Makefile
index 39fb97a8c1df..bb8f7374942e 100644
--- a/tools/testing/selftests/drivers/net/Makefile
+++ b/tools/testing/selftests/drivers/net/Makefile
@@ -11,4 +11,13 @@  TEST_PROGS := \
 	stats.py \
 # end of TEST_PROGS
 
+# YNL files, must be before "include ..lib.mk"
+EXTRA_CLEAN += $(OUTPUT)/libynl.a $(OUTPUT)/ncdevmem
+YNL_GEN_FILES := ncdevmem
+TEST_GEN_FILES += $(YNL_GEN_FILES)
+
 include ../../lib.mk
+
+# YNL build
+YNL_GENS := ethtool netdev
+include ../../net/ynl.mk
diff --git a/tools/testing/selftests/net/ncdevmem.c b/tools/testing/selftests/drivers/net/ncdevmem.c
similarity index 100%
rename from tools/testing/selftests/net/ncdevmem.c
rename to tools/testing/selftests/drivers/net/ncdevmem.c
diff --git a/tools/testing/selftests/net/.gitignore b/tools/testing/selftests/net/.gitignore
index 1c04c780db66..923bf098e2eb 100644
--- a/tools/testing/selftests/net/.gitignore
+++ b/tools/testing/selftests/net/.gitignore
@@ -17,7 +17,6 @@  ipv6_flowlabel
 ipv6_flowlabel_mgr
 log.txt
 msg_zerocopy
-ncdevmem
 nettest
 psock_fanout
 psock_snd
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index 9c970e96ed33..22a5d6a7c3f3 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -97,11 +97,6 @@  TEST_PROGS += fq_band_pktlimit.sh
 TEST_PROGS += vlan_hw_filter.sh
 TEST_PROGS += bpf_offload.py
 
-# YNL files, must be before "include ..lib.mk"
-EXTRA_CLEAN += $(OUTPUT)/libynl.a
-YNL_GEN_FILES := ncdevmem
-TEST_GEN_FILES += $(YNL_GEN_FILES)
-
 TEST_FILES := settings
 TEST_FILES += in_netns.sh lib.sh net_helper.sh setup_loopback.sh setup_veth.sh
 
@@ -111,10 +106,6 @@  TEST_INCLUDES := forwarding/lib.sh
 
 include ../lib.mk
 
-# YNL build
-YNL_GENS := ethtool netdev
-include ynl.mk
-
 $(OUTPUT)/epoll_busy_poll: LDLIBS += -lcap
 $(OUTPUT)/reuseport_bpf_numa: LDLIBS += -lnuma
 $(OUTPUT)/tcp_mmap: LDLIBS += -lpthread -lcrypto