From nobody Mon Sep 16 19:37:40 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CA8BCA40 for ; Sun, 12 May 2024 08:42:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715503344; cv=none; b=H9OFtwFOHh3EVsC0C4FVh0oqYH95Rr9ASWhoQc3vMX3VGATkNVUDi1nUO4ABedgTaJXzUmEYHRU0OgOyuKETaio+HBFl0bRp3HM1K+9wBROTW+8gYW0Q91U4d/OoMFtSBPYyZPv8/YsHauqmdldTRO8cpyCZVVhKAomCm4LMKa8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715503344; c=relaxed/simple; bh=kvcQipHR1/lz3mcpPYPse7RhXTAUa9CAFsSB54Ymf2g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q2eoqvGeNTje1m3gqge1bmzWWDh6Jxuk9zzr45m8UIcq1dOd580lrXAADRGrc+q/LKPNJdABybCpPdbYf56AEDCcyqg1bcRaOTjWQzScUbGSAZNfb5jiIB00/NrVFcS4v7l7ET1Iq0b3q4XEb1mv4pyaT8dz3uT78GL7ftW9un8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Yt4v7Hqe; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Yt4v7Hqe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03A8EC116B1; Sun, 12 May 2024 08:42:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715503344; bh=kvcQipHR1/lz3mcpPYPse7RhXTAUa9CAFsSB54Ymf2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yt4v7HqegOuM3ngr9joAoMYDuSpGDqL2bSW5rlr5kYyQa1/RNXnKhEeM7JOOv3MnS Pb7DjvjkiiNh2+NqtNf0tMTmbAug5sHYrMjp2MZnBHntrJTYTJbEkNSZSC1KZt4qGd 5cycZBSoOw0MDRFKiIxi1Pw6UgtkNPLmoea0l2ntW3vatCDXkSczcR/qTDgugRRUJV OHPgvnQWQ2mbfNFglDY2fDtanLz2Upvd5PTZtvMxYQWArptPzuzzZRDiXOHdnkPahP t4C9wsi1gejK2/WolIh8kBfiYjjg4E9atyjKEqmyQ7CAR6SNpSqLAq3+c1mGjgIvHe x/WMEO6G4+tBA== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 1/3] selftests/bpf: Add mptcp pm_nl_ctl link Date: Sun, 12 May 2024 16:41:34 +0800 Message-ID: <43447e40206035723d86f4e06b0bbec0c8d4c37a.1715503185.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang This patch adds a link of mptcp pm_nl_ctl tool into bpf selftests, and updates Makefile to compile it. This is useful to run mptcp bpf selftests on a system with an old version of IPRoite2 is installed. When 'ip mptcp' is not supported, this tool pm_nl_ctl can be used instead. MAINTAINERS needs to be updated since a new file is added. Signed-off-by: Geliang Tang --- MAINTAINERS | 1 + tools/testing/selftests/bpf/Makefile | 2 +- tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 120000 tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c diff --git a/MAINTAINERS b/MAINTAINERS index b81b2be60b77..f973f1fb9e18 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15510,6 +15510,7 @@ F: include/trace/events/mptcp.h F: include/uapi/linux/mptcp*.h F: net/mptcp/ F: tools/testing/selftests/bpf/*/*mptcp*.c +F: tools/testing/selftests/bpf/*mptcp*.c F: tools/testing/selftests/net/mptcp/ =20 NETWORKING [TCP] diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests= /bpf/Makefile index b90c718218ae..6fe242275e14 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -131,7 +131,7 @@ TEST_GEN_PROGS_EXTENDED =3D test_sock_addr test_skb_cgr= oup_id_user \ flow_dissector_load test_flow_dissector test_tcp_check_syncookie_user \ test_lirc_mode2_user xdping test_cpp runqslower bench bpf_testmod.ko \ xskxceiver xdp_redirect_multi xdp_synproxy veristat xdp_hw_metadata \ - xdp_features bpf_test_no_cfi.ko + xdp_features bpf_test_no_cfi.ko mptcp_pm_nl_ctl =20 TEST_GEN_FILES +=3D liburandom_read.so urandom_read sign-file uprobe_multi =20 diff --git a/tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c b/tools/testing/= selftests/bpf/mptcp_pm_nl_ctl.c new file mode 120000 index 000000000000..5a08c255b278 --- /dev/null +++ b/tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c @@ -0,0 +1 @@ +../net/mptcp/pm_nl_ctl.c \ No newline at end of file --=20 2.43.0 From nobody Mon Sep 16 19:37:40 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E788CA40 for ; Sun, 12 May 2024 08:42:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715503346; cv=none; b=G9Tr1veoh2ncbrw7K9dCPuQuSHq8Vm3mXt2t77FP1q9y0LitcEPauUXPhgnVGSjIKnp0FFDHGlbOuZWpFHJydZCBD/Cbr+8SPOqN4S4LzJs3nmI/fhKCIdUUbKa2fyE7r1XEYe3ZEftjrq5NKEUPZ63LToJ48IHUunGsKuumrkg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715503346; c=relaxed/simple; bh=ZbmgrZdB762p1vRKbyClzhO2G/oIDzJqduqEb9V1ZP8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cSxXHton9aR/+2769zl3dPqMdsUMhmr+cGoEMiLXvisx9pzdvBLrc2XIGd2D4VRe3I3Lt7CVx2ucazYBZprXSjuNDGWY8T3fVwZR48ziWASlenXDJ7ClkRkPM+4lKIxnIbSilrETTqglDkLiHCHYP36orq1flaoTnVSaVeA/b+Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MVCck5d1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MVCck5d1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3BFBC116B1; Sun, 12 May 2024 08:42:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715503345; bh=ZbmgrZdB762p1vRKbyClzhO2G/oIDzJqduqEb9V1ZP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MVCck5d1YLsBdoHfvTcxZZkT422UYVgnGGkWI8xCKbiQqCFvfe3970Bgdbk/JqIvU hmCzXMv/aEyZpYbETfaruoXZ9GFdRT66NlUp5mH/5S+cac5LqWOGiT22Q99UV8rpsj TCdbCOGs8dmxRYRKVbdW9zzoSk2ji4XY0/KsEOCoy2fnDCoXvCM/HzhTCzdsBu5wS3 F+XK85P5Bg58A6ORCVJUuXqAy+o9CiMGC1BuuLtN7V8L/7BLkDYB4NpnQ1PiQUYoG6 Pg4b3o9J7fHTWWhuDaQ+YQAMib/1NGaIIwOw0goPSKQqLztF2yZJjZcWE9rrNRNtXF Tc/d5DKXLhZZQ== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 2/3] Squash to "selftests/bpf: Add mptcp subflow subtest" Date: Sun, 12 May 2024 16:41:35 +0800 Message-ID: <77d5112c49fac9e8f77c09c7c1c057b8ea25a60f.1715503185.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang Use pm_nl_ctl when 'ip mptcp' fails. Use SYS_NOFAIL in _ss_search() and drop 'ss -M'. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/prog_tests/mptcp.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing= /selftests/bpf/prog_tests/mptcp.c index 793b4b9c2bd2..2459c0e2a794 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -362,7 +362,10 @@ static int endpoint_init(char *flags) SYS(fail, "ip -net %s link set dev veth1 up", NS_TEST); SYS(fail, "ip -net %s addr add %s/24 dev veth2", NS_TEST, ADDR_2); SYS(fail, "ip -net %s link set dev veth2 up", NS_TEST); - SYS(fail, "ip -net %s mptcp endpoint add %s %s", NS_TEST, ADDR_2, flags); + if (SYS_NOFAIL("ip -net %s mptcp endpoint add %s %s", NS_TEST, ADDR_2, fl= ags)) { + SYS(fail, "ip netns exec %s ./mptcp_pm_nl_ctl add %s flags %s", + NS_TEST, ADDR_2, flags); + } =20 return 0; fail: @@ -371,16 +374,8 @@ static int endpoint_init(char *flags) =20 static int _ss_search(char *src, char *dst, char *port, char *keyword) { - char cmd[128]; - int n; - - n =3D snprintf(cmd, sizeof(cmd), - "ip netns exec %s ss -Menita src %s dst %s %s %d | grep -q '%s'", - NS_TEST, src, dst, port, PORT_1, keyword); - if (n < 0 || n >=3D sizeof(cmd)) - return -1; - - return system(cmd); + return SYS_NOFAIL("ip netns exec %s ss -enita src %s dst %s %s %d | grep = -q '%s'", + NS_TEST, src, dst, port, PORT_1, keyword); } =20 static int ss_search(char *src, char *keyword) --=20 2.43.0 From nobody Mon Sep 16 19:37:40 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D62DCA40 for ; Sun, 12 May 2024 08:42:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715503347; cv=none; b=JuTUhpUAtGrrso1His/UwWbE1rWnb0qR2aO1w/iiDKy9BnRCBovJED5LyGGF7ltq2d3pCaPtqBt7JyhFZWTIBnZkzMfk8lYmI+FWlo+ZJheixb7VPu8DjCWxFH/G8Vpn4L5v6DCM4qSGteQn+EQGfI4XJYfmtbE9746n70PwYRM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715503347; c=relaxed/simple; bh=RLcAHkS6R/sFZGlW6UTG9IZnwjcZEWyBK590zCPZTAc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EjfyUIz4tfv4gNmlQks9Xqu1IagSwdrIXvqEZVYZSvElD7Y8AXIXwC7l1IlX2d7rZdVKQGlKD1Iz7X1bsXiOZBA8/I0MDrBCBpVLw32r02sUx800Elo6XbyjR7f6BOVUvKpGU3M4xfawMHY0PCgmMjVfOVuUj13BtM7Jdn0hqOM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eoTIq6O/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eoTIq6O/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FC03C32781; Sun, 12 May 2024 08:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715503347; bh=RLcAHkS6R/sFZGlW6UTG9IZnwjcZEWyBK590zCPZTAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eoTIq6O/O0HKTTdTS6p+4KB97uNbGheqNuqBR1SYuOzvunq/BDyiUlGNKcGwmpczt 9iXe4+wsAm69mIYxG1l77jnR1GDFwqR0t9OLSJg1ydZ7DWSdPO4Dj2Kh+U+iedviUx wVKK6h763eHklHX71zwlvLPsIXpJhBzmiu27EV1coTkyhFnnbtHKCVpBmIdQvQEi4M 8gkzkgL/FGiBCBZgDz1teNEBrzqiIcofJVabGDIigvx5t+YM1JV8ICM2oR0r9bcgOy TnuxXUH4T72XqbzsURe/0TbuNGpwjOEqR/4sza0DeYibwrzTFLpZH4nP918J/sSVxB HY5zYButb/mWw== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 3/3] checkpatch: skip warnings for symbol links Date: Sun, 12 May 2024 16:41:36 +0800 Message-ID: <1628d78e12809ff0f4dd0526f6addbbf00dae66b.1715503185.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang If there is a symbol link in the given patch, checkpatch.pl reports two inaccurate warnings: $ cat 0001-selftests-bpf-Add-mptcp-pm_nl_ctl-link.patch ... ... ''' # diff --git a/tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c \ # b/tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c # new file mode 120000 # index 000000000000..5a08c255b278 # --- /dev/null # +++ b/tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c # @@ -0,0 +1 @@ # +../net/mptcp/pm_nl_ctl.c # \ No newline at end of file ''' $ ./scripts/checkpatch.pl 0001-selftests-bpf-Add-mptcp-pm_nl_ctl-link.patch ''' WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #57: FILE: tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c:1: +../net/mptcp/pm_nl_ctl.c WARNING: adding a line without newline at end of file #57: FILE: tools/testing/selftests/bpf/mptcp_pm_nl_ctl.c:1: +../net/mptcp/pm_nl_ctl.c total: 0 errors, 2 warnings, 16 lines checked ''' This patch fixes this by adding a new variable $symbol_link in checkpatch script, set it if the new file mode is 120000. Skip these two checks "missing SPDX-License-Identifier" and "adding a line without newline at end of file" if this variable is set. Signed-off-by: Geliang Tang --- scripts/checkpatch.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9c4c4a61bc83..b31f13d643a7 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -436,6 +436,7 @@ for my $key (keys %debug) { } =20 my $rpt_cleaners =3D 0; +my $symbol_link =3D 0; =20 if ($terse) { $emacs =3D 1; @@ -3595,6 +3596,10 @@ sub process { "Do not include the paragraph about writing to the Free Software= Foundation's mailing address from the sample GPL notice. The FSF has chang= ed addresses in the past, and may do so again. Linux already includes a cop= y of the GPL.\n" . $herevet) } =20 + if ($line =3D~ /^new file mode 120000$/) { + $symbol_link =3D 1; + } + # check for Kconfig help text having a real description # Only applies when adding the entry originally, after that we do not have # sufficient context to determine whether it is indeed long enough. @@ -3756,7 +3761,8 @@ sub process { } =20 if ($comment !~ /^$/ && - $rawline !~ m@^\+\Q$comment\E SPDX-License-Identifier: @) { + $rawline !~ m@^\+\Q$comment\E SPDX-License-Identifier: @ && + $symbol_link =3D~ 1) { WARN("SPDX_LICENSE_TAG", "Missing or malformed SPDX-License-Identifier tag in line $check= licenseline\n" . $herecurr); } elsif ($rawline =3D~ /(SPDX-License-Identifier: .*)/) { @@ -3867,7 +3873,8 @@ sub process { } =20 # check for adding lines without a newline. - if ($line =3D~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =3D~ = /^\\ No newline at end of file/) { + if ($line =3D~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =3D~ = /^\\ No newline at end of file/ && + $symbol_link =3D~ 1) { if (WARN("MISSING_EOF_NEWLINE", "adding a line without newline at end of file\n" . $herecurr) = && $fix) { --=20 2.43.0