MPTCP Linux Development
 help / color / mirror / Atom feed
* [PATCH mptcp-next] Squash to "DO-NOT-MERGE: mptcp: improve code coverage for CI"
@ 2024-02-16 12:04 Matthieu Baerts (NGI0)
  2024-02-16 13:01 ` Squash to "DO-NOT-MERGE: mptcp: improve code coverage for CI": Tests Results MPTCP CI
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-02-16 12:04 UTC (permalink / raw)
  To: mptcp; +Cc: Paolo Abeni, Matthieu Baerts (NGI0)

As discussed on [1], an additional check is done to catch local software
bug.

This patch is supposed to land only in our tree, for both 'export' and
'export-net' branches, because the warning could be triggered by bugged/
malicious peer. We want it in our tree for our CI to detect internal
bugs.

Link: https://lore.kernel.org/all/20240215-mptcp-fix-bogus-pr-warn-v1-1-d14c10312820@kernel.org/ [1]
Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/options.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 27ca42c77b02..5926955625cf 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -982,7 +982,8 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk,
 		WRITE_ONCE(msk->pm.remote_deny_join_id0, true);
 
 	if (unlikely(!READ_ONCE(msk->pm.server_side)))
-		pr_warn_once("bogus mpc option on established client sk");
+		/* DO-NOT-MERGE: use WARN i/o pr_warn: only for MPTCP export */
+		WARN_ONCE(1, "bogus mpc option on established client sk");
 
 set_fully_established:
 	mptcp_data_lock((struct sock *)msk);

---
base-commit: 65bda47e218b37c3dc919d3ccbd19dfad87a99e5
change-id: 20240216-mptcp-warn-bogus-pr-warn-6dcc88038246

Best regards,
-- 
Matthieu Baerts (NGI0) <matttbe@kernel.org>


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH mptcp-next] Squash to "DO-NOT-MERGE: mptcp: improve code coverage for CI"
@ 2024-09-24 16:39 Matthieu Baerts (NGI0)
  2024-09-24 16:48 ` Matthieu Baerts
  2024-09-24 17:36 ` MPTCP CI
  0 siblings, 2 replies; 14+ messages in thread
From: Matthieu Baerts (NGI0) @ 2024-09-24 16:39 UTC (permalink / raw)
  To: mptcp; +Cc: Matthieu Baerts (NGI0)

And in "DO-NOT-MERGE: mptcp: improve code coverage for CI (net)".

This is similar to commit bc75dcc3cea7 ("net: rds: add option for GCOV
profiling"), but I don't think we need to upstream that. Or not for the
moment as the selftests don't depend on GCOV support.

If we do, we will also need to update Documentation/dev-tools/gcov.rst.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/Kconfig  | 9 +++++++++
 net/mptcp/Makefile | 5 +++++
 2 files changed, 14 insertions(+)

diff --git a/net/mptcp/Kconfig b/net/mptcp/Kconfig
index 10c97e19a7da5cbb1538b34a8eeca2e89795dfae..f674915dc31e521e6fe9dbcef03e65bdba10dd3d 100644
--- a/net/mptcp/Kconfig
+++ b/net/mptcp/Kconfig
@@ -37,4 +37,13 @@ config MPTCP_KUNIT_TEST
 
 	  If unsure, say N.
 
+config GCOV_PROFILE_MPTCP
+	bool "Enable GCOV profiling on MPTCP"
+	depends on GCOV_KERNEL
+	help
+	  Enable GCOV profiling on MPTCP for checking which functions/lines
+	  are executed.
+
+	  If unsure, say N.
+
 endif
diff --git a/net/mptcp/Makefile b/net/mptcp/Makefile
index bcf1dbf3a432f7423b048e985667f199797042b3..5dbc37d38d7a4b0779c71e7b291ef83a49e46648 100644
--- a/net/mptcp/Makefile
+++ b/net/mptcp/Makefile
@@ -13,3 +13,8 @@ mptcp_token_test-objs := token_test.o
 obj-$(CONFIG_MPTCP_KUNIT_TEST) += mptcp_crypto_test.o mptcp_token_test.o
 
 obj-$(CONFIG_BPF_SYSCALL) += bpf.o
+
+# for GCOV coverage profiling
+ifdef CONFIG_GCOV_PROFILE_MPTCP
+GCOV_PROFILE := y
+endif

---
base-commit: d269ec78a30bc7a57999838c477a83b0e0101a57
change-id: 20240924-mptcp-gcov-49368d19b22f

Best regards,
-- 
Matthieu Baerts (NGI0) <matttbe@kernel.org>


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH mptcp-next] Squash to "DO-NOT-MERGE: mptcp: improve code coverage for CI"
@ 2024-11-04  8:28 Geliang Tang
  2024-11-04  9:35 ` MPTCP CI
  2024-11-04 11:58 ` Matthieu Baerts
  0 siblings, 2 replies; 14+ messages in thread
From: Geliang Tang @ 2024-11-04  8:28 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

When our bpf_selftests are re-built, this error occurs:

 make[1]: *** No rule to make target 'atomics.lskel.h',
			needed by '.../atomics.test.o'.  Stop.
 make[1]: *** Waiting for unfinished jobs....
 make[1]: Leaving directory 'tools/testing/selftests/bpf'
 make: *** [Makefile:259: install] Error 2
 make: Leaving directory 'tools/testing/selftests'

In this case, I had to remove the cache directory .virtme and recompile it
again. This was very time-consuming.

A workaround patch for this is found in [1]. I don't know why this patch
has not been upstreamed, but it's in BPF CI environment. I think it's
necessary to synchronize this modification to MPTCP CI environment as well.

[1]
https://lore.kernel.org/bpf/Q3BN2kW9Kgy6LkrDOwnyY4Pv7_YF8fInLCd2_QA3LimKYM3wD64kRdnwp7blwG2dI_s7UGnfUae-4_dOmuTrxpYCi32G_KTzB3PfmxIerH8=@pm.me/T/

Signed-off-by: Geliang Tang <geliang@kernel.org>
---
 tools/testing/selftests/bpf/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 9ec53c858d8d..64388a2fe5a0 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -652,6 +652,12 @@ $(TRUNNER_BPF_SKELS_LINKED): $(TRUNNER_OUTPUT)/%: $$$$(%-deps) $(BPFTOOL) | $(TR
 $(notdir %.skel.h): $(TRUNNER_OUTPUT)/%.skel.h
 	@true
 
+$(notdir %.lskel.h): $(TRUNNER_OUTPUT)/%.lskel.h
+	@true
+
+$(notdir %.subskel.h): $(TRUNNER_OUTPUT)/%.subskel.h
+	@true
+
 endif
 
 # ensure we set up tests.h header generation rule just once
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-11-05 10:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-16 12:04 [PATCH mptcp-next] Squash to "DO-NOT-MERGE: mptcp: improve code coverage for CI" Matthieu Baerts (NGI0)
2024-02-16 13:01 ` Squash to "DO-NOT-MERGE: mptcp: improve code coverage for CI": Tests Results MPTCP CI
2024-02-16 13:20 ` MPTCP CI
2024-02-16 20:21 ` [PATCH mptcp-next] Squash to "DO-NOT-MERGE: mptcp: improve code coverage for CI" Mat Martineau
2024-02-19 10:06   ` Matthieu Baerts
2024-02-19 10:35 ` Matthieu Baerts
  -- strict thread matches above, loose matches on Subject: below --
2024-09-24 16:39 Matthieu Baerts (NGI0)
2024-09-24 16:48 ` Matthieu Baerts
2024-09-24 17:36 ` MPTCP CI
2024-11-04  8:28 Geliang Tang
2024-11-04  9:35 ` MPTCP CI
2024-11-04 11:58 ` Matthieu Baerts
2024-11-04 12:07   ` Matthieu Baerts
2024-11-05 10:04     ` Geliang Tang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox