Skip to content

Commit 6721cba

Browse files
matttbegregkh
authored andcommitted
mptcp: mib: count MPJ with backup flag
commit 4dde0d7 upstream. 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: [email protected] Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e680e63 commit 6721cba

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

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
@@ -12,7 +12,9 @@ enum linux_mptcp_mib_field {
1212
MPTCP_MIB_RETRANSSEGS, /* Segments retransmitted at the MPTCP-level */
1313
MPTCP_MIB_JOINNOTOKEN, /* Received MP_JOIN but the token was not found */
1414
MPTCP_MIB_JOINSYNRX, /* Received a SYN + MP_JOIN */
15+
MPTCP_MIB_JOINSYNBACKUPRX, /* Received a SYN + MP_JOIN + backup flag */
1516
MPTCP_MIB_JOINSYNACKRX, /* Received a SYN/ACK + MP_JOIN */
17+
MPTCP_MIB_JOINSYNACKBACKUPRX, /* Received a SYN/ACK + MP_JOIN + backup flag */
1618
MPTCP_MIB_JOINSYNACKMAC, /* HMAC was wrong on SYN/ACK + MP_JOIN */
1719
MPTCP_MIB_JOINACKRX, /* Received an ACK + MP_JOIN */
1820
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
@@ -166,6 +166,9 @@ static int subflow_check_req(struct request_sock *req,
166166
return 0;
167167
} else if (opt_mp_join) {
168168
SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINSYNRX);
169+
170+
if (mp_opt.backup)
171+
SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINSYNBACKUPRX);
169172
}
170173

171174
if (opt_mp_capable && listener->request_mptcp) {
@@ -558,6 +561,9 @@ static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
558561
subflow->mp_join = 1;
559562
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNACKRX);
560563

564+
if (subflow->backup)
565+
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNACKBACKUPRX);
566+
561567
if (subflow_use_different_dport(msk, sk)) {
562568
pr_debug("synack inet_dport=%d %d",
563569
ntohs(inet_sk(sk)->inet_dport),

0 commit comments

Comments
 (0)