Re: BPF selftest: mptcp subtest failing

From: Harshvardhan Jha
Date: Fri Aug 08 2025 - 03:01:58 EST


Hi Matthieu,

On 07/08/25 7:51 PM, Matthieu Baerts wrote:
> Hi Harshvardhan,
>
> On 07/08/2025 05:50, Harshvardhan Jha wrote:
>> Hi there,
>> I have explicitly disabled mptpcp by default on my custom kernel and
>> this seems to be causing the test case to fail. Even after enabling
>> mtpcp via sysctl command or adding an entry to /etc/sysctl.conf this
>> fails. I don't think this test should be failing and should account for
>> cases where mptcp has not been enabled by default?
> It looks like the test is failing because it expects MPTCP to be enabled
> by default. Or, said differently, it doesn't expect the kernel to be
> modified without adapting the corresponding tests :)
>
>> This is the custom patch I had applied on the LTS v6.12.36 kernel and
>> tested it:
>>
>> diff --git a/net/mptcp/ctrl.c b/net/mptcp/ctrl.c
>> index dd595d9b5e50c..bdcc4136e92ef 100644
>> --- a/net/mptcp/ctrl.c
>> +++ b/net/mptcp/ctrl.c
>> @@ -89,7 +89,7 @@ const char *mptcp_get_scheduler(const struct net *net)
>>
>> static void mptcp_pernet_set_defaults(struct mptcp_pernet *pernet)
>> {
>> - pernet->mptcp_enabled = 1;
>> + pernet->mptcp_enabled = 0;
>> pernet->add_addr_timeout = TCP_RTO_MAX;
>> pernet->blackhole_timeout = 3600;
>> atomic_set(&pernet->active_disable_times, 0);
> First, I have the same question as the one I asked to RedHat devs: do
> you still need to keep MPTCP disabled by default? If I remember well, on
> RHEL side, they started to do that when they backported MPTCP on a
> previous stable version, as an experimental feature. They left it like
> that later mostly for internal process reasons I think. But honestly,
> today, it no longer makes sense to do that and annoys users: all other
> Linux distributions enable MPTCP by default without patching the kernel
> like you did.

We had observed issues with mptcpd daemon failing before when we had
this enabled by default.
The mtpcpd userspace fix is yet to be integrated. However, shouldn't the
testcase be robust enough to handle that scenario regardless?

>
> If you don't want to revert this patch, I guess you can modify the BPF
> selftests in 'prog_tests/mptcp.c' to set 'sysctl net.mptcp.enabled=1' in
> each netns created by the test. But again, not changing the default
> kernel behaviour sounds like a better solution.

Even after changing /etc/sysctl.conf which is supposed to keep mptcp
enabled across reboots this issue occurs.
I agree with what you have stated, mptcp should be enabled by default
and the userspace fix should be incorporated ideally, however I still
believe that the test case shouldn't be giving a false negative as it is
in this case.

The false negatives seem to be occurring since this commit I believe:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=df8d3ba55b4fa1d6aed8449971ee50757cb0732f
This does the opposite of you have mentioned in certain functions. I
suppose adding all these lines back might do the trick:

ip netns exec $netns sysctl -q net.mptcp.enabled=1

>
> Cheers,
> Matt

Thanks & Regards,
Harshvardhan