From: Geliang Tang <geliang.tang@suse.com>
To: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-net v2] selftests: mptcp: join: fix subflow_send_ack lookup
Date: Fri, 17 Nov 2023 13:33:05 +0800 [thread overview]
Message-ID: <20231117053305.GA26319@localhost.localdomain> (raw)
In-Reply-To: <f343a6ca7d627b4092a284dbc6724f34e6f8c491.1699973683.git.geliang.tang@suse.com>
On Tue, Nov 14, 2023 at 10:57:08PM +0800, Geliang Tang wrote:
> MPC backups tests will skip unexpected sometimes, since static functions
> like mptcp_subflow_send_ack may also be listed in /proc/kallsyms, with a
> 't' in front of it, not 'T' ('T' is for a global function):
>
> > grep "mptcp_subflow_send_ack" /proc/kallsyms
>
> 0000000000000000 T __pfx___mptcp_subflow_send_ack
> 0000000000000000 T __mptcp_subflow_send_ack
> 0000000000000000 t __pfx_mptcp_subflow_send_ack
> 0000000000000000 t mptcp_subflow_send_ack
I did some tests again, and found that whether to list the static
functions in /proc/kallsyms depends on the version of gcc:
Use gcc-8, "t mptcp_subflow_send_ack" is in /proc/kallsyms.
> sudo dmesg | head
[ 0.000000] Linux version 6.6.0-mptcp+ (tgl@localhost.localdomain) (gcc (SUSE Linux) 8.5.0, GNU ld (GNU Binutils; SUSE Linux Enterprise 15) 2.39.0.20220810-150100.7.40) #5 SMP PREEMPT_DYNAMIC Thu Nov 16 10:27:33 CST 2023
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-6.6.0-mptcp+ root=/dev/mapper/vg0-lvol0 splash=silent mitigations=auto quiet
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009efff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009f000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000006a5b6fff] usable
[ 0.000000] BIOS-e820: [mem 0x000000006a5b7000-0x000000006e794fff] reserved
[ 0.000000] BIOS-e820: [mem 0x000000006e795000-0x000000006fb1efff] ACPI NVS
[ 0.000000] BIOS-e820: [mem 0x000000006fb1f000-0x000000006fc4efff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x000000006fc4f000-0x000000006fc4ffff] usable
> sudo cat /proc/kallsyms | grep subflow_send_ack
ffffffffa1c0df80 T __pfx___mptcp_subflow_send_ack
ffffffffa1c0df90 T __mptcp_subflow_send_ack
ffffffffa1c0dfd0 t __pfx_mptcp_subflow_send_ack
ffffffffa1c0dfe0 t mptcp_subflow_send_ack
Use gcc-11, no mptcp_subflow_send_ack is in /proc/kallsyms.
> sudo dmesg | head
[sudo] password for root:
[ 0.000000] Linux version 6.6.0-mptcp+ (tgl@bogon) (gcc (SUSE Linux) 11.4.1 20230630 [revision f03b182f7f23e14d587cfa1daec13ef7c3044ac0], GNU ld (GNU Binutils; SUSE Linux Enterprise 15) 2.39.0.20220810-150100.7.40) #25 SMP PREEMPT_DYNAMIC Thu Nov 16 22:26:41 CST 2023
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-6.6.0-mptcp+ root=/dev/mapper/vg0-lvol0 splash=silent mitigations=auto quiet
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009efff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009f000-0x00000000000fffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000006a5b6fff] usable
[ 0.000000] BIOS-e820: [mem 0x000000006a5b7000-0x000000006e794fff] reserved
[ 0.000000] BIOS-e820: [mem 0x000000006e795000-0x000000006fb1efff] ACPI NVS
[ 0.000000] BIOS-e820: [mem 0x000000006fb1f000-0x000000006fc4efff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x000000006fc4f000-0x000000006fc4ffff] usable
> sudo cat /proc/kallsyms | grep subflow_send_ack
ffffffffaca54e80 T __pfx___mptcp_subflow_send_ack
ffffffffaca54e90 T __mptcp_subflow_send_ack
So MPC backups tests will skip unexpected when using gcc-8. This patch
does fix this issue. Only commit log needs to be updated:
'''
MPC backups tests will skip unexpected sometimes (For example, when
compiling kernel with an older version of gcc, such as gcc-8), since
static functions like mptcp_subflow_send_ack also be listed in
/proc/kallsyms, with a 't' in front of it, not 'T' ('T' is for a global
function):
> grep "mptcp_subflow_send_ack" /proc/kallsyms
0000000000000000 T __pfx___mptcp_subflow_send_ack
0000000000000000 T __mptcp_subflow_send_ack
0000000000000000 t __pfx_mptcp_subflow_send_ack
0000000000000000 t mptcp_subflow_send_ack
In this case, mptcp_lib_kallsyms_doesnt_have "mptcp_subflow_send_ack$"
will be false, MPC backups tests will skip. This is not what we expected.
The correct logic here should be: if mptcp_subflow_send_ack is not a
global function in /proc/kallsyms, do these MPC backups tests. So a 'T'
must be added in front of mptcp_subflow_send_ack.
'''
Thanks,
-Geliang
>
> In this case, mptcp_lib_kallsyms_doesnt_have "mptcp_subflow_send_ack$"
> will be false, MPC backups tests will skip. This is not what we expected.
>
> The correct logic here should be: if mptcp_subflow_send_ack is not a
> global function in /proc/kallsyms, do these MPC backups tests. So a 'T'
> must be added in front of mptcp_subflow_send_ack.
>
> Fixes: 632978f0a961 ("selftests: mptcp: join: skip MPC backups tests if not supported")
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
> v2:
> - Update commit log, fix typos in it.
> ---
> tools/testing/selftests/net/mptcp/mptcp_join.sh | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> index 1606474232f6..6fbc70332caa 100755
> --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
> +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> @@ -2755,7 +2755,7 @@ backup_tests()
> fi
>
> if reset "mpc backup" &&
> - continue_if mptcp_lib_kallsyms_doesnt_have "mptcp_subflow_send_ack$"; then
> + continue_if mptcp_lib_kallsyms_doesnt_have "T mptcp_subflow_send_ack$"; then
> pm_nl_add_endpoint $ns2 10.0.1.2 flags subflow,backup
> speed=slow \
> run_tests $ns1 $ns2 10.0.1.1
> @@ -2764,7 +2764,7 @@ backup_tests()
> fi
>
> if reset "mpc backup both sides" &&
> - continue_if mptcp_lib_kallsyms_doesnt_have "mptcp_subflow_send_ack$"; then
> + continue_if mptcp_lib_kallsyms_doesnt_have "T mptcp_subflow_send_ack$"; then
> pm_nl_add_endpoint $ns1 10.0.1.1 flags subflow,backup
> pm_nl_add_endpoint $ns2 10.0.1.2 flags subflow,backup
> speed=slow \
> @@ -2774,7 +2774,7 @@ backup_tests()
> fi
>
> if reset "mpc switch to backup" &&
> - continue_if mptcp_lib_kallsyms_doesnt_have "mptcp_subflow_send_ack$"; then
> + continue_if mptcp_lib_kallsyms_doesnt_have "T mptcp_subflow_send_ack$"; then
> pm_nl_add_endpoint $ns2 10.0.1.2 flags subflow
> sflags=backup speed=slow \
> run_tests $ns1 $ns2 10.0.1.1
> @@ -2783,7 +2783,7 @@ backup_tests()
> fi
>
> if reset "mpc switch to backup both sides" &&
> - continue_if mptcp_lib_kallsyms_doesnt_have "mptcp_subflow_send_ack$"; then
> + continue_if mptcp_lib_kallsyms_doesnt_have "T mptcp_subflow_send_ack$"; then
> pm_nl_add_endpoint $ns1 10.0.1.1 flags subflow
> pm_nl_add_endpoint $ns2 10.0.1.2 flags subflow
> sflags=backup speed=slow \
> --
> 2.35.3
>
next prev parent reply other threads:[~2023-11-17 5:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 14:57 [PATCH mptcp-net v2] selftests: mptcp: join: fix subflow_send_ack lookup Geliang Tang
2023-11-14 16:05 ` selftests: mptcp: join: fix subflow_send_ack lookup: Tests Results MPTCP CI
2023-11-17 5:33 ` Geliang Tang [this message]
2023-11-27 18:27 ` [PATCH mptcp-net v2] selftests: mptcp: join: fix subflow_send_ack lookup Mat Martineau
2023-11-27 18:40 ` selftests: mptcp: join: fix subflow_send_ack lookup: Tests Results MPTCP CI
2023-12-04 17:10 ` [PATCH mptcp-net v2] selftests: mptcp: join: fix subflow_send_ack lookup Matthieu Baerts
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=20231117053305.GA26319@localhost.localdomain \
--to=geliang.tang@suse.com \
--cc=mptcp@lists.linux.dev \
/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