Skip to content

Commit 456fbd1

Browse files
matttbeintel-lab-lkp
authored andcommitted
mptcp: add MPJoinRejected MIB counter
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) <[email protected]>
1 parent 84f19c9 commit 456fbd1

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

net/mptcp/mib.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ static const struct snmp_mib mptcp_snmp_list[] = {
2828
SNMP_MIB_ITEM("MPJoinSynAckHMacFailure", MPTCP_MIB_JOINSYNACKMAC),
2929
SNMP_MIB_ITEM("MPJoinAckRx", MPTCP_MIB_JOINACKRX),
3030
SNMP_MIB_ITEM("MPJoinAckHMacFailure", MPTCP_MIB_JOINACKMAC),
31+
SNMP_MIB_ITEM("MPJoinRejected", MPTCP_MIB_JOINREJECTED),
3132
SNMP_MIB_ITEM("MPJoinSynTx", MPTCP_MIB_JOINSYNTX),
3233
SNMP_MIB_ITEM("MPJoinSynTxCreatSkErr", MPTCP_MIB_JOINSYNTXCREATSKERR),
3334
SNMP_MIB_ITEM("MPJoinSynTxBindErr", MPTCP_MIB_JOINSYNTXBINDERR),

net/mptcp/mib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ enum linux_mptcp_mib_field {
2323
MPTCP_MIB_JOINSYNACKMAC, /* HMAC was wrong on SYN/ACK + MP_JOIN */
2424
MPTCP_MIB_JOINACKRX, /* Received an ACK + MP_JOIN */
2525
MPTCP_MIB_JOINACKMAC, /* HMAC was wrong on ACK + MP_JOIN */
26+
MPTCP_MIB_JOINREJECTED, /* The PM rejected the JOIN request */
2627
MPTCP_MIB_JOINSYNTX, /* Sending a SYN + MP_JOIN */
2728
MPTCP_MIB_JOINSYNTXCREATSKERR, /* Not able to create a socket when sending a SYN + MP_JOIN */
2829
MPTCP_MIB_JOINSYNTXBINDERR, /* Not able to bind() the address when sending a SYN + MP_JOIN */

net/mptcp/protocol.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3527,8 +3527,10 @@ bool mptcp_finish_join(struct sock *ssk)
35273527
return true;
35283528
}
35293529

3530-
if (!mptcp_pm_allow_new_subflow(msk))
3530+
if (!mptcp_pm_allow_new_subflow(msk)) {
3531+
MPTCP_INC_STATS(sock_net(ssk), MPTCP_MIB_JOINREJECTED);
35313532
goto err_prohibited;
3533+
}
35323534

35333535
/* If we can't acquire msk socket lock here, let the release callback
35343536
* handle it

net/mptcp/subflow.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ static int subflow_check_req(struct request_sock *req,
247247

248248
if (unlikely(req->syncookie)) {
249249
if (!mptcp_can_accept_new_subflow(subflow_req->msk)) {
250+
SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINREJECTED);
250251
subflow_add_reset_reason(skb, MPTCP_RST_EPROHIBIT);
251252
return -EPERM;
252253
}
@@ -902,6 +903,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk,
902903
}
903904

904905
if (!mptcp_can_accept_new_subflow(owner)) {
906+
SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINREJECTED);
905907
subflow_add_reset_reason(skb, MPTCP_RST_EPROHIBIT);
906908
goto dispose_child;
907909
}

0 commit comments

Comments
 (0)