mptcp: add mibs for stale subflows processing

This allows monitoring exceptional events like
active backup scenarios.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Paolo Abeni 2021-08-13 15:15:46 -07:00 committed by David S. Miller
parent ff5a0b421c
commit fc1b4e3b62
5 changed files with 8 additions and 0 deletions

View File

@ -45,6 +45,8 @@ static const struct snmp_mib mptcp_snmp_list[] = {
SNMP_MIB_ITEM("MPPrioTx", MPTCP_MIB_MPPRIOTX), SNMP_MIB_ITEM("MPPrioTx", MPTCP_MIB_MPPRIOTX),
SNMP_MIB_ITEM("MPPrioRx", MPTCP_MIB_MPPRIORX), SNMP_MIB_ITEM("MPPrioRx", MPTCP_MIB_MPPRIORX),
SNMP_MIB_ITEM("RcvPruned", MPTCP_MIB_RCVPRUNED), SNMP_MIB_ITEM("RcvPruned", MPTCP_MIB_RCVPRUNED),
SNMP_MIB_ITEM("SubflowStale", MPTCP_MIB_SUBFLOWSTALE),
SNMP_MIB_ITEM("SubflowRecover", MPTCP_MIB_SUBFLOWRECOVER),
SNMP_MIB_SENTINEL SNMP_MIB_SENTINEL
}; };

View File

@ -38,6 +38,8 @@ enum linux_mptcp_mib_field {
MPTCP_MIB_MPPRIOTX, /* Transmit a MP_PRIO */ MPTCP_MIB_MPPRIOTX, /* Transmit a MP_PRIO */
MPTCP_MIB_MPPRIORX, /* Received a MP_PRIO */ MPTCP_MIB_MPPRIORX, /* Received a MP_PRIO */
MPTCP_MIB_RCVPRUNED, /* Incoming packet dropped due to memory limit */ MPTCP_MIB_RCVPRUNED, /* Incoming packet dropped due to memory limit */
MPTCP_MIB_SUBFLOWSTALE, /* Subflows entered 'stale' status */
MPTCP_MIB_SUBFLOWRECOVER, /* Subflows returned to active status after being stale */
__MPTCP_MIB_MAX __MPTCP_MIB_MAX
}; };

View File

@ -10,6 +10,8 @@
#include <net/mptcp.h> #include <net/mptcp.h>
#include "protocol.h" #include "protocol.h"
#include "mib.h"
/* path manager command handlers */ /* path manager command handlers */
int mptcp_pm_announce_addr(struct mptcp_sock *msk, int mptcp_pm_announce_addr(struct mptcp_sock *msk,

View File

@ -923,6 +923,7 @@ void mptcp_pm_nl_subflow_chk_stale(const struct mptcp_sock *msk, struct sock *ss
if (!tcp_rtx_and_write_queues_empty(ssk)) { if (!tcp_rtx_and_write_queues_empty(ssk)) {
subflow->stale = 1; subflow->stale = 1;
__mptcp_retransmit_pending_data(sk); __mptcp_retransmit_pending_data(sk);
MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_SUBFLOWSTALE);
} }
unlock_sock_fast(ssk, slow); unlock_sock_fast(ssk, slow);

View File

@ -1397,6 +1397,7 @@ void mptcp_subflow_set_active(struct mptcp_subflow_context *subflow)
return; return;
subflow->stale = 0; subflow->stale = 0;
MPTCP_INC_STATS(sock_net(mptcp_subflow_tcp_sock(subflow)), MPTCP_MIB_SUBFLOWRECOVER);
} }
bool mptcp_subflow_active(struct mptcp_subflow_context *subflow) bool mptcp_subflow_active(struct mptcp_subflow_context *subflow)