]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests: mptcp: add chk_subflows_total helper
authorGeliang Tang <geliang.tang@suse.com>
Mon, 4 Mar 2024 14:25:11 +0000 (15:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Mar 2024 14:48:44 +0000 (14:48 +0000)
commitf9190d7995a70af84319d23672b5f9561787ae78
tree8cbf353f9b5bcc6d78c62f25e1f5d3a92fb6d1a5
parentae1fa39da991ec54bdedc6e8ea4ec8863befac40
selftests: mptcp: add chk_subflows_total helper

commit 80775412882e273b8ef62124fae861cde8e6fb3d upstream.

This patch adds a new helper chk_subflows_total(), in it use the newly
added counter mptcpi_subflows_total to get the "correct" amount of
subflows, including the initial one.

To be compatible with old 'ss' or kernel versions not supporting this
counter, get the total subflows by listing TCP connections that are
MPTCP subflows:

    ss -ti state state established state syn-sent state syn-recv |
        grep -c tcp-ulp-mptcp.

Reviewed-by: Matthieu Baerts <matttbe@kernel.org>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20231128-send-net-next-2023107-v4-3-8d6b94150f6b@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/net/mptcp/mptcp_join.sh