Skip to contentSkip to conversation

mptcp: add support for event monitoring

PATCH Applied Florian Westphal 2 participants 2 messages Apr 16, 2021 – Apr 22, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mptcp: add support for event monitoring

This adds iproute2 support for mptcp event monitoring, e.g. creation, establishment, address announcements from the peer, subflow establishment and so on.

While the kernel-generated events are primarily aimed at mptcpd (e.g. for subflow management), this is also useful for debugging.

This adds print support for the existing events.

Sample output of 'ip mptcp monitor':
[ CREATED] token=83f3a692 remid=0 locid=0 saddr4=10.0.1.2 daddr4=10.0.1.1 sport=58710 dport=10011
[ ESTABLISHED] token=83f3a692 remid=0 locid=0 saddr4=10.0.1.2 daddr4=10.0.1.1 sport=58710 dport=10011
[SF_ESTABLISHED] token=83f3a692 remid=0 locid=1 saddr4=10.0.2.2 daddr4=10.0.1.1 sport=40195 dport=10011 backup=0
[ CLOSED] token=83f3a692

---
 include/libgenl.h          |   1 +
 include/uapi/linux/mptcp.h |   2 +
 ip/ipmptcp.c               | 113 +++++++++++++++++++++++++++++++++++++
 lib/libgenl.c              |  66 ++++++++++++++++++++++
 man/man8/ip-mptcp.8        |   8 +++
 5 files changed, 190 insertions(+)
include/libgenl.h +1 -0
index 656493a2c3c4..97281cc1103f 100644
@@ -21,6 +21,7 @@ struct {								\
 	},								\
 }
 
+int genl_add_mcast_grp(struct rtnl_handle *grth, __u16 genl_family, const char *group);
 int genl_resolve_family(struct rtnl_handle *grth, const char *family);
 int genl_init_handle(struct rtnl_handle *grth, const char *family,
 		     int *genl_family);
include/uapi/linux/mptcp.h +2 -0
index c3e40165ad4b..d7d47802bc98 100644
@@ -174,6 +174,8 @@ enum mptcp_event_attr {
 	MPTCP_ATTR_FLAGS,	/* u16 */
 	MPTCP_ATTR_TIMEOUT,	/* u32 */
 	MPTCP_ATTR_IF_IDX,	/* s32 */
+	MPTCP_ATTR_RESET_REASON,/* u32 */
+	MPTCP_ATTR_RESET_FLAGS, /* u32 */
 
 	__MPTCP_ATTR_AFTER_LAST
 };
ip/ipmptcp.c +113 -0

131 lines not on this page · raw message

lib/libgenl.c +66 -0

72 lines not on this page · raw message

man/man8/ip-mptcp.8 +8 -0
index ef8409ea4a24..b02cf03e757d 100644
@@ -65,6 +65,9 @@ ip-mptcp \- MPTCP path manager configuration
 .ti -8
 .BR "ip mptcp limits show"
 
+.ti -8
+.BR "ip mptcp monitor"
+
 .SH DESCRIPTION
 
 MPTCP is a transport protocol built on top of TCP that allows TCP
@@ -137,5 +140,10 @@ each accepted ADD_ADDR option, respecting the
 .IR SUBFLOW_NR
 limit.
 
+.sp
+.PP
+.B monitor
+displays creation and deletion of MPTCP connections as well as addition or removal of remote addresses and subflows.
+
 .SH AUTHOR
 Original Manpage by Paolo Abeni <[email protected]>
Signature · 1 line
2.26.3
Applied
#1 lore raw
Quoted 15 lines · Florian Westphal

This adds iproute2 support for mptcp event monitoring, e.g. creation, establishment, address announcements from the peer, subflow establishment and so on.

While the kernel-generated events are primarily aimed at mptcpd (e.g. for subflow management), this is also useful for debugging.

This adds print support for the existing events.

Sample output of 'ip mptcp monitor':
[ CREATED] token=83f3a692 remid=0 locid=0 saddr4=10.0.1.2 daddr4=10.0.1.1 sport=58710 dport=10011
[ ESTABLISHED] token=83f3a692 remid=0 locid=0 saddr4=10.0.1.2 daddr4=10.0.1.1 sport=58710 dport=10011
[SF_ESTABLISHED] token=83f3a692 remid=0 locid=1 saddr4=10.0.2.2 daddr4=10.0.1.1 sport=40195 dport=10011 backup=0
[ CLOSED] token=83f3a692

Quoted 9 lines
---
 include/libgenl.h          |   1 +
 include/uapi/linux/mptcp.h |   2 +
 ip/ipmptcp.c               | 113 +++++++++++++++++++++++++++++++++++++
 lib/libgenl.c              |  66 ++++++++++++++++++++++
 man/man8/ip-mptcp.8        |   8 +++
 5 files changed, 190 insertions(+)

applied to iproute2-next. Thanks,