Skip to content

Commit 4dde0d7

Browse files
matttbePaolo Abeni
authored andcommitted
mptcp: mib: count MPJ with backup flag
Without such counters, it is difficult to easily debug issues with MPJ not having the backup flags on production servers. This is not strictly a fix, but it eases to validate the following patches without requiring to take packet traces, to query ongoing connections with Netlink with admin permissions, or to guess by looking at the behaviour of the packet scheduler. Also, the modification is self contained, isolated, well controlled, and the increments are done just after others, there from the beginning. It looks then safe, and helpful to backport this. Fixes: 4596a2c ("mptcp: allow creating non-backup subflows") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 4258b94 commit 4dde0d7

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

net/mptcp/mib.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ static const struct snmp_mib mptcp_snmp_list[] = {
1919
SNMP_MIB_ITEM("MPTCPRetrans", MPTCP_MIB_RETRANSSEGS),
2020
SNMP_MIB_ITEM("MPJoinNoTokenFound", MPTCP_MIB_JOINNOTOKEN),
2121
SNMP_MIB_ITEM("MPJoinSynRx", MPTCP_MIB_JOINSYNRX),
22+
SNMP_MIB_ITEM("MPJoinSynBackupRx", MPTCP_MIB_JOINSYNBACKUPRX),
2223
SNMP_MIB_ITEM("MPJoinSynAckRx", MPTCP_MIB_JOINSYNACKRX),
24+
SNMP_MIB_ITEM("MPJoinSynAckBackupRx", MPTCP_MIB_JOINSYNACKBACKUPRX),
2325
SNMP_MIB_ITEM("MPJoinSynAckHMacFailure", MPTCP_MIB_JOINSYNACKMAC),
2426
SNMP_MIB_ITEM("MPJoinAckRx", MPTCP_MIB_JOINACKRX),
2527
SNMP_MIB_ITEM("MPJoinAckHMacFailure", MPTCP_MIB_JOINACKMAC),

net/mptcp/mib.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ enum linux_mptcp_mib_field {
1414
MPTCP_MIB_RETRANSSEGS, /* Segments retransmitted at the MPTCP-level */
1515
MPTCP_MIB_JOINNOTOKEN, /* Received MP_JOIN but the token was not found */
1616
MPTCP_MIB_JOINSYNRX, /* Received a SYN + MP_JOIN */
17+
MPTCP_MIB_JOINSYNBACKUPRX, /* Received a SYN + MP_JOIN + backup flag */
1718
MPTCP_MIB_JOINSYNACKRX, /* Received a SYN/ACK + MP_JOIN */
19+
MPTCP_MIB_JOINSYNACKBACKUPRX, /* Received a SYN/ACK + MP_JOIN + backup flag */
1820
MPTCP_MIB_JOINSYNACKMAC, /* HMAC was wrong on SYN/ACK + MP_JOIN */
1921
MPTCP_MIB_JOINACKRX, /* Received an ACK + MP_JOIN */
2022
MPTCP_MIB_JOINACKMAC, /* HMAC was wrong on ACK + MP_JOIN */

net/mptcp/subflow.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ static int subflow_check_req(struct request_sock *req,
168168
return 0;
169169
} else if (opt_mp_join) {
170170
SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINSYNRX);
171+
172+
if (mp_opt.backup)
173+
SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINSYNBACKUPRX);
171174
}
172175

173176
if (opt_mp_capable && listener->request_mptcp) {
@@ -577,6 +580,9 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
577580
subflow->mp_join = 1;
578581
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNACKRX);
579582

583+
if (subflow->backup)
584+
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNACKBACKUPRX);
585+
580586
if (subflow_use_different_dport(msk, sk)) {
581587
pr_debug("synack inet_dport=%d %d",
582588
ntohs(inet_sk(sk)->inet_dport),

0 commit comments

Comments
 (0)