* [PATCH net-next v3] net: mctp: Make flow KUnit coverage an explicit opt-in
@ 2026-10-02 21:20 Karl Mehltretter
2026-10-08 2:11 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: Karl Mehltretter @ 2026-10-02 21:20 UTC (permalink / raw)
To: Jeremy Kerr, Matt Johnston
Cc: Karl Mehltretter, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, netdev, Geert Uytterhoeven,
Brendan Higgins, David Gow, Rae Moar, linux-kselftest, kunit-dev,
linux-kernel
MCTP_TEST selects MCTP_FLOWS, so KUNIT_ALL_TESTS builds flow support and
SKB_EXTENSIONS even when no transport needs them. KUnit's style guide
says tests should not select otherwise unused functionality. The CRC
and crypto library tests use explicit ENABLE_ALL_FOR_KUNIT options for
full coverage.
Remove the selection from MCTP_TEST. The core suite remains available
without flows; its two flow cases use their existing skip paths. Add
MCTP_ENABLE_ALL_FOR_KUNIT to opt into full coverage, and enable it in
all_tests.config and a dedicated net/mctp/.kunitconfig. Both profiles
run the flow cases without a hardware transport.
A plain MCTP_TEST=y configuration without the opt-in now skips those
two cases. This is the coverage cost of leaving otherwise unused flow
support disabled.
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
Changes in v3:
- Keep the core suite available without MCTP_FLOWS; a plain MCTP_TEST=y
configuration now skips only the two flow cases.
- Add MCTP_ENABLE_ALL_FOR_KUNIT to retain full coverage in
all_tests.config and a focused net/mctp/.kunitconfig.
- Drop the Fixes tag because this changes test configuration rather
than fixing a runtime MCTP bug.
v2: https://lore.kernel.org/r/20260928205352.30502-1-kmehltretter@gmail.com/
v1: https://lore.kernel.org/r/20260925192510.93840-1-kmehltretter@gmail.com/
Validation: The MCTP KUnit suites were built with GCC 15.2 and booted
under QEMU 10.2.1 on an isolated source export from net-next
014d795c7383, with the changed Kconfig files copied from 071876fd5048.
Without the opt-in, mctp-sock passed 5/5 tests and mctp-route passed
21/23 tests with two expected flow-case skips. With the opt-in, both
suites passed all 5 and 23 tests, respectively. On the full
071876fd5048 tree, the new net/mctp/.kunitconfig resolves all requested
symbols and selects MCTP_FLOWS and SKB_EXTENSIONS.
net/mctp/.kunitconfig | 5 +++++
net/mctp/Kconfig | 16 +++++++++++++++-
tools/testing/kunit/configs/all_tests.config | 2 +-
3 files changed, 21 insertions(+), 2 deletions(-)
create mode 100644 net/mctp/.kunitconfig
diff --git a/net/mctp/.kunitconfig b/net/mctp/.kunitconfig
new file mode 100644
index 000000000..4b2969e42
--- /dev/null
+++ b/net/mctp/.kunitconfig
@@ -0,0 +1,5 @@
+CONFIG_KUNIT=y
+CONFIG_NET=y
+CONFIG_MCTP=y
+CONFIG_MCTP_TEST=y
+CONFIG_MCTP_ENABLE_ALL_FOR_KUNIT=y
diff --git a/net/mctp/Kconfig b/net/mctp/Kconfig
index d8d3413a3..a89678428 100644
--- a/net/mctp/Kconfig
+++ b/net/mctp/Kconfig
@@ -12,9 +12,23 @@ menuconfig MCTP
devices, you'll want to enable a driver for a specific hardware
channel.
+config MCTP_ENABLE_ALL_FOR_KUNIT
+ bool "Enable all optional MCTP features for KUnit tests"
+ depends on MCTP=y && KUNIT=y
+ select MCTP_FLOWS
+ help
+ Enable all optional MCTP features covered by KUnit tests, even
+ when no transport needs them. Currently this selects MCTP_FLOWS
+ so the two flow cases can run.
+
+ Without this option, the core suite remains available; the flow
+ cases skip unless a transport enables flow support.
+
+ You still need to enable MCTP_TEST, either individually or through
+ KUNIT_ALL_TESTS.
+
config MCTP_TEST
bool "MCTP core tests" if !KUNIT_ALL_TESTS
- select MCTP_FLOWS
depends on MCTP=y && KUNIT=y
default KUNIT_ALL_TESTS
diff --git a/tools/testing/kunit/configs/all_tests.config b/tools/testing/kunit/configs/all_tests.config
index 31e930a0f..b3ea56f4e 100644
--- a/tools/testing/kunit/configs/all_tests.config
+++ b/tools/testing/kunit/configs/all_tests.config
@@ -26,7 +26,7 @@ CONFIG_GPIOLIB=y
CONFIG_NET=y
CONFIG_MCTP=y
-CONFIG_MCTP_FLOWS=y
+CONFIG_MCTP_ENABLE_ALL_FOR_KUNIT=y
CONFIG_INET=y
CONFIG_MPTCP=y
base-commit: 071876fd50482a68603a9460d80dd6dd58827ee1
--
2.39.5 (Apple Git-154)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH net-next v3] net: mctp: Make flow KUnit coverage an explicit opt-in
2026-10-02 21:20 [PATCH net-next v3] net: mctp: Make flow KUnit coverage an explicit opt-in Karl Mehltretter
@ 2026-10-08 2:11 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2026-10-08 2:11 UTC (permalink / raw)
To: Karl Mehltretter
Cc: Jeremy Kerr, Matt Johnston, David S. Miller, Eric Dumazet,
Paolo Abeni, Simon Horman, netdev, Geert Uytterhoeven,
Brendan Higgins, David Gow, Rae Moar, linux-kselftest, kunit-dev,
linux-kernel
On Fri, 2 Oct 2026 23:20:58 +0200 Karl Mehltretter wrote:
> MCTP_TEST selects MCTP_FLOWS, so KUNIT_ALL_TESTS builds flow support and
> SKB_EXTENSIONS even when no transport needs them. KUnit's style guide
> says tests should not select otherwise unused functionality. The CRC
> and crypto library tests use explicit ENABLE_ALL_FOR_KUNIT options for
> full coverage.
>
> Remove the selection from MCTP_TEST. The core suite remains available
> without flows; its two flow cases use their existing skip paths. Add
> MCTP_ENABLE_ALL_FOR_KUNIT to opt into full coverage, and enable it in
> all_tests.config and a dedicated net/mctp/.kunitconfig. Both profiles
> run the flow cases without a hardware transport.
>
> A plain MCTP_TEST=y configuration without the opt-in now skips those
> two cases. This is the coverage cost of leaving otherwise unused flow
> support disabled.
>
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
> ---
> Changes in v3:
> - Keep the core suite available without MCTP_FLOWS; a plain MCTP_TEST=y
> configuration now skips only the two flow cases.
> - Add MCTP_ENABLE_ALL_FOR_KUNIT to retain full coverage in
> all_tests.config and a focused net/mctp/.kunitconfig.
> - Drop the Fixes tag because this changes test configuration rather
> than fixing a runtime MCTP bug.
>
> v2: https://lore.kernel.org/r/20260928205352.30502-1-kmehltretter@gmail.com/
> v1: https://lore.kernel.org/r/20260925192510.93840-1-kmehltretter@gmail.com/
>
> Validation: The MCTP KUnit suites were built with GCC 15.2 and booted
> under QEMU 10.2.1 on an isolated source export from net-next
> 014d795c7383, with the changed Kconfig files copied from 071876fd5048.
> Without the opt-in, mctp-sock passed 5/5 tests and mctp-route passed
> 21/23 tests with two expected flow-case skips. With the opt-in, both
> suites passed all 5 and 23 tests, respectively. On the full
> 071876fd5048 tree, the new net/mctp/.kunitconfig resolves all requested
> symbols and selects MCTP_FLOWS and SKB_EXTENSIONS.
I don't think this is worth applying
--
pw-bot: reject
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-08 2:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-02 21:20 [PATCH net-next v3] net: mctp: Make flow KUnit coverage an explicit opt-in Karl Mehltretter
2026-10-08 2:11 ` Jakub Kicinski
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®