All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next 4/5] mptcp: add MPJoinRejected MIB counter
Date: Mon, 31 Mar 2025 14:57:08 +0200	[thread overview]
Message-ID: <34ce1680-a30e-4bf6-a214-101d91c83cd1@kernel.org> (raw)
In-Reply-To: <910fc74590b10617dfc0dffe950f895f2457c089.camel@kernel.org>

Hi Geliang,

On 31/03/2025 03:59, Geliang Tang wrote:
> Hi Matt,
> 
> On Sat, 2025-03-29 at 17:26 +0100, Matthieu Baerts (NGI0) wrote:
>> This counter is useful to understand why some paths are rejected, and
>> not created as expected.
>>
>> It is incremented when receiving a connection request, if the PM
>> didn't
>> allow the creation of new subflows.
>>
>> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
>> ---
>>  net/mptcp/mib.c      | 1 +
>>  net/mptcp/mib.h      | 1 +
>>  net/mptcp/protocol.c | 4 +++-
>>  net/mptcp/subflow.c  | 2 ++
>>  4 files changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/net/mptcp/mib.c b/net/mptcp/mib.c
>> index
>> 19eb9292bd6093a760b41f98c1774fd2490c48e3..0c24545f0e8df95b3475bfccc7a
>> 2f2ce440f7ad2 100644
>> --- a/net/mptcp/mib.c
>> +++ b/net/mptcp/mib.c
>> @@ -28,6 +28,7 @@ static const struct snmp_mib mptcp_snmp_list[] = {
>>  	SNMP_MIB_ITEM("MPJoinSynAckHMacFailure",
>> MPTCP_MIB_JOINSYNACKMAC),
>>  	SNMP_MIB_ITEM("MPJoinAckRx", MPTCP_MIB_JOINACKRX),
>>  	SNMP_MIB_ITEM("MPJoinAckHMacFailure", MPTCP_MIB_JOINACKMAC),
>> +	SNMP_MIB_ITEM("MPJoinRejected", MPTCP_MIB_JOINREJECTED),
>>  	SNMP_MIB_ITEM("MPJoinSynTx", MPTCP_MIB_JOINSYNTX),
>>  	SNMP_MIB_ITEM("MPJoinSynTxCreatSkErr",
>> MPTCP_MIB_JOINSYNTXCREATSKERR),
>>  	SNMP_MIB_ITEM("MPJoinSynTxBindErr",
>> MPTCP_MIB_JOINSYNTXBINDERR),
>> diff --git a/net/mptcp/mib.h b/net/mptcp/mib.h
>> index
>> 128282982843a07614a46f9b2c2f7c708306c769..250c6b77977e8f846b5741304f7
>> 841a922f51967 100644
>> --- a/net/mptcp/mib.h
>> +++ b/net/mptcp/mib.h
>> @@ -23,6 +23,7 @@ enum linux_mptcp_mib_field {
>>  	MPTCP_MIB_JOINSYNACKMAC,	/* HMAC was wrong on SYN/ACK
>> + MP_JOIN */
>>  	MPTCP_MIB_JOINACKRX,		/* Received an ACK + MP_JOIN
>> */
>>  	MPTCP_MIB_JOINACKMAC,		/* HMAC was wrong on ACK +
>> MP_JOIN */
>> +	MPTCP_MIB_JOINREJECTED,		/* The PM rejected
>> the JOIN request */
>>  	MPTCP_MIB_JOINSYNTX,		/* Sending a SYN + MP_JOIN
>> */
>>  	MPTCP_MIB_JOINSYNTXCREATSKERR,	/* Not able to create a
>> socket when sending a SYN + MP_JOIN */
>>  	MPTCP_MIB_JOINSYNTXBINDERR,	/* Not able to bind() the
>> address when sending a SYN + MP_JOIN */
>> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
>> index
>> 9042a86e003036f8eb9680bc6c520fb57d92dbd0..8ba1a4f225bd2014ebdc973e752
>> 702028ee5f31a 100644
>> --- a/net/mptcp/protocol.c
>> +++ b/net/mptcp/protocol.c
>> @@ -3527,8 +3527,10 @@ bool mptcp_finish_join(struct sock *ssk)
>>  		return true;
>>  	}
>>  
>> -	if (!mptcp_pm_allow_new_subflow(msk))
>> +	if (!mptcp_pm_allow_new_subflow(msk)) {
>> +		MPTCP_INC_STATS(sock_net(ssk),
>> MPTCP_MIB_JOINREJECTED);
> 
> nit:
> 
> Although the result is the same as sock_net(ssk), what do you think of
> using sock_net(parent) here?

We could, but why would you prefer using 'parent' instead of 'ssk'? Ii
picked 'ssk' because that's the one passed in argument of this function.
'parent' is obtained from 'ssk'.

I hope you don't mind if I apply the patch as it is because I already
applied the parent patches. I can always change that later of course.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


  reply	other threads:[~2025-03-31 12:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-29 16:26 [PATCH mptcp-next 0/5] mptcp: fix MPJoinAckHMacFailure, add MPJoinRejected Matthieu Baerts (NGI0)
2025-03-29 16:26 ` [PATCH mptcp-next 1/5] mptcp: only inc MPJoinAckHMacFailure for HMAC failures Matthieu Baerts (NGI0)
2025-03-31  1:28   ` Geliang Tang
2025-03-31  1:54     ` Geliang Tang
2025-03-29 16:26 ` [PATCH mptcp-next 2/5] selftests: mptcp: validate MPJoin HMacFailure counters Matthieu Baerts (NGI0)
2025-03-30  0:15   ` Geliang Tang
2025-03-31 12:31     ` Matthieu Baerts
2025-03-29 16:26 ` [PATCH mptcp-next 3/5] mptcp: pass right struct to subflow_hmac_valid Matthieu Baerts (NGI0)
2025-03-29 16:26 ` [PATCH mptcp-next 4/5] mptcp: add MPJoinRejected MIB counter Matthieu Baerts (NGI0)
2025-03-31  1:59   ` Geliang Tang
2025-03-31 12:57     ` Matthieu Baerts [this message]
2025-03-29 16:26 ` [PATCH mptcp-next 5/5] selftests: mptcp: validate MPJoinRejected counter Matthieu Baerts (NGI0)
2025-03-29 17:33 ` [PATCH mptcp-next 0/5] mptcp: fix MPJoinAckHMacFailure, add MPJoinRejected MPTCP CI
2025-03-31  2:05 ` Geliang Tang
2025-03-31 13:06   ` 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=34ce1680-a30e-4bf6-a214-101d91c83cd1@kernel.org \
    --to=matttbe@kernel.org \
    --cc=geliang@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.