mptcp: introduce MPTCP_FULL_INFO getsockopt
Some user-space applications want to monitor the subflows utilization. Dumping the per subflow tcp_info is not enough, as the PM could close and re-create the subflows under-the-hood, fooling the accounting. Even checking the src/dst addresses used by each subflow could not be enough, because new subflows could re-use the same address/port of the just closed one. This patch introduces a new socket option, allow dumping all the relevant information all-at-once (everything, everywhere...), in a consistent manner. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/388 Signed-off-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
6f06b4d4d1
commit
492432074e
2 changed files with 149 additions and 2 deletions
|
|
@ -249,9 +249,33 @@ struct mptcp_subflow_addrs {
|
|||
};
|
||||
};
|
||||
|
||||
struct mptcp_subflow_info {
|
||||
__u32 id;
|
||||
struct mptcp_subflow_addrs addrs;
|
||||
};
|
||||
|
||||
struct mptcp_full_info {
|
||||
__u32 size_tcpinfo_kernel; /* must be 0, set by kernel */
|
||||
__u32 size_tcpinfo_user;
|
||||
__u32 size_sfinfo_kernel; /* must be 0, set by kernel */
|
||||
__u32 size_sfinfo_user;
|
||||
__u32 num_subflows; /* must be 0, set by kernel (real subflow count) */
|
||||
__u32 size_arrays_user; /* max subflows that userspace is interested in;
|
||||
* the buffers at subflow_info/tcp_info
|
||||
* are respectively at least:
|
||||
* size_arrays * size_sfinfo_user
|
||||
* size_arrays * size_tcpinfo_user
|
||||
* bytes wide
|
||||
*/
|
||||
__aligned_u64 subflow_info;
|
||||
__aligned_u64 tcp_info;
|
||||
struct mptcp_info mptcp_info;
|
||||
};
|
||||
|
||||
/* MPTCP socket options */
|
||||
#define MPTCP_INFO 1
|
||||
#define MPTCP_TCPINFO 2
|
||||
#define MPTCP_SUBFLOW_ADDRS 3
|
||||
#define MPTCP_FULL_INFO 4
|
||||
|
||||
#endif /* _UAPI_MPTCP_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue