From patchwork Mon Sep 2 10:45:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787027 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CFFE184536; Mon, 2 Sep 2024 10:46:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273972; cv=none; b=THKFg21VqGX8BeXInZbE/Z6g9Ra2okO3wQyYqgPVuGpYoJQr9j6AgrzrrZqSx/3w9ByLqaG+lURkIMB5bhN7MAdLSV6yMaLOkYkQiY7z3h+YR3XwCIp1ZX17CH8VufU+R18ZBSYYLFX7mWLOzVBLNaOX9rny3wKlVkbXFQxEdkI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273972; c=relaxed/simple; bh=gtOynYXakywMfVUFTn0bOS/Grvyo5lnBc4FmJT1+Y3c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=K9GudbwnIgKfaEROiW5C4JozpSPcJSGVfjBayyTZG32FU0MHqNvOJMbnU3OsXqONrD/P9V+jmROtUAthZGQqUgLZW6jWwJNRBKfPQYQL4pYBTBcAmPLvIXaqSE6hRtHFioXrWX2Qhz7L5MubysCYqZmdXDZvlgQx1zynsc9XwR0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=R17NAG79; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="R17NAG79" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80314C4CEC9; Mon, 2 Sep 2024 10:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725273972; bh=gtOynYXakywMfVUFTn0bOS/Grvyo5lnBc4FmJT1+Y3c=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=R17NAG79BhIg/acf0XwNnhwzlNUHgJ9rSn7GXGTYZ6NiJEOvGNloMcmmx6IDk4Oor jAgZ8yU1MHuJ9KyFo2Y3aAaJHKeh6xjj/a8rqSYYn9bUNOyWuLklQrd7XG21BXwN2s 28MpGBILyLg1qhGTZ6qvvsbt5b1aApIJp4ALbphe8id6bLKSCOqZYB78twW30yc/Gg AapUbOt94EuNVKCWJZ6KZduyasJ8Nust23FdBL8YhpqCP8opOVR5TiaXOyYq1vg0l7 05RHuMkUhaznrMH2C7R9rk5L95ghsoGpUK3+oob1SgkqI0t7t3+hykTh3LaI9DPAI1 QNyHmN5MR61KQ== From: "Matthieu Baerts (NGI0)" Date: Mon, 02 Sep 2024 12:45:52 +0200 Subject: [PATCH net-next 01/11] mptcp: pm: rename helpers linked to 'flush' Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-1-d3e0f3773b90@kernel.org> References: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> In-Reply-To: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2262; i=matttbe@kernel.org; h=from:subject:message-id; bh=gtOynYXakywMfVUFTn0bOS/Grvyo5lnBc4FmJT1+Y3c=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1ZdtdErTwaasD/SSNXBmVwt8ZrM41S4mFKXrM s7ePiRtC6WJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtWXbQAKCRD2t4JPQmmg c0U/EAC3d2wePLTVhrIWDfWFt1+zBpCyWXpf1IfvK4Q5ios3slRaEBUVDhzQ0lwQriaEFF4vuen 2YHy15w6OkMDVrmIKLRnbXzuunFfWKv3eDmuEWNdUnvp63M2Pi/R1SEmuBo9wwNd4LJi8nMyu3/ rOfhrA6ThMNqFo3Ilb3+9XKxCbvFjhGuNOCgseMzkiu1xRYWaDpQNeo/k8plz6JdlmMaOftaWjR YfJWLS3Dr+egvZbUu2jAPuxiGaLWuJX/AL+aeWKgDkeTIWaN5ZRj/DgbIqbYRTHIbywJaszZXSs jrHz0/khuICq4uDfIRKQ0s5ziqUo6TeceX3J8Zf1Bw1AkUima2pcQ0Dm+xl7mLdpTTavCp8+ZfJ Ggqls5zGvkmhSaojveyE1u6f9PWmbfC7qQ6YKwKRKWwLAZHE82iHYZhtmoP8pJJNyfkOv43O7Za CQ1IxifcxyjWz33u9I8whgh1l9uvpQjKJuSJl5Gd9henDqE2Z6T4+5bmPTB/TKQ0BBEqDPn6kXx Rlj669mJHYYKnclYmnBlgvkpT2aPBuAA7/jQbi++stI1/3joyA/ULDF0KmJBKXLyKMKUblqGpRW ki/0Q59lJHeLhJSt5pIJZEuO9nWjEEVNv5LGwvhI3bPRnRpehUm7meIbC69X8ws4KoHPyWzW1qH YdirCllTgihMwbA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Rename all the helpers specific to the flushing operations to make it clear that the intention is to flush all created subflows, and remove all announced addresses, not just a specific selection. That way, it is easier to understand why the id_avail_bitmap and local_addr_used are reset at the end. Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_netlink.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index f891bc714668..275959581586 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1672,8 +1672,8 @@ void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list) } /* Called from the in-kernel PM only */ -static void mptcp_pm_remove_addrs_and_subflows(struct mptcp_sock *msk, - struct list_head *rm_list) +static void mptcp_pm_flush_addrs_and_subflows(struct mptcp_sock *msk, + struct list_head *rm_list) { struct mptcp_rm_list alist = { .nr = 0 }, slist = { .nr = 0 }; struct mptcp_pm_addr_entry *entry; @@ -1701,8 +1701,8 @@ static void mptcp_pm_remove_addrs_and_subflows(struct mptcp_sock *msk, spin_unlock_bh(&msk->pm.lock); } -static void mptcp_nl_remove_addrs_list(struct net *net, - struct list_head *rm_list) +static void mptcp_nl_flush_addrs_list(struct net *net, + struct list_head *rm_list) { long s_slot = 0, s_num = 0; struct mptcp_sock *msk; @@ -1715,7 +1715,7 @@ static void mptcp_nl_remove_addrs_list(struct net *net, if (!mptcp_pm_is_userspace(msk)) { lock_sock(sk); - mptcp_pm_remove_addrs_and_subflows(msk, rm_list); + mptcp_pm_flush_addrs_and_subflows(msk, rm_list); release_sock(sk); } @@ -1756,7 +1756,7 @@ int mptcp_pm_nl_flush_addrs_doit(struct sk_buff *skb, struct genl_info *info) pernet->next_id = 1; bitmap_zero(pernet->id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1); spin_unlock_bh(&pernet->lock); - mptcp_nl_remove_addrs_list(sock_net(skb->sk), &free_list); + mptcp_nl_flush_addrs_list(sock_net(skb->sk), &free_list); synchronize_rcu(); __flush_addrs(&free_list); return 0; From patchwork Mon Sep 2 10:45:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787028 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8771418594A; Mon, 2 Sep 2024 10:46:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273975; cv=none; b=dgyc4UYbsQunX0ANoyl3RkCUvz6cF8i7/0XIRMM8mFkFAJSN4PWMho0tI1f//ZIMdbnpDopMjT2/kvCT9BmV1PWibyEGqA0PGwUMziUZV9Homb3+r1smdutDAEisO+k5QbaUtTKLKqJjis94qyHobm90EjbDMYDG89f/rYlnaDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273975; c=relaxed/simple; bh=uPXJ7emMKa+5QN/1bld1ruCPBaqlm+m4AQY7UI+VWnw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HwuI9FLiU1LtWqhDVGqJywEZ/xnldTemm/XhIoH69Ldt14LKW2JyTwJl5zVF4UGZMsgxCia5xtiBnE6ErX00QoiP6IwYab+797sBm9CyXScuSoA3I0TU95EQaDKObhTs76xTr9iaxaG5JoaV1VdUi9n4bXDTBnTiO8+B4bLsZqc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BIF8V7Rn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BIF8V7Rn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9170BC4CEC2; Mon, 2 Sep 2024 10:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725273975; bh=uPXJ7emMKa+5QN/1bld1ruCPBaqlm+m4AQY7UI+VWnw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BIF8V7RnGXVVnolPwQxdpzNyhzp1FxeW6lc848mBpEH8TxpEzgSuTh5saq6X9dniE eyaxHoP57Hl76lb7hK3jPo87qExk2TofWNBTeS802qYpQD7yrKo2ljHK6ZPa6P351j NT6TXDr1dHzsemzc531dh9T6Vb/S+OF74l6XVG1N0iQHgrv+QKzA8cBgK+Kn3zyfk5 T5iGh1gGuVUq2fubTCn5XmnGprxRP+60Tx1Ht64Cn25k6z5RphSG+2hvlWW3f4mpKI LgPeXCbSgJIPU1rkPsBLpTeOKuee3ftz0XxnBpo+CZ2xvhhgakH6QyBPkPzN2+QFYB pINNFscB8whnA== From: "Matthieu Baerts (NGI0)" Date: Mon, 02 Sep 2024 12:45:53 +0200 Subject: [PATCH net-next 02/11] mptcp: pm: reduce entries iterations on connect Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-2-d3e0f3773b90@kernel.org> References: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> In-Reply-To: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=15519; i=matttbe@kernel.org; h=from:subject:message-id; bh=uPXJ7emMKa+5QN/1bld1ruCPBaqlm+m4AQY7UI+VWnw=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1ZdtCT81seJNcho6yQWSdHOYZDIlwZfV2nDdT +cX61hQO7OJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtWXbQAKCRD2t4JPQmmg c1xcEADJURpj7QA4cbVjviuIjEg0SjAs/Gd8XkWfzjyR4ZI8/zySu71jJchcdWZfSDI20NylR7/ S4umYY9/RQ4ALjvKOTUVdUC0EX4Qvqcw+8ih32KW/+Bc0uUN8vSiwkX9lGyoTGPeJh3MjWF51Iy Vf60zpFKvOePm+SGnuGY5C4UFLZTRUAPahB82skHgTOohFZZyL2wwAGPwPnyZY0dH73lbzlXWFa IrEMrZwVuCIZgFcoOOPsgkxYHbGUE7ifPKY8AZeejfzV2A3miadyYse3slBFfbDbxv209WHBY/a T+BYHwgZ1094IQWJwV8ZKaXEq1mBfzLS7+n8P6PKvxm3Q0A1LRshrpOopfVag/85Rzn0bPJLV/1 W67OKCjy3AizSW161an3qWBYYvNb7GFE1XWRX7gi+hDVOHfimbd0afSvYLGOesw9iDCufK4tYhd w8qToHf/dM0xrbB6WqvC2Wt7VkobDFdI8m5iFyjsQwpviB9Zg5083TicJgNouenZXbh05nl0Bnx CkeZFAMB8Qoph5PHmFsEufQhgxxddMY8OSk6OBPM6Flg9ZvueFzk7q6B+vmM6eH35zF50g8Dm2x ccHRGjQfgsVwW98pvWeFCI5Eq1T+e20KsX87X2kwK1WaAZJ+rBT0QL3fkXZgjRYFfsh31VnifGm d/feOTWnSIBN8sg== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 __mptcp_subflow_connect() is currently called from the path-managers, which have all the required information to create subflows. No need to call the PM again to re-iterate over the list of entries with RCU lock to get more info. Instead, it is possible to pass a mptcp_pm_addr_entry structure, instead of a mptcp_addr_info one. The former contains the ifindex and the flags that are required when creating the new subflow. This is a partial revert of commit ee285257a9c1 ("mptcp: drop flags and ifindex arguments"). While at it, the local ID can also be set if it is known and 0, to avoid having to set it in the 'rebuild_header' hook, which will cause a new iteration of the endpoint entries. Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm.c | 11 -------- net/mptcp/pm_netlink.c | 66 ++++++++++++++++++------------------------------ net/mptcp/pm_userspace.c | 40 ++++++++++------------------- net/mptcp/protocol.h | 16 +++++------- net/mptcp/subflow.c | 29 +++++++++++++-------- 5 files changed, 62 insertions(+), 100 deletions(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 37f6dbcd8434..620264c75dc2 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -430,17 +430,6 @@ bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc) return mptcp_pm_nl_is_backup(msk, &skc_local); } -int mptcp_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsigned int id, - u8 *flags, int *ifindex) -{ - *flags = 0; - *ifindex = 0; - - if (mptcp_pm_is_userspace(msk)) - return mptcp_userspace_pm_get_flags_and_ifindex_by_id(msk, id, flags, ifindex); - return mptcp_pm_nl_get_flags_and_ifindex_by_id(msk, id, flags, ifindex); -} - int mptcp_pm_get_addr(struct sk_buff *skb, struct genl_info *info) { if (info->attrs[MPTCP_PM_ATTR_TOKEN]) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index 275959581586..62a42f7ee7cb 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -149,7 +149,7 @@ static bool lookup_subflow_by_daddr(const struct list_head *list, static bool select_local_address(const struct pm_nl_pernet *pernet, const struct mptcp_sock *msk, - struct mptcp_pm_addr_entry *new_entry) + struct mptcp_pm_local *new_local) { struct mptcp_pm_addr_entry *entry; bool found = false; @@ -164,7 +164,9 @@ select_local_address(const struct pm_nl_pernet *pernet, if (!test_bit(entry->addr.id, msk->pm.id_avail_bitmap)) continue; - *new_entry = *entry; + new_local->addr = entry->addr; + new_local->flags = entry->flags; + new_local->ifindex = entry->ifindex; found = true; break; } @@ -175,7 +177,7 @@ select_local_address(const struct pm_nl_pernet *pernet, static bool select_signal_address(struct pm_nl_pernet *pernet, const struct mptcp_sock *msk, - struct mptcp_pm_addr_entry *new_entry) + struct mptcp_pm_local *new_local) { struct mptcp_pm_addr_entry *entry; bool found = false; @@ -193,7 +195,9 @@ select_signal_address(struct pm_nl_pernet *pernet, const struct mptcp_sock *msk, if (!(entry->flags & MPTCP_PM_ADDR_FLAG_SIGNAL)) continue; - *new_entry = *entry; + new_local->addr = entry->addr; + new_local->flags = entry->flags; + new_local->ifindex = entry->ifindex; found = true; break; } @@ -524,11 +528,11 @@ __lookup_addr(struct pm_nl_pernet *pernet, const struct mptcp_addr_info *info) static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk) { struct sock *sk = (struct sock *)msk; - struct mptcp_pm_addr_entry local; unsigned int add_addr_signal_max; bool signal_and_subflow = false; unsigned int local_addr_max; struct pm_nl_pernet *pernet; + struct mptcp_pm_local local; unsigned int subflows_max; pernet = pm_nl_get_pernet(sock_net(sk)); @@ -629,7 +633,7 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk) spin_unlock_bh(&msk->pm.lock); for (i = 0; i < nr; i++) - __mptcp_subflow_connect(sk, &local.addr, &addrs[i]); + __mptcp_subflow_connect(sk, &local, &addrs[i]); spin_lock_bh(&msk->pm.lock); } mptcp_pm_nl_check_work_pending(msk); @@ -650,7 +654,7 @@ static void mptcp_pm_nl_subflow_established(struct mptcp_sock *msk) */ static unsigned int fill_local_addresses_vec(struct mptcp_sock *msk, struct mptcp_addr_info *remote, - struct mptcp_addr_info *addrs) + struct mptcp_pm_local *locals) { struct sock *sk = (struct sock *)msk; struct mptcp_pm_addr_entry *entry; @@ -673,13 +677,15 @@ static unsigned int fill_local_addresses_vec(struct mptcp_sock *msk, continue; if (msk->pm.subflows < subflows_max) { - msk->pm.subflows++; - addrs[i] = entry->addr; + locals[i].addr = entry->addr; + locals[i].flags = entry->flags; + locals[i].ifindex = entry->ifindex; /* Special case for ID0: set the correct ID */ - if (mptcp_addresses_equal(&entry->addr, &mpc_addr, entry->addr.port)) - addrs[i].id = 0; + if (mptcp_addresses_equal(&locals[i].addr, &mpc_addr, locals[i].addr.port)) + locals[i].addr.id = 0; + msk->pm.subflows++; i++; } } @@ -689,21 +695,19 @@ static unsigned int fill_local_addresses_vec(struct mptcp_sock *msk, * 'IPADDRANY' local address */ if (!i) { - struct mptcp_addr_info local; - - memset(&local, 0, sizeof(local)); - local.family = + memset(&locals[i], 0, sizeof(locals[i])); + locals[i].addr.family = #if IS_ENABLED(CONFIG_MPTCP_IPV6) remote->family == AF_INET6 && ipv6_addr_v4mapped(&remote->addr6) ? AF_INET : #endif remote->family; - if (!mptcp_pm_addr_families_match(sk, &local, remote)) + if (!mptcp_pm_addr_families_match(sk, &locals[i].addr, remote)) return 0; msk->pm.subflows++; - addrs[i++] = local; + i++; } return i; @@ -711,7 +715,7 @@ static unsigned int fill_local_addresses_vec(struct mptcp_sock *msk, static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk) { - struct mptcp_addr_info addrs[MPTCP_PM_ADDR_MAX]; + struct mptcp_pm_local locals[MPTCP_PM_ADDR_MAX]; struct sock *sk = (struct sock *)msk; unsigned int add_addr_accept_max; struct mptcp_addr_info remote; @@ -740,13 +744,13 @@ static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk) /* connect to the specified remote address, using whatever * local address the routing configuration will pick. */ - nr = fill_local_addresses_vec(msk, &remote, addrs); + nr = fill_local_addresses_vec(msk, &remote, locals); if (nr == 0) return; spin_unlock_bh(&msk->pm.lock); for (i = 0; i < nr; i++) - if (__mptcp_subflow_connect(sk, &addrs[i], &remote) == 0) + if (__mptcp_subflow_connect(sk, &locals[i], &remote) == 0) sf_created = true; spin_lock_bh(&msk->pm.lock); @@ -1433,28 +1437,6 @@ int mptcp_pm_nl_add_addr_doit(struct sk_buff *skb, struct genl_info *info) return ret; } -int mptcp_pm_nl_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsigned int id, - u8 *flags, int *ifindex) -{ - struct mptcp_pm_addr_entry *entry; - struct sock *sk = (struct sock *)msk; - struct net *net = sock_net(sk); - - /* No entries with ID 0 */ - if (id == 0) - return 0; - - rcu_read_lock(); - entry = __lookup_addr_by_id(pm_nl_get_pernet(net), id); - if (entry) { - *flags = entry->flags; - *ifindex = entry->ifindex; - } - rcu_read_unlock(); - - return 0; -} - static bool remove_anno_list_by_saddr(struct mptcp_sock *msk, const struct mptcp_addr_info *addr) { diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 8eaa9fbe3e34..2cceded3a83a 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -119,23 +119,6 @@ mptcp_userspace_pm_lookup_addr_by_id(struct mptcp_sock *msk, unsigned int id) return NULL; } -int mptcp_userspace_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, - unsigned int id, - u8 *flags, int *ifindex) -{ - struct mptcp_pm_addr_entry *match; - - spin_lock_bh(&msk->pm.lock); - match = mptcp_userspace_pm_lookup_addr_by_id(msk, id); - spin_unlock_bh(&msk->pm.lock); - if (match) { - *flags = match->flags; - *ifindex = match->ifindex; - } - - return 0; -} - int mptcp_userspace_pm_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_info *skc) { @@ -352,8 +335,9 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info) struct nlattr *raddr = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE]; struct nlattr *token = info->attrs[MPTCP_PM_ATTR_TOKEN]; struct nlattr *laddr = info->attrs[MPTCP_PM_ATTR_ADDR]; - struct mptcp_pm_addr_entry local = { 0 }; + struct mptcp_pm_addr_entry entry = { 0 }; struct mptcp_addr_info addr_r; + struct mptcp_pm_local local; struct mptcp_sock *msk; int err = -EINVAL; struct sock *sk; @@ -379,18 +363,18 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info) goto create_err; } - err = mptcp_pm_parse_entry(laddr, info, true, &local); + err = mptcp_pm_parse_entry(laddr, info, true, &entry); if (err < 0) { NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error parsing local addr"); goto create_err; } - if (local.flags & MPTCP_PM_ADDR_FLAG_SIGNAL) { + if (entry.flags & MPTCP_PM_ADDR_FLAG_SIGNAL) { GENL_SET_ERR_MSG(info, "invalid addr flags"); err = -EINVAL; goto create_err; } - local.flags |= MPTCP_PM_ADDR_FLAG_SUBFLOW; + entry.flags |= MPTCP_PM_ADDR_FLAG_SUBFLOW; err = mptcp_pm_parse_addr(raddr, info, &addr_r); if (err < 0) { @@ -398,27 +382,29 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info) goto create_err; } - if (!mptcp_pm_addr_families_match(sk, &local.addr, &addr_r)) { + if (!mptcp_pm_addr_families_match(sk, &entry.addr, &addr_r)) { GENL_SET_ERR_MSG(info, "families mismatch"); err = -EINVAL; goto create_err; } - err = mptcp_userspace_pm_append_new_local_addr(msk, &local, false); + err = mptcp_userspace_pm_append_new_local_addr(msk, &entry, false); if (err < 0) { GENL_SET_ERR_MSG(info, "did not match address and id"); goto create_err; } + local.addr = entry.addr; + local.flags = entry.flags; + local.ifindex = entry.ifindex; + lock_sock(sk); - - err = __mptcp_subflow_connect(sk, &local.addr, &addr_r); - + err = __mptcp_subflow_connect(sk, &local, &addr_r); release_sock(sk); spin_lock_bh(&msk->pm.lock); if (err) - mptcp_userspace_pm_delete_local_addr(msk, &local); + mptcp_userspace_pm_delete_local_addr(msk, &entry); else msk->pm.subflows++; spin_unlock_bh(&msk->pm.lock); diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 3735b20f2626..bf03bff9ac44 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -236,6 +236,12 @@ struct mptcp_pm_data { struct mptcp_rm_list rm_list_rx; }; +struct mptcp_pm_local { + struct mptcp_addr_info addr; + u8 flags; + int ifindex; +}; + struct mptcp_pm_addr_entry { struct list_head list; struct mptcp_addr_info addr; @@ -719,7 +725,7 @@ bool mptcp_addresses_equal(const struct mptcp_addr_info *a, void mptcp_local_address(const struct sock_common *skc, struct mptcp_addr_info *addr); /* called with sk socket lock held */ -int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_addr_info *loc, +int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_pm_local *local, const struct mptcp_addr_info *remote); int mptcp_subflow_create_socket(struct sock *sk, unsigned short family, struct socket **new_sock); @@ -1014,14 +1020,6 @@ mptcp_pm_del_add_timer(struct mptcp_sock *msk, struct mptcp_pm_add_entry * mptcp_lookup_anno_list_by_saddr(const struct mptcp_sock *msk, const struct mptcp_addr_info *addr); -int mptcp_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, - unsigned int id, - u8 *flags, int *ifindex); -int mptcp_pm_nl_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, unsigned int id, - u8 *flags, int *ifindex); -int mptcp_userspace_pm_get_flags_and_ifindex_by_id(struct mptcp_sock *msk, - unsigned int id, - u8 *flags, int *ifindex); int mptcp_pm_set_flags(struct sk_buff *skb, struct genl_info *info); int mptcp_pm_nl_set_flags(struct sk_buff *skb, struct genl_info *info); int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info); diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 064ab3235893..0796122c9467 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -1565,26 +1565,24 @@ void mptcp_info2sockaddr(const struct mptcp_addr_info *info, #endif } -int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_addr_info *loc, +int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_pm_local *local, const struct mptcp_addr_info *remote) { struct mptcp_sock *msk = mptcp_sk(sk); struct mptcp_subflow_context *subflow; + int local_id = local->addr.id; struct sockaddr_storage addr; int remote_id = remote->id; - int local_id = loc->id; int err = -ENOTCONN; struct socket *sf; struct sock *ssk; u32 remote_token; int addrlen; - int ifindex; - u8 flags; if (!mptcp_is_fully_established(sk)) goto err_out; - err = mptcp_subflow_create_socket(sk, loc->family, &sf); + err = mptcp_subflow_create_socket(sk, local->addr.family, &sf); if (err) goto err_out; @@ -1594,23 +1592,32 @@ int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_addr_info *loc, get_random_bytes(&subflow->local_nonce, sizeof(u32)); } while (!subflow->local_nonce); - if (local_id) + /* if 'IPADDRANY', the ID will be set later, after the routing */ + if (local->addr.family == AF_INET) { + if (!local->addr.addr.s_addr) + local_id = -1; +#if IS_ENABLED(CONFIG_MPTCP_IPV6) + } else if (sk->sk_family == AF_INET6) { + if (ipv6_addr_any(&local->addr.addr6)) + local_id = -1; +#endif + } + + if (local_id >= 0) subflow_set_local_id(subflow, local_id); - mptcp_pm_get_flags_and_ifindex_by_id(msk, local_id, - &flags, &ifindex); subflow->remote_key_valid = 1; subflow->remote_key = READ_ONCE(msk->remote_key); subflow->local_key = READ_ONCE(msk->local_key); subflow->token = msk->token; - mptcp_info2sockaddr(loc, &addr, ssk->sk_family); + mptcp_info2sockaddr(&local->addr, &addr, ssk->sk_family); addrlen = sizeof(struct sockaddr_in); #if IS_ENABLED(CONFIG_MPTCP_IPV6) if (addr.ss_family == AF_INET6) addrlen = sizeof(struct sockaddr_in6); #endif - ssk->sk_bound_dev_if = ifindex; + ssk->sk_bound_dev_if = local->ifindex; err = kernel_bind(sf, (struct sockaddr *)&addr, addrlen); if (err) goto failed; @@ -1621,7 +1628,7 @@ int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_addr_info *loc, subflow->remote_token = remote_token; WRITE_ONCE(subflow->remote_id, remote_id); subflow->request_join = 1; - subflow->request_bkup = !!(flags & MPTCP_PM_ADDR_FLAG_BACKUP); + subflow->request_bkup = !!(local->flags & MPTCP_PM_ADDR_FLAG_BACKUP); subflow->subflow_id = msk->subflow_id++; mptcp_info2sockaddr(remote, &addr, ssk->sk_family); From patchwork Mon Sep 2 10:45:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787029 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07028181B88; Mon, 2 Sep 2024 10:46:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273979; cv=none; b=WksNR7ZihhMDw4HY9zwjZphENGbUxWl2kALA1297fjrk4y+kDcefctu2TK7K/XK3WK+AuoA4zINx1h23MmmGSlGIPHpyiukrUWManaCSMVB0I/Y/gyjDkqTAdPXUW24ZAcZ304t/TNY9XdjFC0+YgaXWFOVfiThrBf+T+NXVMtM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273979; c=relaxed/simple; bh=ZGJ9pGvlXhT4hqhhgcYTpzLo5CjeyxTCGY7tbzG5uQI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Cd9U1kM4Tuet1YK61vBan701rlP0dwDZf2r7QgMtxVY8DZoY2T0QI2LolV18ya9PuxKmYtDhYA3krAwBoPobUoIGN/0QOoPDjUZt2r4j9gpn/APsP6g3P2TMA/WUgdvZ/pFFVHsRKSsf8aaD3S8tjtyCSNTq7FALDUj0bgz1ugs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AerRWR5P; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AerRWR5P" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5CA8C4CEC2; Mon, 2 Sep 2024 10:46:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725273978; bh=ZGJ9pGvlXhT4hqhhgcYTpzLo5CjeyxTCGY7tbzG5uQI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=AerRWR5P874u/mfp8DhkXMXj95lexOdCw8DOSF0wgDOy+KdC8KYfg0cc2XgCA07/7 CsWWQUhc45OuXvpM2vWzMnKbGRp94GWAMymu5+uP6B/Ov+Wy2sNia7PJd37u19KzvW lVIwPaQZcZ118z65ETf0J4A4HrjMLmcntiCMpFqZ45RS1h3i6D1vKIXrSIlpa+OIDG E17yEHNaVVTgyOU8drb707gj0MkGQxVIvRMYdQSFM/oMeHGB09uvuXM84acRmq6Mva 8OVVWxQ0jrlMM/HdpDD+OSuBkbl5I/yFRToL1sXAZvv8M+C2NHGkJqwI2JbXxfF0LH Taa8KYIZpdDfA== From: "Matthieu Baerts (NGI0)" Date: Mon, 02 Sep 2024 12:45:54 +0200 Subject: [PATCH net-next 03/11] mptcp: MIB counters for sent MP_JOIN Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-3-d3e0f3773b90@kernel.org> References: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> In-Reply-To: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=4595; i=matttbe@kernel.org; h=from:subject:message-id; bh=ZGJ9pGvlXhT4hqhhgcYTpzLo5CjeyxTCGY7tbzG5uQI=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1ZdtbCpcdvektVd0ZNGvpnfxu4dRb/o1HyjZU A51nTWFgwWJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtWXbQAKCRD2t4JPQmmg cwoND/0T9U9QElXTl+e/Ch/Kye4MfnNxrULw8IGL195+MNKiUiHlrPKVIWCxVkpTaoj4VJQIvnw oi5NLOR+Nswz/E73lBqDbIQJDD7S3oDJg/de2YpTGLv3eVB9KX7aKo7/uaxkVsosXJeQksauNqX HmIc+3sZB+ZOiLkOSMqdTN0bP+5eta2Dwtzt97rInE7Xm3h+jCaYnqLTgAE852MxD2sXbUH3CAz tXTZjJQDoGzIS7nSN9r/ccEQl0UO7JCnBGJ9irBmmdm4EzVSKwJmrT46ZwEaN6pcW3XVdIp8LqV 3aYTxrvDUU67N77MdGQOJH+qrdmJ7WC03cb3vg7JXPOnVwT/8UANDy3SCzF8uW2qG/l/RRfMn5N 8R9WNoWHsCmdxIZzU7z9f+P6XsCPE4K/mDkzxmiocsOueBtLP0JkdZMOUMcA71qY22fsvST4lYT VHlkc2e9HE053MP57zcpkDHwTwrCmOD7OJjnP8vdnaB3NKLhGZ+oYE6wechKC2CXZRSKb/d4fPu oH15YdtPb1FqwBWSG6L4btB8cUQsN+HCZXfcXBzd14qvxLzm0HOxxBKHz4TmzEp9uVLpslsh503 pMTwP8elRa4q5UuqxiunTx46lyLoj2PzHJHM5GcA4ShuPJ1hmRhc0/KNJhCRA/RyRiz49ZOcpML sEjc+MsfOzbHO2w== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Recently, a few issues have been discovered around the creation of additional subflows. Without these counters, it was difficult to point out the reason why some subflows were not created as expected. These counters should have been added earlier, because there is no other simple ways to extract such information from the kernel, and understand why subflows have not been created. While at it, some pr_debug() have been added, just in case the errno needs to be printed. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/509 Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/mib.c | 4 ++++ net/mptcp/mib.h | 4 ++++ net/mptcp/subflow.c | 21 ++++++++++++++++++--- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/net/mptcp/mib.c b/net/mptcp/mib.c index 7884217f33eb..ec0d461cb921 100644 --- a/net/mptcp/mib.c +++ b/net/mptcp/mib.c @@ -25,6 +25,10 @@ static const struct snmp_mib mptcp_snmp_list[] = { SNMP_MIB_ITEM("MPJoinSynAckHMacFailure", MPTCP_MIB_JOINSYNACKMAC), SNMP_MIB_ITEM("MPJoinAckRx", MPTCP_MIB_JOINACKRX), SNMP_MIB_ITEM("MPJoinAckHMacFailure", MPTCP_MIB_JOINACKMAC), + SNMP_MIB_ITEM("MPJoinSynTx", MPTCP_MIB_JOINSYNTX), + SNMP_MIB_ITEM("MPJoinSynTxCreatSkErr", MPTCP_MIB_JOINSYNTXCREATSKERR), + SNMP_MIB_ITEM("MPJoinSynTxBindErr", MPTCP_MIB_JOINSYNTXBINDERR), + SNMP_MIB_ITEM("MPJoinSynTxConnectErr", MPTCP_MIB_JOINSYNTXCONNECTERR), SNMP_MIB_ITEM("DSSNotMatching", MPTCP_MIB_DSSNOMATCH), SNMP_MIB_ITEM("InfiniteMapTx", MPTCP_MIB_INFINITEMAPTX), SNMP_MIB_ITEM("InfiniteMapRx", MPTCP_MIB_INFINITEMAPRX), diff --git a/net/mptcp/mib.h b/net/mptcp/mib.h index 66aa67f49d03..d68136f93dac 100644 --- a/net/mptcp/mib.h +++ b/net/mptcp/mib.h @@ -20,6 +20,10 @@ enum linux_mptcp_mib_field { MPTCP_MIB_JOINSYNACKMAC, /* HMAC was wrong on SYN/ACK + MP_JOIN */ MPTCP_MIB_JOINACKRX, /* Received an ACK + MP_JOIN */ MPTCP_MIB_JOINACKMAC, /* HMAC was wrong on ACK + MP_JOIN */ + MPTCP_MIB_JOINSYNTX, /* Sending a SYN + MP_JOIN */ + MPTCP_MIB_JOINSYNTXCREATSKERR, /* Not able to create a socket when sending a SYN + MP_JOIN */ + MPTCP_MIB_JOINSYNTXBINDERR, /* Not able to bind() the address when sending a SYN + MP_JOIN */ + MPTCP_MIB_JOINSYNTXCONNECTERR, /* Not able to connect() when sending a SYN + MP_JOIN */ MPTCP_MIB_DSSNOMATCH, /* Received a new mapping that did not match the previous one */ MPTCP_MIB_INFINITEMAPTX, /* Sent an infinite mapping */ MPTCP_MIB_INFINITEMAPRX, /* Received an infinite mapping */ diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 0796122c9467..b9b14e75e8c2 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -1579,12 +1579,17 @@ int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_pm_local *local, u32 remote_token; int addrlen; + /* The userspace PM sent the request too early? */ if (!mptcp_is_fully_established(sk)) goto err_out; err = mptcp_subflow_create_socket(sk, local->addr.family, &sf); - if (err) + if (err) { + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNTXCREATSKERR); + pr_debug("msk=%p local=%d remote=%d create sock error: %d\n", + msk, local_id, remote_id, err); goto err_out; + } ssk = sf->sk; subflow = mptcp_subflow_ctx(ssk); @@ -1619,8 +1624,12 @@ int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_pm_local *local, #endif ssk->sk_bound_dev_if = local->ifindex; err = kernel_bind(sf, (struct sockaddr *)&addr, addrlen); - if (err) + if (err) { + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNTXBINDERR); + pr_debug("msk=%p local=%d remote=%d bind error: %d\n", + msk, local_id, remote_id, err); goto failed; + } mptcp_crypto_key_sha(subflow->remote_key, &remote_token, NULL); pr_debug("msk=%p remote_token=%u local_id=%d remote_id=%d\n", msk, @@ -1635,8 +1644,14 @@ int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_pm_local *local, sock_hold(ssk); list_add_tail(&subflow->node, &msk->conn_list); err = kernel_connect(sf, (struct sockaddr *)&addr, addrlen, O_NONBLOCK); - if (err && err != -EINPROGRESS) + if (err && err != -EINPROGRESS) { + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNTXCONNECTERR); + pr_debug("msk=%p local=%d remote=%d connect error: %d\n", + msk, local_id, remote_id, err); goto failed_unlink; + } + + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNTX); /* discard the subflow socket */ mptcp_sock_graft(ssk, sk->sk_socket); From patchwork Mon Sep 2 10:45:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787030 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 041471D319D; Mon, 2 Sep 2024 10:46:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273982; cv=none; b=e2VspqFnq9aS7sTvZ09gpEvzuy+u7GTsYYP+1UGvOtj8MQH5zkE/ItCsgXOi2QUObV1IE/kJpFWY1nvLYka7cN3sYPOZtsB5yXqNV79Ijlk1nqQjUITvjMUrNuxT2n/fmGQIgRCG7frkrbx2WSNOyd6nb54RUEIuU1NfGMKZUdo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273982; c=relaxed/simple; bh=Vtdr0gZHJALXFJUTrkl+lzXlvXaEw8QZdMvHVOvRCUk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VX0nO5jk1syM9mjZAJ25aXKfSBlx4CGt2WoEwWEZfPberYIHb2Keoa+mQqPXJ1d5zC6V19wnVi07vw8lGTSjkCoA4QR+KkwDdXjgV7/pBc0sx9Q2oeAUmQ5gk9iHfLlLq5qSWyphoWnXUExntT9LcT+299aingjZLszbqY8qxAQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Pj4cRjXC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Pj4cRjXC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7F1EC4CEC8; Mon, 2 Sep 2024 10:46:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725273981; bh=Vtdr0gZHJALXFJUTrkl+lzXlvXaEw8QZdMvHVOvRCUk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Pj4cRjXCAIbsMvthu0G0CU+F7v9OjYZhAOo2YLDY5LGkbXXRUl9XTMF14EvDLZgV3 6OdvO/AFmfWNZOBRMJpWh7uw15VUI3muvzDXtA97Oyqhr+yM3R441Uvt55lFXsBAyK 09xR9BWwESf0FV+uySxecCDeiXoC5RRabA6QE1s1NoFbHYHgLY+dXfKfQkmiPYY3SB P/vtAxqnCna/NeVOppqe+mICK8tz84SHgKHcFcBpBcYhg9wrmwAuA/j4uo0ciL24KL FJBQTZgK7NKYtH3s5DlRVBKIS5UJZvJxHmEzkz/5z8Nb1EAGRkCSQYVl/hbVmnvBbr aibmD/omJXcdw== From: "Matthieu Baerts (NGI0)" Date: Mon, 02 Sep 2024 12:45:55 +0200 Subject: [PATCH net-next 04/11] selftests: mptcp: join: reduce join_nr params Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-4-d3e0f3773b90@kernel.org> References: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> In-Reply-To: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2833; i=matttbe@kernel.org; h=from:subject:message-id; bh=Vtdr0gZHJALXFJUTrkl+lzXlvXaEw8QZdMvHVOvRCUk=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1Zdt1MxyxM+cKyHlSzadAG5BnbKVoOuMjuNi3 HsvoTaPy4yJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtWXbQAKCRD2t4JPQmmg c0WND/4kCfWb9vMduMedBs+rbUeOdCMi7XDb3zfDpaAIhBOfXINXEXzjhRFFXpJUlT0brV7HzbK CiR5K5Th31CmmeiWcVPb98DS3TAmWsWQuKwijMNpZ5gMaqx6lVfeJbQdzZibjNWF31Op70kEQvl 2zVZndazsNFUCJNV10Ic/MKSJ69friTEKMsZlBHK9vQXp92EotGzivUUcxzg0CxFzdS9FXit0IB joj9c/jS9GLVQgqdVRNqiE2lbgjA/x8b4gYUAt3rmPbMn67m3E0n/gfOBgvH1isHbNX54Ai5Knf 9zMF6cg6ZMTlmmSXJ5zNhbpuqs4GXhnU6C/6QkhZjRy+EEFFPd3TI+KZd7NLPyFU9lBQMtudFVb uON7NwM5BO2sJIEizP74eajzGIxdNUwbLjXXHkqAiBlcBHaWFOL8ndvAeYhF11vQPaU06eQDmkF dx4NUMh5l7ZKiJY5wR8/x/G5jE9Z+oHu3mqrLQPA6wa3gnVet3Twudd4ya+2m5B/er06WjD/ifG i6svlktVynnYGlqJGAl4ouSPL8Z9qXjjsmFa/nUSr9IggkIf/29iEm75NZbJd695kry69iBhCmg CtEhVO3Y0v+Hl60CQrjtcigzfUCi9RYGb2zOW5q/Y2DW6iF/R+f0b+GDXTxYZtzEscyH0BaeCMx qLBTVStdB1ozrwQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 chk_join_nr() currently takes 9 positional parameters, 6 of them are optional. It makes it hard to read: chk_join_nr 1 1 1 1 0 1 1 0 4 Naming these vars helps to make it easier to read: join_csum_ns1=1 join_csum_ns2=0 \ join_fail_nr=1 join_rst_nr=1 join_infi_nr=0 \ join_corrupted_pkts=4 \ chk_join_nr 1 1 1 It will then be easier to add new optional parameters. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 31 ++++++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index a4762c49a878..51b226784c6b 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -61,6 +61,12 @@ unset sflags unset fastclose unset fullmesh unset speed +unset join_csum_ns1 +unset join_csum_ns2 +unset join_fail_nr +unset join_rst_nr +unset join_infi_nr +unset join_corrupted_pkts # generated using "nfbpf_compile '(ip && (ip[54] & 0xf0) == 0x30) || # (ip6 && (ip6[74] & 0xf0) == 0x30)'" @@ -1319,12 +1325,12 @@ chk_join_nr() local syn_nr=$1 local syn_ack_nr=$2 local ack_nr=$3 - local csum_ns1=${4:-0} - local csum_ns2=${5:-0} - local fail_nr=${6:-0} - local rst_nr=${7:-0} - local infi_nr=${8:-0} - local corrupted_pkts=${9:-0} + local csum_ns1=${join_csum_ns1:-0} + local csum_ns2=${join_csum_ns2:-0} + local fail_nr=${join_fail_nr:-0} + local rst_nr=${join_rst_nr:-0} + local infi_nr=${join_infi_nr:-0} + local corrupted_pkts=${join_corrupted_pkts:-0} local count local with_cookie @@ -3164,7 +3170,8 @@ fastclose_tests() MPTCP_LIB_SUBTEST_FLAKY=1 test_linkfail=1024 fastclose=server \ run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 0 0 0 0 0 0 1 + join_rst_nr=1 \ + chk_join_nr 0 0 0 chk_fclose_nr 1 1 invert chk_rst_nr 1 1 fi @@ -3183,7 +3190,10 @@ fail_tests() MPTCP_LIB_SUBTEST_FLAKY=1 test_linkfail=128 \ run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 0 0 0 +1 +0 1 0 1 "$(pedit_action_pkts)" + join_csum_ns1=+1 join_csum_ns2=+0 \ + join_fail_nr=1 join_rst_nr=0 join_infi_nr=1 \ + join_corrupted_pkts="$(pedit_action_pkts)" \ + chk_join_nr 0 0 0 chk_fail_nr 1 -1 invert fi @@ -3196,7 +3206,10 @@ fail_tests() pm_nl_add_endpoint $ns2 10.0.2.2 dev ns2eth2 flags subflow test_linkfail=1024 \ run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 1 1 1 1 0 1 1 0 "$(pedit_action_pkts)" + join_csum_ns1=1 join_csum_ns2=0 \ + join_fail_nr=1 join_rst_nr=1 join_infi_nr=0 \ + join_corrupted_pkts="$(pedit_action_pkts)" \ + chk_join_nr 1 1 1 fi } From patchwork Mon Sep 2 10:45:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787031 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B33E01D4143; Mon, 2 Sep 2024 10:46:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273984; cv=none; b=r1bLxsUUNcSfCvALpmirDbGxh7ws5HG/sMJ1gjNmhmhsnkMWOsFwfbYa/xDTTRyR9yym3EAr1Al6hX3LwsCRhx1C6J8aZ6PkX4fd6mVgCcKGLv1wSozc9A4PmJ7SsRSImPiPOUXJ6+r6NU24pdx/HrVfBWL9Sux6DxEntQVv2sM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273984; c=relaxed/simple; bh=tUo0nLrP36L6x+okdrn5Z90Ji+YrwAHRvl46fXw1QCE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pWspjMduDf9OQxvA6X9clZ0QOLc72/HP9kK/BMmAbfG9PzMFAkW+H5aagTKRlf3oLq5jTg95Coxe30qj2K4EKL3bkYUfwDZXTZjbyzyz87XmXfz8AIhAy7wbiw3pRJo4ZOF74IXwyTAbzyRxeINiMyiTTb0xh2bZ64G6qiwkcI4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CDkJM93M; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CDkJM93M" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04358C4CEC9; Mon, 2 Sep 2024 10:46:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725273984; bh=tUo0nLrP36L6x+okdrn5Z90Ji+YrwAHRvl46fXw1QCE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=CDkJM93MZKyiTqLD3Aks+OcSgejehAdGXgLzgcksQMhDNb37sQdkiWStUwavJZbzv xA00oWhgWxCfIhV6VXshq87H9c5Gvjxv7IpoBhFkubAbnqW5Vm8iY9u6R2etUjMSbH iDpMdthdguJiZDZlhQ0B+81PPX9rjKYhb5jh75kzpVLRTDBKeeAPHn73mlz1m4xMeG 8y+M5HF07443XFvGEXPL8JmxqF2fAiIeKcA3qxIJkBvwHUymZGQqdSkAAJeeVE+pJV uebk6lVEe5FpE4m2aDwgNEDGNJYdP/mRMmdrDLiQC60Xqu0Hb8jg7ON17bQDWP7IVr i53VTjq47cXBA== From: "Matthieu Baerts (NGI0)" Date: Mon, 02 Sep 2024 12:45:56 +0200 Subject: [PATCH net-next 05/11] selftests: mptcp: join: one line for join check Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-5-d3e0f3773b90@kernel.org> References: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> In-Reply-To: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3142; i=matttbe@kernel.org; h=from:subject:message-id; bh=tUo0nLrP36L6x+okdrn5Z90Ji+YrwAHRvl46fXw1QCE=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1ZdtEPeQwahWJkdBAkYgGL4Gxpjyb2PHUW4iN l5RsqMKzHqJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtWXbQAKCRD2t4JPQmmg cxS5D/92T2d5kqAXhMi9rzJhdnAFjjuDKxY8bhvxbuxrFrD8jrZwXUnq/Vj8pJOOH2Bp3rYglcY /aR36On762L1cdum8QBtjW9Dnda2+erpAugTbDOVDa2Mfmp+1GOXDQAgs3aKCl5+500hvYkO7HT nru/u1uNL/7nzS3ULij0UWuGIzG+1K6sFQHISUrLx9xnpKe2znj72qaqRIVQ7FJsHpPGJw8L9qM OZP5MJapYfjI2mYIJ6Z4ueqYMo4PiEkZU8kQxHI7wjEKlN9ajMk7aCizMXHY3FZnN4Qjh1j9Y9d K0YWedQ8kGWuIXGObmHp/fX5c9eXEBuvQPXi/apPoXXlXf1RPVICXCgMfQpnVTq9YlDyLc6eDf7 LlINS4et0buwqTuxhuv/S3AxpNSPpUQYMHG793MOV8mP+Qz9/hZF8Ts/IhO2TDX/FQNWecywMfP BHzuRM+t4nugrWPvv2vGyU4rJ1U3TPZNC1ZOSexDIjAYpJMpExjycPnmvA7cPPCMr7afmYG96JF kxV4uNUUlO6w2SZgUi6uKnz4roEAjVmj0xN0shA1DSx1NzCjE8QCmcVREN3nbC7vl6MyWvL4fdl aXUL/xHgECtP7+SZOIxVreC2wsBVJ8HuDSbbRlzKekwFVqUjxsAHmkDGKmvRwnUvry6hjNNEx0a keWHyQq1kG/pB0A== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Most tests are checking if the expected number of SYN/SYN+ACK/ACK JOINs have been received, each of them on one line. More Join related tests are going to be checked soon, no need to add 5 new lines per test in case of success, just one is enough. In case of issue, the errors will still be reported like before. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 45 ++++++++++++++++--------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 51b226784c6b..63580a5810bf 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -202,6 +202,22 @@ print_skip() mptcp_lib_pr_skip "${@}" } +# $1: check name; $2: rc +print_results() +{ + local check="${1}" + local rc=${2} + + print_check "${check}" + if [ ${rc} = ${KSFT_PASS} ]; then + print_ok + elif [ ${rc} = ${KSFT_SKIP} ]; then + print_skip + else + fail_test "see above" + fi +} + # [ $1: fail msg ] mark_as_skipped() { @@ -1331,6 +1347,7 @@ chk_join_nr() local rst_nr=${join_rst_nr:-0} local infi_nr=${join_infi_nr:-0} local corrupted_pkts=${join_corrupted_pkts:-0} + local rc=${KSFT_PASS} local count local with_cookie @@ -1338,43 +1355,41 @@ chk_join_nr() print_info "${corrupted_pkts} corrupted pkts" fi - print_check "syn" count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinSynRx") if [ -z "$count" ]; then - print_skip + rc=${KSFT_SKIP} elif [ "$count" != "$syn_nr" ]; then + rc=${KSFT_FAIL} + print_check "syn" fail_test "got $count JOIN[s] syn expected $syn_nr" - else - print_ok fi - print_check "synack" with_cookie=$(ip netns exec $ns2 sysctl -n net.ipv4.tcp_syncookies) count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynAckRx") if [ -z "$count" ]; then - print_skip + rc=${KSFT_SKIP} elif [ "$count" != "$syn_ack_nr" ]; then # simult connections exceeding the limit with cookie enabled could go up to # synack validation as the conn limit can be enforced reliably only after # the subflow creation - if [ "$with_cookie" = 2 ] && [ "$count" -gt "$syn_ack_nr" ] && [ "$count" -le "$syn_nr" ]; then - print_ok - else + if [ "$with_cookie" != 2 ] || [ "$count" -le "$syn_ack_nr" ] || [ "$count" -gt "$syn_nr" ]; then + rc=${KSFT_FAIL} + print_check "synack" fail_test "got $count JOIN[s] synack expected $syn_ack_nr" fi - else - print_ok fi - print_check "ack" count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinAckRx") if [ -z "$count" ]; then - print_skip + rc=${KSFT_SKIP} elif [ "$count" != "$ack_nr" ]; then + rc=${KSFT_FAIL} + print_check "ack" fail_test "got $count JOIN[s] ack expected $ack_nr" - else - print_ok fi + + print_results "join Rx" ${rc} + if $validate_checksum; then chk_csum_nr $csum_ns1 $csum_ns2 chk_fail_nr $fail_nr $fail_nr From patchwork Mon Sep 2 10:45:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787032 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA7CD17BEB2; Mon, 2 Sep 2024 10:46:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273987; cv=none; b=oXtEZS92tlT5VItepQht1jEhluJ+xo1aHhxEml4yZFVu3RWWpq98GzyCnPxyEJhfTfIjVDbutkKTAHr1NDkrMJr33YrQsH8FEI8HZGGvrNTUOxyDgfu4oX0ZsW4rQtrBLESFPBcwZVR1U7adjtvc5booguqwNydaLj7Rvh15ht8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273987; c=relaxed/simple; bh=ZY9zZaWNbVt54txYJGS4lxZ2J2RcmPqPjJsO2UzD9RU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bBVNxoo/bxPfFLB2sa/y+UU7xu/AldAiwbpmjq1JWDrt4KV9ZOsipUxFqCy7hJlUSFVhwxItcZKGQ43v9PW7VtgXRqtQalFLPKJd1Q8TNoZ6o1X6qU6YvqF+uwt6JwXb33YtoRdr7f3UUyknhy6UIZE+OXfI0cEDIlJUChVya8s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=I3hYHyu9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="I3hYHyu9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 140FFC4CED4; Mon, 2 Sep 2024 10:46:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725273987; bh=ZY9zZaWNbVt54txYJGS4lxZ2J2RcmPqPjJsO2UzD9RU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=I3hYHyu9Er1eJbWXCCkBK8FnEYP+8Fl+8MTEigUe6jbg88mphYvEEQenHIpaeuORg t4sWbkunCaSbm7ffdYlmEZrzzBd7z9q0triVAff3/k4Y9xH09vjWprfaWxI05iV3v4 ok9OV5K5tKZ07s+m+EX9x8IQ0kf5l7Lg0x5iz4VTEZ2/nO8NsAa2dshAN50ZEyBxvy ipOXWMgIPdcazSZcDHz84+FAOPrbzj7e7xqMxEFNOziEG+bfiDtTgEXzWsiTEgQnxB yJPADlzLpef954F1R+8FrtAwcP9ANYYNeLLvvG/5lAVWF+bXN/tctjmzKYKuLRfS+H BPxexM00RpgMA== From: "Matthieu Baerts (NGI0)" Date: Mon, 02 Sep 2024 12:45:57 +0200 Subject: [PATCH net-next 06/11] selftests: mptcp: join: validate MPJ SYN TX MIB counters Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-6-d3e0f3773b90@kernel.org> References: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> In-Reply-To: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=6034; i=matttbe@kernel.org; h=from:subject:message-id; bh=ZY9zZaWNbVt54txYJGS4lxZ2J2RcmPqPjJsO2UzD9RU=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1ZdtZqJfbARCE4TrElYcQ4P9oCW5/KmhCTEDP EwHJ0dVkA+JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtWXbQAKCRD2t4JPQmmg c9z+EAC/MNUpYfauS6tpW5dhzLPlvWB9Ms9B0rhFX0wAoHnMoLGh2qA9mYIoIxeODTY5Y5fZpt8 YY1OA3Je1kUOewTRhjHOPKEcQQJgNC0Vg5G4hF7OYxJqG6pu9A9U9wyiITbg84k3WljDedFxecK 4/mUEWoKrwRf9emOHIVB81ntd6Bl8GtFIvjm5Ct8sVtxiQ6QqwIOq2nr+3xSP/uqSejy2LFyydT L8uojoo6MBZMTpgN68Yal2fMj8ikSBm2//svH+mZ4LotzDgnUrWRbbYwKW0FXVWFmUayAZG/RkE XVkGxTFTivBNhMOeO8NxtIm/B12T81Sb74Lsesv8QohZUbxANGJ7VpMjic5ms2RMy5LR/hqjtDj HERWFHINfp3FU59QexmMQuee3ltCOHW4XgZeCLG0gpTfWa6JBN+iBvNDHhGrxidu3R0sQKCNR+5 IMUP9Pood7LBWCYhyBT6vMU25BD53+ReAj7Jq8YnEGB0qrlJiRzZZfbOOsyD5NJJ5nJSKK7hJb8 4lKvXZRyuAB3iRVr3DUn5d3oCtBCkF5XG7cgPdnr/kgQ1e43s9hmS7ALn6by89wnVtIMSnMGAhG YeDOBU6AlYT4idviPybxe6TquVx9XJXm4NaA2nJoc9FdB09AIQwbGFJDaO0Rx4XTf1LvliV8WAD 8WbhoxqLJ7BsrKQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 A few new MPJoinSynTx MIB counters have been added in a previous commit. They are being validated here in mptcp_join.sh selftest, each time the number of received MPJ are checked. Most of the time, the number of sent SYN+MPJ is the same as the received ones. But sometimes, there are more, because there are dropped, or there are errors. While at it, the "no MPC reuse with single endpoint" subtest has been modified to force a bind() error. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 89 ++++++++++++++++++++++--- 1 file changed, 78 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 63580a5810bf..23f8e2254064 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -67,6 +67,10 @@ unset join_fail_nr unset join_rst_nr unset join_infi_nr unset join_corrupted_pkts +unset join_syn_tx +unset join_create_err +unset join_bind_err +unset join_connect_err # generated using "nfbpf_compile '(ip && (ip[54] & 0xf0) == 0x30) || # (ip6 && (ip6[74] & 0xf0) == 0x30)'" @@ -1336,6 +1340,54 @@ chk_infi_nr() fi } +chk_join_tx_nr() +{ + local syn_tx=${join_syn_tx:-0} + local create=${join_create_err:-0} + local bind=${join_bind_err:-0} + local connect=${join_connect_err:-0} + local rc=${KSFT_PASS} + local count + + count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTx") + if [ -z "$count" ]; then + rc=${KSFT_SKIP} + elif [ "$count" != "$syn_tx" ]; then + rc=${KSFT_FAIL} + print_check "syn tx" + fail_test "got $count JOIN[s] syn tx expected $syn_tx" + fi + + count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTxCreatSkErr") + if [ -z "$count" ]; then + rc=${KSFT_SKIP} + elif [ "$count" != "$create" ]; then + rc=${KSFT_FAIL} + print_check "syn tx create socket error" + fail_test "got $count JOIN[s] syn tx create socket error expected $create" + fi + + count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTxBindErr") + if [ -z "$count" ]; then + rc=${KSFT_SKIP} + elif [ "$count" != "$bind" ]; then + rc=${KSFT_FAIL} + print_check "syn tx bind error" + fail_test "got $count JOIN[s] syn tx bind error expected $bind" + fi + + count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTxConnectErr") + if [ -z "$count" ]; then + rc=${KSFT_SKIP} + elif [ "$count" != "$connect" ]; then + rc=${KSFT_FAIL} + print_check "syn tx connect error" + fail_test "got $count JOIN[s] syn tx connect error expected $connect" + fi + + print_results "join Tx" ${rc} +} + chk_join_nr() { local syn_nr=$1 @@ -1390,6 +1442,9 @@ chk_join_nr() print_results "join Rx" ${rc} + join_syn_tx="${join_syn_tx:-${syn_nr}}" \ + chk_join_tx_nr + if $validate_checksum; then chk_csum_nr $csum_ns1 $csum_ns2 chk_fail_nr $fail_nr $fail_nr @@ -1930,9 +1985,11 @@ subflows_error_tests() pm_nl_set_limits $ns1 0 1 pm_nl_set_limits $ns2 0 1 pm_nl_add_endpoint $ns2 10.0.1.2 flags subflow + pm_nl_add_endpoint $ns2 10.0.12.2 flags subflow speed=slow \ run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 0 0 0 + join_bind_err=1 \ + chk_join_nr 0 0 0 fi # multiple subflows, with subflow creation error @@ -1944,7 +2001,8 @@ subflows_error_tests() pm_nl_add_endpoint $ns2 10.0.2.2 flags subflow speed=slow \ run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 1 1 1 + join_syn_tx=2 \ + chk_join_nr 1 1 1 fi # multiple subflows, with subflow timeout on MPJ @@ -1956,7 +2014,8 @@ subflows_error_tests() pm_nl_add_endpoint $ns2 10.0.2.2 flags subflow speed=slow \ run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 1 1 1 + join_syn_tx=2 \ + chk_join_nr 1 1 1 fi # multiple subflows, check that the endpoint corresponding to @@ -1977,7 +2036,8 @@ subflows_error_tests() # additional subflow could be created only if the PM select # the later endpoint, skipping the already used one - chk_join_nr 1 1 1 + join_syn_tx=2 \ + chk_join_nr 1 1 1 fi } @@ -2063,7 +2123,8 @@ signal_address_tests() pm_nl_add_endpoint $ns1 10.0.14.1 flags signal pm_nl_set_limits $ns2 3 3 run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 1 1 1 + join_syn_tx=3 \ + chk_join_nr 1 1 1 chk_add_nr 3 3 fi @@ -2231,7 +2292,8 @@ add_addr_timeout_tests() pm_nl_set_limits $ns2 2 2 speed=10 \ run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 1 1 1 + join_syn_tx=2 \ + chk_join_nr 1 1 1 chk_add_nr 8 0 fi } @@ -2331,7 +2393,8 @@ remove_tests() pm_nl_set_limits $ns2 2 2 addr_nr_ns1=-3 speed=10 \ run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 1 1 1 + join_syn_tx=2 join_connect_err=1 \ + chk_join_nr 1 1 1 chk_add_nr 3 3 chk_rm_nr 3 1 invert chk_rst_nr 0 0 @@ -2396,7 +2459,8 @@ remove_tests() pm_nl_set_limits $ns2 3 3 addr_nr_ns1=-8 speed=slow \ run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 1 1 1 + join_syn_tx=3 \ + chk_join_nr 1 1 1 chk_add_nr 3 3 chk_rm_nr 3 1 invert chk_rst_nr 0 0 @@ -3703,7 +3767,8 @@ endpoint_tests() chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 6 chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 5 # one has been closed before estab - chk_join_nr 6 6 6 + join_syn_tx=7 \ + chk_join_nr 6 6 6 chk_rm_nr 4 4 fi @@ -3775,7 +3840,8 @@ endpoint_tests() chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 5 chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 3 - chk_join_nr 5 5 5 + join_connect_err=1 \ + chk_join_nr 5 5 5 chk_add_nr 6 6 chk_rm_nr 4 3 invert fi @@ -3806,7 +3872,8 @@ endpoint_tests() wait_mpj $ns2 mptcp_lib_kill_wait $tests_pid - chk_join_nr 2 2 2 + join_syn_tx=3 join_connect_err=1 \ + chk_join_nr 2 2 2 chk_add_nr 2 2 chk_rm_nr 1 0 invert fi From patchwork Mon Sep 2 10:45:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787033 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2A981D54DC; Mon, 2 Sep 2024 10:46:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273991; cv=none; b=lcFeTEF11oq4h3zVBBdNvfuFJwSeBBth9ZtKLkIctDg9ELB5pIL8lis5R+7s4JwC7cuwmrYIMRqKmUPT6SxzxfptK/CARwta6gQEU9u8HvfcLchmrUXetCcauEFWvVDei1rrT0fCjvHeTk4HzM9CVJOJOZaWOSBPV7w+rGjdqa4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273991; c=relaxed/simple; bh=RjQy6bhiC2D+XOt09U0I3DX7UV2GSih6fnqKazD+QAo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=e4zqE1sZx4i5IU8qauH+Y+VUuXGr5nViFZAaNj7X8NgpTB44+vUPJNMu5W0e/dHcK8Mrk2obo7AbhxKi9m3Z90g+KzCj0IxvAtsEZJ2yz3KaGxSfg5tPFUPLdqMPU1KQUc+DzMxGxMp1NNW5VYyLM3aZEPuS8hTsXm2t/zRN3nk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hpeRns8H; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hpeRns8H" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25837C4CEC6; Mon, 2 Sep 2024 10:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725273990; bh=RjQy6bhiC2D+XOt09U0I3DX7UV2GSih6fnqKazD+QAo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hpeRns8H4WF0KWYWbxbTAdeUgx3dOjid6fVb+gIg+/VFreZK7HB7maQp3fuRP0EkQ qORG9lcT+OxVKDXcNXFWH7GYP/vCn1KQJyabpUiGHnQLYA4FifJbefh2zgH/oZjbRu l+o+c+F/74zpcdD+oCMbxrDKts/et13o3j75r+araG5AEVEpJmC2qPqnym51BhZdS0 fkqtZMKPx7E/KZ32yD4jkhrFr6SMWagk+Y18nyNyRQ7y67wGHyYw9qilhEZj68RZ49 2SHosFzkdVYC+dwhzwGnaDSB8nWFkaWo1g5nFm5qUZ4agvdPVLZefVLbZXcNHuhdLL NzhueUvDOqdnA== From: "Matthieu Baerts (NGI0)" Date: Mon, 02 Sep 2024 12:45:58 +0200 Subject: [PATCH net-next 07/11] selftests: mptcp: join: more explicit check name Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-7-d3e0f3773b90@kernel.org> References: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> In-Reply-To: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=7942; i=matttbe@kernel.org; h=from:subject:message-id; bh=RjQy6bhiC2D+XOt09U0I3DX7UV2GSih6fnqKazD+QAo=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1ZdtJnEZofCD0jQr9NLgt1DJzF4Z1hsebBDhg Nx1X6qn4BWJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtWXbQAKCRD2t4JPQmmg cwDNEACZaqKAVTgUucmVNlmqOXLFfO4kkDGRzBMm2IoSRVR5PB2O2z9H2j2Vi3nSPSr9XLf5qim hTKRhQPgXG5cgLZCuIMmAvDXENl4rrFGRS2Py8TR0qSiR0q0eCm/npB/cHVbQAJ/c3XAZYXQMIN joln6qReoHCrcQuQvC3IuZ8tnLgbCGoLRWBQaEAXCtfndMI2xb0nK/y2HUMX2weEH2bR2oDWIzx LyiCGliLBpc7FUAhWX2hfaQX2jiwBDLD7LYK3icMnCc58zpccEJqtoskBqOsVQBbtNOS8pauzj+ E6NTaelCUeH50lxUARIqBQLVjwI4ibgdN2J2vMxyFR5XUULcoyV/d4X5FKEgVxzqDHyNZqeKNHs cUxjr8da7+uFL5iP4B05Tsce+f6+/PgfANzvAJv4vjlFEJRPVLlaOEsTG9IIEzdF3ZkeLSxTUv4 M12L3qzkY5iahVRrPaASrZ11vodjU4vSoI5LCWZ/7OuYWS+ghyvHZur77boK3rzMkeA9ZVBB8oX BQL+c0PxYtxJCosjiQDosE+7ewJFgiuy8So4WmGps4H/DiBxNA5pL95VXA9zeweHH9HQQ+1drnd h2BD3VkyTl1w1sd3kHm/LUp3y2Wq5mBGMxzlulnw2fta3l25xfxpuxXA4+tZ3MxmhhVvTnKEPcc hxFFfcwBLIVPl3Q== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Before, the check names had to be very short. It is no longer the case now that these checks are printed on a dedicated line. Then, it looks better to have more explicit names. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 65 +++++++++++++------------ 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 23f8e2254064..7993e0e0029e 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -865,7 +865,7 @@ chk_cestab_nr() local cestab=$2 local count - print_check "cestab $cestab" + print_check "currently established: $cestab" count=$(mptcp_lib_get_counter ${ns} "MPTcpExtMPCurrEstab") if [ -z "$count" ]; then print_skip @@ -1141,7 +1141,7 @@ chk_csum_nr() csum_ns2=${csum_ns2:1} fi - print_check "sum" + print_check "checksum server" count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtDataCsumErr") if [ -n "$count" ] && [ "$count" != "$csum_ns1" ]; then extra_msg+=" ns1=$count" @@ -1154,7 +1154,8 @@ chk_csum_nr() else print_ok fi - print_check "csum" + + print_check "checksum client" count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtDataCsumErr") if [ -n "$count" ] && [ "$count" != "$csum_ns2" ]; then extra_msg+=" ns2=$count" @@ -1198,7 +1199,7 @@ chk_fail_nr() fail_rx=${fail_rx:1} fi - print_check "ftx" + print_check "fail tx" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPFailTx") if [ -n "$count" ] && [ "$count" != "$fail_tx" ]; then extra_msg+=",tx=$count" @@ -1212,7 +1213,7 @@ chk_fail_nr() print_ok fi - print_check "failrx" + print_check "fail rx" count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtMPFailRx") if [ -n "$count" ] && [ "$count" != "$fail_rx" ]; then extra_msg+=",rx=$count" @@ -1245,7 +1246,7 @@ chk_fclose_nr() extra_msg="invert" fi - print_check "ctx" + print_check "fast close tx" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPFastcloseTx") if [ -z "$count" ]; then print_skip @@ -1256,7 +1257,7 @@ chk_fclose_nr() print_ok fi - print_check "fclzrx" + print_check "fast close rx" count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtMPFastcloseRx") if [ -z "$count" ]; then print_skip @@ -1286,7 +1287,7 @@ chk_rst_nr() extra_msg="invert" fi - print_check "rtx" + print_check "reset tx" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPRstTx") if [ -z "$count" ]; then print_skip @@ -1298,7 +1299,7 @@ chk_rst_nr() print_ok fi - print_check "rstrx" + print_check "reset rx" count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtMPRstRx") if [ -z "$count" ]; then print_skip @@ -1319,7 +1320,7 @@ chk_infi_nr() local infi_rx=$2 local count - print_check "itx" + print_check "infi tx" count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtInfiniteMapTx") if [ -z "$count" ]; then print_skip @@ -1329,7 +1330,7 @@ chk_infi_nr() print_ok fi - print_check "infirx" + print_check "infi rx" count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtInfiniteMapRx") if [ -z "$count" ]; then print_skip @@ -1412,8 +1413,8 @@ chk_join_nr() rc=${KSFT_SKIP} elif [ "$count" != "$syn_nr" ]; then rc=${KSFT_FAIL} - print_check "syn" - fail_test "got $count JOIN[s] syn expected $syn_nr" + print_check "syn rx" + fail_test "got $count JOIN[s] syn rx expected $syn_nr" fi with_cookie=$(ip netns exec $ns2 sysctl -n net.ipv4.tcp_syncookies) @@ -1426,8 +1427,8 @@ chk_join_nr() # the subflow creation if [ "$with_cookie" != 2 ] || [ "$count" -le "$syn_ack_nr" ] || [ "$count" -gt "$syn_nr" ]; then rc=${KSFT_FAIL} - print_check "synack" - fail_test "got $count JOIN[s] synack expected $syn_ack_nr" + print_check "synack rx" + fail_test "got $count JOIN[s] synack rx expected $syn_ack_nr" fi fi @@ -1436,8 +1437,8 @@ chk_join_nr() rc=${KSFT_SKIP} elif [ "$count" != "$ack_nr" ]; then rc=${KSFT_FAIL} - print_check "ack" - fail_test "got $count JOIN[s] ack expected $ack_nr" + print_check "ack rx" + fail_test "got $count JOIN[s] ack rx expected $ack_nr" fi print_results "join Rx" ${rc} @@ -1517,7 +1518,7 @@ chk_add_nr() timeout=$(ip netns exec ${ns_tx} sysctl -n net.mptcp.add_addr_timeout) - print_check "add" + print_check "add addr rx" count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtAddAddr") if [ -z "$count" ]; then print_skip @@ -1529,7 +1530,7 @@ chk_add_nr() print_ok fi - print_check "echo" + print_check "add addr echo rx" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtEchoAdd") if [ -z "$count" ]; then print_skip @@ -1540,7 +1541,7 @@ chk_add_nr() fi if [ $port_nr -gt 0 ]; then - print_check "pt" + print_check "add addr rx with port" count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtPortAdd") if [ -z "$count" ]; then print_skip @@ -1550,7 +1551,7 @@ chk_add_nr() print_ok fi - print_check "syn" + print_check "syn rx port" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPJoinPortSynRx") if [ -z "$count" ]; then print_skip @@ -1561,7 +1562,7 @@ chk_add_nr() print_ok fi - print_check "synack" + print_check "synack rx port" count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtMPJoinPortSynAckRx") if [ -z "$count" ]; then print_skip @@ -1572,7 +1573,7 @@ chk_add_nr() print_ok fi - print_check "ack" + print_check "ack rx port" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPJoinPortAckRx") if [ -z "$count" ]; then print_skip @@ -1583,7 +1584,7 @@ chk_add_nr() print_ok fi - print_check "syn" + print_check "syn rx port mismatch" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMismatchPortSynRx") if [ -z "$count" ]; then print_skip @@ -1594,7 +1595,7 @@ chk_add_nr() print_ok fi - print_check "ack" + print_check "ack rx port mismatch" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMismatchPortAckRx") if [ -z "$count" ]; then print_skip @@ -1618,7 +1619,7 @@ chk_add_tx_nr() timeout=$(ip netns exec $ns1 sysctl -n net.mptcp.add_addr_timeout) - print_check "add TX" + print_check "add addr tx" count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtAddAddrTx") if [ -z "$count" ]; then print_skip @@ -1630,7 +1631,7 @@ chk_add_tx_nr() print_ok fi - print_check "echo TX" + print_check "add addr echo tx" count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtEchoAddTx") if [ -z "$count" ]; then print_skip @@ -1668,7 +1669,7 @@ chk_rm_nr() extra_msg="invert" fi - print_check "rm" + print_check "rm addr rx" count=$(mptcp_lib_get_counter ${addr_ns} "MPTcpExtRmAddr") if [ -z "$count" ]; then print_skip @@ -1678,7 +1679,7 @@ chk_rm_nr() print_ok fi - print_check "rmsf" + print_check "rm subflow" count=$(mptcp_lib_get_counter ${subflow_ns} "MPTcpExtRmSubflow") if [ -z "$count" ]; then print_skip @@ -1713,7 +1714,7 @@ chk_rm_tx_nr() { local rm_addr_tx_nr=$1 - print_check "rm TX" + print_check "rm addr tx" count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtRmAddrTx") if [ -z "$count" ]; then print_skip @@ -1732,7 +1733,7 @@ chk_prio_nr() local mpj_syn_ack=$4 local count - print_check "ptx" + print_check "mp_prio tx" count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPPrioTx") if [ -z "$count" ]; then print_skip @@ -1742,7 +1743,7 @@ chk_prio_nr() print_ok fi - print_check "prx" + print_check "mp_prio rx" count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPPrioRx") if [ -z "$count" ]; then print_skip From patchwork Mon Sep 2 10:45:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787034 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39C681D54FB; Mon, 2 Sep 2024 10:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273994; cv=none; b=cLL/1Za+w7taFCxU8fahyRqS1e8YA86tv9qXG8iX/5Se5NySIxT1LMa9X5h7d3J7RYIsU8ZbLikBb12qaB49yfioadSqKMr+cRfEO4gf/n88lObXVbkp5Ti/WzTvfZRfT4YUFVZ150zRoPyBxRolpu7hB4qOu6N1Pu1797KXPio= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273994; c=relaxed/simple; bh=epCAipyYDn9gymi3xegOuqC9Tr8hGUkB6xYywrz6Qxg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=I5q7qWDmf5nT/3cXz/KyjrgGpddNBYj0NIbCPUkjXHtCx0p6KDXW8o0DisiFGBRABpix3ZwAuYqhU4Gie0QOsAI3VXGdnE7QlDJg+iVnk2HWD3rmTS/TKA7VpBXWeonvumrzpGb2exuW+fkgqaNj9FRIxjR4CcByP66ju9QtXC0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VaBAj9Ln; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VaBAj9Ln" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35EA3C4AF0F; Mon, 2 Sep 2024 10:46:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725273993; bh=epCAipyYDn9gymi3xegOuqC9Tr8hGUkB6xYywrz6Qxg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=VaBAj9LnCGl5Se5anmdSLiTjmIIFI2QTkxJkDWNFSu5PInGip1rcEMeSJdmbnaImx VPgQEeTXOckWIIM7ry/zps+Kj2rMcWIMDpBV0CSlUzM9Cz3v0JLjPRjm7TBhEb9mm5 b6L5rGKM95sVvEgSsvNatTQtL6bHxLJ87hT6Kbv8HKPcg4Q1/A5tHoFyYf7rDtaJQ8 dRbqw3mz9vte74AyZQEoC4/isRtGpt6ddk/5zY559bf+nrequA1QZSWbbfnsDLE8qJ EFqtqeeJiHd803Zjer//9WEcJI/J9aRM73QgJsSE9fAmVXgciDTXSiBaF6q1DVE/Ug K4xyg5rmTpT1Q== From: "Matthieu Baerts (NGI0)" Date: Mon, 02 Sep 2024 12:45:59 +0200 Subject: [PATCH net-next 08/11] selftests: mptcp: join: specify host being checked Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-8-d3e0f3773b90@kernel.org> References: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> In-Reply-To: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=8724; i=matttbe@kernel.org; h=from:subject:message-id; bh=epCAipyYDn9gymi3xegOuqC9Tr8hGUkB6xYywrz6Qxg=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1ZdtDNEbWDeGUc8/QnFz8uxnCjirbuWfNn+Tr 0koGxsdHEWJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtWXbQAKCRD2t4JPQmmg c0x4D/9uLEm4fi7NfqgU2xrywf6J9HUZZLeZ1Imh5xMdJmZIyND97PI5zDDABt4fcXuGptPPxqx MQ/dcJeRNnHPnNmrceMRAFaG2rmwXBM3Di0Y1mFUxtF2mM5HYKO+eoJ1rxsPTOsTsqxaVM+yK5S Th3GhddFmBJprjjXxJUkFYSJgnhP6Vumb6MiUP38Xaq0OhT5i3eo/J5k9xahK4Ssxf94KzjTcku V/I/dn3xKoFv+PWWHSEvgaYuCwpp3H/O4zrW8W/Vv3oUvdgdVju1ejczF5GJfnSH/wzqYCXwwID 6EbgWKsPYoyvQs0wkZ9bq9aJ1V3HRWxFm/v4vs7Ou1udfCWnTypa+rnX5WpdBORf0orG2+LNi4b 2WnHFrtbfbB7A3OJ8lGAWqDpO+el4aRGFziMw9jfPPCkqDs/S2sXPx4rP9JKyYKjPrqxbVjFLCH 6mMFDMsxv0tngPBHjNtkwFyGG14Do48dDJORWLPAjnoimOsdEr0pgnz0Wby+9X7nTvUg41xC9zd FKLnofA6MF00A03mlHc1ouk8ivHXyWNdpfGHmgFTKgkcGzb5hdtYrPSVq0EEGYNbgbBsdHgeHBs RLGxHGzkySjfHD3qL39ARq0DeMCjMP8+1dHWVpr/+GxioPND25t+YVW6Cxc3rX4i7XV+XzslXXx Madqe/LeWR7GzUA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Instead of displaying 'invert' when looking at some events like MP_FAIL, MP_FASTCLOSE, MP_RESET, RM_ADDR, which is a bit vague because they are not traditionnaly sent from one side, the host being checked is now printed. For the ADD_ADDR, only display the host when it is the client sending it, which is more unusual. Also before, the 'invert' message was printed after a few checks, but it was not clear which ones exactly. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 89 +++++++++++++------------ 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 7993e0e0029e..321197d8977e 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -1180,6 +1180,8 @@ chk_fail_nr() local count local ns_tx=$ns1 local ns_rx=$ns2 + local tx="server" + local rx="client" local extra_msg="" local allow_tx_lost=0 local allow_rx_lost=0 @@ -1187,7 +1189,8 @@ chk_fail_nr() if [[ $ns_invert = "invert" ]]; then ns_tx=$ns2 ns_rx=$ns1 - extra_msg="invert" + tx="client" + rx="server" fi if [[ "${fail_tx}" = "-"* ]]; then @@ -1199,10 +1202,10 @@ chk_fail_nr() fail_rx=${fail_rx:1} fi - print_check "fail tx" + print_check "fail tx ${tx}" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPFailTx") if [ -n "$count" ] && [ "$count" != "$fail_tx" ]; then - extra_msg+=",tx=$count" + extra_msg+=" tx=$count" fi if [ -z "$count" ]; then print_skip @@ -1213,10 +1216,10 @@ chk_fail_nr() print_ok fi - print_check "fail rx" + print_check "fail rx ${rx}" count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtMPFailRx") if [ -n "$count" ] && [ "$count" != "$fail_rx" ]; then - extra_msg+=",rx=$count" + extra_msg+=" rx=$count" fi if [ -z "$count" ]; then print_skip @@ -1238,37 +1241,35 @@ chk_fclose_nr() local count local ns_tx=$ns2 local ns_rx=$ns1 - local extra_msg="" + local tx="client" + local rx="server" if [[ $ns_invert = "invert" ]]; then ns_tx=$ns1 ns_rx=$ns2 - extra_msg="invert" + tx="server" + rx="client" fi - print_check "fast close tx" + print_check "fast close tx ${tx}" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPFastcloseTx") if [ -z "$count" ]; then print_skip elif [ "$count" != "$fclose_tx" ]; then - extra_msg+=",tx=$count" fail_test "got $count MP_FASTCLOSE[s] TX expected $fclose_tx" else print_ok fi - print_check "fast close rx" + print_check "fast close rx ${rx}" count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtMPFastcloseRx") if [ -z "$count" ]; then print_skip elif [ "$count" != "$fclose_rx" ]; then - extra_msg+=",rx=$count" fail_test "got $count MP_FASTCLOSE[s] RX expected $fclose_rx" else print_ok fi - - print_info "$extra_msg" } chk_rst_nr() @@ -1279,15 +1280,17 @@ chk_rst_nr() local count local ns_tx=$ns1 local ns_rx=$ns2 - local extra_msg="" + local tx="server" + local rx="client" if [[ $ns_invert = "invert" ]]; then ns_tx=$ns2 ns_rx=$ns1 - extra_msg="invert" + tx="client" + rx="server" fi - print_check "reset tx" + print_check "reset tx ${tx}" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPRstTx") if [ -z "$count" ]; then print_skip @@ -1299,7 +1302,7 @@ chk_rst_nr() print_ok fi - print_check "reset rx" + print_check "reset rx ${rx}" count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtMPRstRx") if [ -z "$count" ]; then print_skip @@ -1310,8 +1313,6 @@ chk_rst_nr() else print_ok fi - - print_info "$extra_msg" } chk_infi_nr() @@ -1320,7 +1321,7 @@ chk_infi_nr() local infi_rx=$2 local count - print_check "infi tx" + print_check "infi tx client" count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtInfiniteMapTx") if [ -z "$count" ]; then print_skip @@ -1330,7 +1331,7 @@ chk_infi_nr() print_ok fi - print_check "infi rx" + print_check "infi rx server" count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtInfiniteMapRx") if [ -z "$count" ]; then print_skip @@ -1506,19 +1507,21 @@ chk_add_nr() local mis_ack_nr=0 local ns_tx=$ns1 local ns_rx=$ns2 - local extra_msg="" + local tx="" + local rx="" local count local timeout if [[ $ns_invert = "invert" ]]; then ns_tx=$ns2 ns_rx=$ns1 - extra_msg="invert" + tx=" client" + rx=" server" fi timeout=$(ip netns exec ${ns_tx} sysctl -n net.mptcp.add_addr_timeout) - print_check "add addr rx" + print_check "add addr rx${rx}" count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtAddAddr") if [ -z "$count" ]; then print_skip @@ -1530,7 +1533,7 @@ chk_add_nr() print_ok fi - print_check "add addr echo rx" + print_check "add addr echo rx${tx}" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtEchoAdd") if [ -z "$count" ]; then print_skip @@ -1541,7 +1544,7 @@ chk_add_nr() fi if [ $port_nr -gt 0 ]; then - print_check "add addr rx with port" + print_check "add addr rx with port${rx}" count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtPortAdd") if [ -z "$count" ]; then print_skip @@ -1551,7 +1554,7 @@ chk_add_nr() print_ok fi - print_check "syn rx port" + print_check "syn rx port${tx}" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPJoinPortSynRx") if [ -z "$count" ]; then print_skip @@ -1562,7 +1565,7 @@ chk_add_nr() print_ok fi - print_check "synack rx port" + print_check "synack rx port${rx}" count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtMPJoinPortSynAckRx") if [ -z "$count" ]; then print_skip @@ -1573,7 +1576,7 @@ chk_add_nr() print_ok fi - print_check "ack rx port" + print_check "ack rx port${tx}" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPJoinPortAckRx") if [ -z "$count" ]; then print_skip @@ -1584,7 +1587,7 @@ chk_add_nr() print_ok fi - print_check "syn rx port mismatch" + print_check "syn rx port mismatch${tx}" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMismatchPortSynRx") if [ -z "$count" ]; then print_skip @@ -1595,7 +1598,7 @@ chk_add_nr() print_ok fi - print_check "ack rx port mismatch" + print_check "ack rx port mismatch${tx}" count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMismatchPortAckRx") if [ -z "$count" ]; then print_skip @@ -1606,8 +1609,6 @@ chk_add_nr() print_ok fi fi - - print_info "$extra_msg" } chk_add_tx_nr() @@ -1651,6 +1652,8 @@ chk_rm_nr() local count local addr_ns=$ns1 local subflow_ns=$ns2 + local addr="server" + local subflow="client" local extra_msg="" shift 2 @@ -1660,16 +1663,14 @@ chk_rm_nr() shift done - if [ -z $invert ]; then - addr_ns=$ns1 - subflow_ns=$ns2 - elif [ $invert = "true" ]; then + if [ "$invert" = "true" ]; then addr_ns=$ns2 subflow_ns=$ns1 - extra_msg="invert" + addr="client" + subflow="server" fi - print_check "rm addr rx" + print_check "rm addr rx ${addr}" count=$(mptcp_lib_get_counter ${addr_ns} "MPTcpExtRmAddr") if [ -z "$count" ]; then print_skip @@ -1679,7 +1680,7 @@ chk_rm_nr() print_ok fi - print_check "rm subflow" + print_check "rm subflow ${subflow}" count=$(mptcp_lib_get_counter ${subflow_ns} "MPTcpExtRmSubflow") if [ -z "$count" ]; then print_skip @@ -1693,7 +1694,7 @@ chk_rm_nr() count=$((count + cnt)) if [ "$count" != "$rm_subflow_nr" ]; then suffix="$count in [$rm_subflow_nr:$((rm_subflow_nr*2))]" - extra_msg+=" simult" + extra_msg="simult" fi if [ $count -ge "$rm_subflow_nr" ] && \ [ "$count" -le "$((rm_subflow_nr *2 ))" ]; then @@ -1714,7 +1715,7 @@ chk_rm_tx_nr() { local rm_addr_tx_nr=$1 - print_check "rm addr tx" + print_check "rm addr tx client" count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtRmAddrTx") if [ -z "$count" ]; then print_skip @@ -1733,7 +1734,7 @@ chk_prio_nr() local mpj_syn_ack=$4 local count - print_check "mp_prio tx" + print_check "mp_prio tx server" count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPPrioTx") if [ -z "$count" ]; then print_skip @@ -1743,7 +1744,7 @@ chk_prio_nr() print_ok fi - print_check "mp_prio rx" + print_check "mp_prio rx client" count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPPrioRx") if [ -z "$count" ]; then print_skip From patchwork Mon Sep 2 10:46:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787035 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 597E31D619D; Mon, 2 Sep 2024 10:46:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273997; cv=none; b=saZ6ix2mTDouZOZMX8oVMdrvZliEFYoWhkhxBwItSlTDv4+wNiWGstgdWIQgaiW+48NKXQ+Oke7QrXgAdTSlxVBjMbKP+RMow/TwbSktunGy575E8pBMithnFPP7fS7uu6a+4ZwYQqE6p3CtiEO4PZL2nyM6Lt0l1/rIewvDA8s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725273997; c=relaxed/simple; bh=1M/d580d6jhPLMlOZ9LU8u4cShDLWvFtCfSzu3UhKfk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GptF/3pjT+uclxpJPg3gL/6k+eSj1iSUwfSkRMePQNK36+yP+s2oheVqKiNA2rk3wBFD9Zq8dJIUGGqwUNNhVWWZ9JrwzuLLkhnhIuetYOi0eWe96CdyxQ95t6sBVlURf3gpIBILE7nNMYQYwhrr6fy0E4dgpNXfRzZM3RqVprU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=i/zYvoTF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="i/zYvoTF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4795EC4CECC; Mon, 2 Sep 2024 10:46:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725273996; bh=1M/d580d6jhPLMlOZ9LU8u4cShDLWvFtCfSzu3UhKfk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=i/zYvoTFLRkuAgunli5MGRzUpXqZfKktdee7tsjY09hg71vAggaDnZ6lZi4kmfhlr RmaheqqDjRpAi9Mu9BKpWrfXIpPwu7U4bYrTknSLzm8SMnOWAmXGfiiyLPjQQ/oKtu mzt+G231N+FCtwAdf2m6eddAbKJEg8341Wv27GwxMwtE1dl21924k19NwSVOsHGRr3 Z8oCi8Q9x1zvMCkLL45JvBv5IwTPx8kPdm3vBAxQfaWxxir9dhNHt0uQfdJ3HqTzRl UtkfuKH3w2Y+Fd6U65XkVAMVjzFVnjB3onpbJYDsHdc4XJj7ygJRaRZrhcLPmbvVgX i5H4zXIWdbirw== From: "Matthieu Baerts (NGI0)" Date: Mon, 02 Sep 2024 12:46:00 +0200 Subject: [PATCH net-next 09/11] selftests: mptcp: join: mute errors when ran in the background Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-9-d3e0f3773b90@kernel.org> References: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> In-Reply-To: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=4205; i=matttbe@kernel.org; h=from:subject:message-id; bh=1M/d580d6jhPLMlOZ9LU8u4cShDLWvFtCfSzu3UhKfk=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1ZdtAnV9XjRCligORVcWsIdvxPleRbAqSkNod KyqPxbzh6CJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtWXbQAKCRD2t4JPQmmg cwBxEACIt5XoczhoFYKaN/ldAB+9QjhtXK2ilnjN/CytcxbfferzL+KQiL7eFb8J1FNUYV0EYTG LOtwd+uZQu3OCVarBHa3cfZkniEn/boY8iw5O7QW5P7B4SbkHDLpTJf8htlW8oLxNJl3d/8JxIE ev99Eukn2VdDERRDHiZlkszl0S0zlS/GjfFf5zBDQYe/WKsIyx4DbZMK5KgAqbr7+gPA/hB5qgg pMIgKiX4S8DXZ+r21aM3ONKU/WqV+YYmXBKEVTBZ/ccR2xzRB2iaphw6wK9YtjPcDLoPcPcuvZI BqlnnviraXFwJu2JdnQrCPKbTPHhPBFxNZmFjvkAj70WG6Y8H8yrK5iI+qwRhVXZdtyTQzAapGe mqGuVgoDhKqLIXZLFA0vAjUrDyfZqagqXOc2pprRoPJNgFs5uo+diMBoJn3apv76hFkGqwAes45 mkIMw3bIejPzsBoFwjYSq+fZL1cQhbNk7TBHl1J02b9y8m29bgoK/g3ka5P1HI1tBa6y9E+fs+c jyCeqHc+4llKtEUiVgw/PZPwAAOU5ogTm4ao3l6idMjAm1JKt2U8gIQH/uB3dU4fKIyTpcKgifI Tm9tWs5eDr/VrnT3sPAS88OJC77KFhIQaFGVZwpI7FdAVLUXBNpDF4CfS+KF7B17FZY4liQXtFZ wcZrKGbuo5gtrXQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 The test is supposed to be killed before the end, which will likely cause "Connection reset by peer" errors. It is confusing, especially because in case of real transfer errors, the test will not be marked as failed. But that's OK, there are many other tests checking that. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 36 ++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 321197d8977e..5d164abc18e5 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3542,8 +3542,8 @@ userspace_tests() continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then set_userspace_pm $ns1 pm_nl_set_limits $ns2 2 2 - speed=5 \ - run_tests $ns1 $ns2 10.0.1.1 & + { speed=5 \ + run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=$! wait_mpj $ns1 userspace_pm_add_addr $ns1 10.0.2.1 10 @@ -3575,8 +3575,8 @@ userspace_tests() continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then set_userspace_pm $ns2 pm_nl_set_limits $ns1 0 1 - speed=5 \ - run_tests $ns1 $ns2 10.0.1.1 & + { speed=5 \ + run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=$! wait_mpj $ns2 userspace_pm_add_sf $ns2 10.0.3.2 20 @@ -3603,8 +3603,8 @@ userspace_tests() continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then set_userspace_pm $ns2 pm_nl_set_limits $ns1 0 1 - speed=5 \ - run_tests $ns1 $ns2 10.0.1.1 & + { speed=5 \ + run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=$! wait_mpj $ns2 chk_mptcp_info subflows 0 subflows 0 @@ -3624,8 +3624,8 @@ userspace_tests() continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then set_userspace_pm $ns2 pm_nl_set_limits $ns1 0 1 - speed=5 \ - run_tests $ns1 $ns2 10.0.1.1 & + { speed=5 \ + run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=$! wait_mpj $ns2 userspace_pm_add_sf $ns2 10.0.3.2 20 @@ -3648,8 +3648,8 @@ userspace_tests() continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then set_userspace_pm $ns1 pm_nl_set_limits $ns2 1 1 - speed=5 \ - run_tests $ns1 $ns2 10.0.1.1 & + { speed=5 \ + run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=$! wait_mpj $ns1 userspace_pm_add_addr $ns1 10.0.2.1 10 @@ -3679,8 +3679,8 @@ endpoint_tests() pm_nl_set_limits $ns1 2 2 pm_nl_set_limits $ns2 2 2 pm_nl_add_endpoint $ns1 10.0.2.1 flags signal - speed=slow \ - run_tests $ns1 $ns2 10.0.1.1 & + { speed=slow \ + run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=$! wait_mpj $ns1 @@ -3706,8 +3706,8 @@ endpoint_tests() pm_nl_set_limits $ns2 0 3 pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow - test_linkfail=4 speed=5 \ - run_tests $ns1 $ns2 10.0.1.1 & + { test_linkfail=4 speed=5 \ + run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=$! wait_mpj $ns2 @@ -3783,8 +3783,8 @@ endpoint_tests() # broadcast IP: no packet for this address will be received on ns1 pm_nl_add_endpoint $ns1 224.0.0.1 id 2 flags signal pm_nl_add_endpoint $ns1 10.0.1.1 id 42 flags signal - test_linkfail=4 speed=5 \ - run_tests $ns1 $ns2 10.0.1.1 & + { test_linkfail=4 speed=5 \ + run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=$! wait_mpj $ns2 @@ -3856,8 +3856,8 @@ endpoint_tests() # broadcast IP: no packet for this address will be received on ns1 pm_nl_add_endpoint $ns1 224.0.0.1 id 2 flags signal pm_nl_add_endpoint $ns2 10.0.3.2 id 3 flags subflow - test_linkfail=4 speed=20 \ - run_tests $ns1 $ns2 10.0.1.1 & + { test_linkfail=4 speed=20 \ + run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=$! wait_attempt_fail $ns2 From patchwork Mon Sep 2 10:46:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787036 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49D071D414F; Mon, 2 Sep 2024 10:46:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725274000; cv=none; b=cJpPldeAHbyQaEguQo2yO2wXrrxqpBoStzimvcQ1UK7/6yISOy7xtakRdp5gV+vNIIE5UDjR0e/lbfgT8mz0L/5mG93Azq4bSZMEEe99swt8pxT1OYg4Xxgz634Hy/ZWPY5tA8VuSqWrSRFHK6zu0JRWaUVjfbyu2kFFL/2zwzs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725274000; c=relaxed/simple; bh=6xnI2w/INMp2IQXw7wQ09BWYHS+4tqpRw4tfBXZ2UNk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kzjd3ByWc85P2c336PCljqMLmce/REIOOH8/8N4maGav7qWmq3z8P9w2tvZUViubBGid+9mvdClKthSduXVD5IX9Dnc4usgn+40GjR2f+9Umy/dGK3jxj4ddVxR4lAc+C+mVObou5iKmkFqsJG8ejcYFk8b5gXmTyYxUAIGbSBE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gaoacvPx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gaoacvPx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58FD4C4CEC6; Mon, 2 Sep 2024 10:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725273999; bh=6xnI2w/INMp2IQXw7wQ09BWYHS+4tqpRw4tfBXZ2UNk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gaoacvPxlYeXWDaXOElLcBwBdoX3dFBE39TyEUtZ+IRox8obB5wlrIZP+YAz6FVh1 A3B/CYE60XAlQ5j3A6yHFGBc2t8PomI/FudnfC4UwXx9p0PYmCpQVDPWiM2eG3janX xTI0YPTzWBhopBtNmHOaO/R/1TqkTv2yu/2NplmTFMWil/VQDWx2vqaQt7zQYbMHxL hqY61je/c63GS1v9xdUUtww4K97BVxWCvySSGFulxC7g3mZlvkOzYOodgXQYXHu7Jh WatJ9TCX2nRri7S/koWyL1fPzz7NNQQDfc32JAbwWVSUv7mU3fX7Lda7X6fjJtdQ7J rtcQOl/EWn04g== From: "Matthieu Baerts (NGI0)" Date: Mon, 02 Sep 2024 12:46:01 +0200 Subject: [PATCH net-next 10/11] selftests: mptcp: join: simplify checksum_tests Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-10-d3e0f3773b90@kernel.org> References: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> In-Reply-To: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" , Geliang Tang X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2193; i=matttbe@kernel.org; h=from:subject:message-id; bh=pLzsh5bACyzEg5mqd2S+G2QDX6il3VLPJs5I9rwx6m8=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1Zdu9aV/2VffKBClfleScV83CjA5zazB4MAhd YcEkgWrWzyJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtWXbgAKCRD2t4JPQmmg cwd3D/9ZBDfjhANlpRbqoWHyZqpnnyCnZZuAVqzXJOCCpavJrjecTL0VqhqJL6SvIGq7ZAhdhVk LAthvqVEc/BTrHkTXet2y0OBViiYj0LIrwCC/C/iN6okOWop/ReJvcLxSEUG/UGzYE60SU2Hr2m LYZ2xANB7DGjba9dsk/HDa1dfCZj0tkLeRUvS3OA3WLgYhYUR3ECrbDBtP2ROPAHvpZWIQ8ksXO 5nC327X0kobewtAn88qFqJo8eLLav++u+YKm4Lux3qyU7tJ/AJp8Ow4DMmGNKNfAjB8TgQW8SnL 8Rsg32BATQyoOfdtV/c/PyZyr9j9u2M+oncjD53Ich7ueYktytz7X/VERIucg0dZFJePcnoFoid tlzMv9KMdIZAFSFNW/i7oem9vZA0auSbuQlcIhwr0oc8WkrKJtqkAoc1APlnwpHNZn2Lr1W4WbK kHPDRBr6zelQ08l9CoLrdeBuuvjPmlmVvS2oiNHvOyjDJZOxLNtngRAQeRf/V1A3v9ApMY/Bila A3gXxXTlQoGIPiSzY32sH2NXjqd3pE+xYgm36J8kBUxYFS9u6Lw0xlGROkA2N4bQgsOfCsvblVA uwNpJz14vLL/28FXN3vMW5Y3Y84R93vUK8n+hs6QLaGf1aF+jjn8ZTGwNDbywAvJw//ACDmq9/P 0Q9z/IpleNoGmIQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 From: Geliang Tang The four checksum tests are similar, only one line is different. So a for-loop can be used to simplify these tests. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 43 +++++++------------------ 1 file changed, 11 insertions(+), 32 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 5d164abc18e5..43f8a9bd84c4 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -363,7 +363,7 @@ reset_with_checksum() local ns1_enable=$1 local ns2_enable=$2 - reset "checksum test ${1} ${2}" || return 1 + reset "checksum test ${ns1_enable} ${ns2_enable}" || return 1 ip netns exec $ns1 sysctl -q net.mptcp.checksum_enabled=$ns1_enable ip netns exec $ns2 sysctl -q net.mptcp.checksum_enabled=$ns2_enable @@ -3032,37 +3032,16 @@ syncookies_tests() checksum_tests() { - # checksum test 0 0 - if reset_with_checksum 0 0; then - pm_nl_set_limits $ns1 0 1 - pm_nl_set_limits $ns2 0 1 - run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 0 0 0 - fi - - # checksum test 1 1 - if reset_with_checksum 1 1; then - pm_nl_set_limits $ns1 0 1 - pm_nl_set_limits $ns2 0 1 - run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 0 0 0 - fi - - # checksum test 0 1 - if reset_with_checksum 0 1; then - pm_nl_set_limits $ns1 0 1 - pm_nl_set_limits $ns2 0 1 - run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 0 0 0 - fi - - # checksum test 1 0 - if reset_with_checksum 1 0; then - pm_nl_set_limits $ns1 0 1 - pm_nl_set_limits $ns2 0 1 - run_tests $ns1 $ns2 10.0.1.1 - chk_join_nr 0 0 0 - fi + local checksum_enable + for checksum_enable in "0 0" "1 1" "0 1" "1 0"; do + # checksum test 0 0, 1 1, 0 1, 1 0 + if reset_with_checksum ${checksum_enable}; then + pm_nl_set_limits $ns1 0 1 + pm_nl_set_limits $ns2 0 1 + run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr 0 0 0 + fi + done } deny_join_id0_tests() From patchwork Mon Sep 2 10:46:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787037 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 258EC185924; Mon, 2 Sep 2024 10:46:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725274003; cv=none; b=bCC7AT9Ya76nSFkTUn41duhq7zo/tw1mHjQ44voxcUgP0vdVACDqmf1g6JjZaZxi79B0LGkvKvdHYBc3gKxsYoPh17cDkFcEwAiVpnz3WFWArG244LYyMrB52b2rehPMK3f1JvcGgWp9N4+pSf0woOVJ0PjAXGT4sGmz/I57j/g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725274003; c=relaxed/simple; bh=FPZ//+LmYrdLiAR8TkZb9j4Bb/TNL62ML2xUN9hVcrg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jfB+El3xfrNyQnqUrDA7c7o+YklCf0v5YkRVCum62o+VBhd/hbQd0dhpFxYDgS076vfMM696XvT+JuBgwaD0+CxLVfwx4GO0DWOKe8Kf/fPz2MYIQo5f7j1CEMVI9MCsTkhx0kDc1P1mYSqvdWH9C8Iioj4vScq66n0ShnyGSNk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E90Fy07o; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="E90Fy07o" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68CADC4CEC8; Mon, 2 Sep 2024 10:46:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725274003; bh=FPZ//+LmYrdLiAR8TkZb9j4Bb/TNL62ML2xUN9hVcrg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=E90Fy07oI3giZ6itsts+X/Lg4jy+r/Csnn4eyeHIYYbtupxIEfFOwVJZrjF1kltIA Pm672wG5ZQDyyZyL/dOYOu2CP0HvceCwutQ1hZuxuFdMOgqLdXltNHbYtAfAP72Df/ yGZY2I3NrGRdUCzQQRmwFrKuNsHbzBfmPZY/rwLgAINJOttJX4LVbf3es9ryrfFxEr p/FQk3caXnJmWuCJaEC/Imos4zROBYD83HsBdN1jE/cZHOkl7AWlNKXviHwXMhpZOZ D5ZpV1jp+ym4t5582o1zzhadtut55ytCZ+DvWVeiRJyfxiiw7YyjhW3DNHnh9n9N7p dEGSONKyR9hLw== From: "Matthieu Baerts (NGI0)" Date: Mon, 02 Sep 2024 12:46:02 +0200 Subject: [PATCH net-next 11/11] selftests: mptcp: pm_nl_ctl: remove re-definition Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-11-d3e0f3773b90@kernel.org> References: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> In-Reply-To: <20240902-net-next-mptcp-mib-mpjtx-misc-v1-0-d3e0f3773b90@kernel.org> To: mptcp@lists.linux.dev, Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1833; i=matttbe@kernel.org; h=from:subject:message-id; bh=FPZ//+LmYrdLiAR8TkZb9j4Bb/TNL62ML2xUN9hVcrg=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1ZdudT4wm2R9q0KqWJKArlK5UY9sSC5X+xDmY syBGXbNPY6JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtWXbgAKCRD2t4JPQmmg c0LjD/4p+CcrXWfxEhzJvn1wHTDln+iIlIcL79pFk/T/NPjL8yenuIHRReKA6Vh4xYXNebYntGC qM4y9GGTpwIqutQ66M1fO6JuBjMIZuVesguSRhYJlJBfjIu6NsFxbLZncsf6yRcCe5nTNGeE8Tr 8hNw0X8XXihLSU7EOMck9G7W98zw4UFvgb4xoti8TDGY3r6wjIgHLVH60Pph0PuZODaPlLEj9lB /woEJAqf30wCTbcVmXIjg5suVRXlIA2U5yDdGzD/JuhVrIQCV3DQ3ZcTe5VCkH4deyWUt9k5Af4 V2ZJWtKILHnU6sDMA8bIqLPTySmbqaY6UK9tsJPZhJn6g3H99QlKS0QS0A3y13gJcqcYj2uEjU/ QXQgEplYa1XSm4z7U7N4oPITm2dUI3PC0lOtAmiS9PRclsiGM5Yie8MSijq8Wpx5UKF+tC8rR0s nq6hIimi9cjgCvsnJ5ahbdi6xLr7bFn8Ub0tSidFy9doFuI2eXA0FeDU7j/K3HjYRMohSa/HPDL yW2XOEAbIBOARTYDSM0SYHZVcmarDs7qrhJK47xlVP1YgwMX+I6PsTEURysNlFi+GUw5aWr8MiC VJsSevC1XKA2DfinfjRzSk/0osmqlaiDzXNM9RiPBnlzwxM4Pm95NG2M/P4oFBtLghOF/PiWGyG IIorfhmtkJBdAvQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 'MPTCP_PM_NAME' is defined in 'linux/mptcp_pm.h', included in 'linux/mptcp.h', no need to re-define it. 'MPTCP_PM_EVENTS' is not defined in 'linux/mptcp.h', but 'MPTCP_PM_EV_GRP_NAME' is, with the same value. We can then use the latter, and drop the other one. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c index 7ad5a59adff2..994a556f46c1 100644 --- a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c +++ b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c @@ -19,12 +19,6 @@ #include "linux/mptcp.h" -#ifndef MPTCP_PM_NAME -#define MPTCP_PM_NAME "mptcp_pm" -#endif -#ifndef MPTCP_PM_EVENTS -#define MPTCP_PM_EVENTS "mptcp_pm_events" -#endif #ifndef IPPROTO_MPTCP #define IPPROTO_MPTCP 262 #endif @@ -116,7 +110,7 @@ static int capture_events(int fd, int event_group) if (setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &event_group, sizeof(event_group)) < 0) - error(1, errno, "could not join the " MPTCP_PM_EVENTS " mcast group"); + error(1, errno, "could not join the " MPTCP_PM_EV_GRP_NAME " mcast group"); do { FD_ZERO(&rfds); @@ -288,7 +282,7 @@ static int genl_parse_getfamily(struct nlmsghdr *nlh, int *pm_family, if (grp->rta_type == CTRL_ATTR_MCAST_GRP_ID) *events_mcast_grp = *(__u32 *)RTA_DATA(grp); else if (grp->rta_type == CTRL_ATTR_MCAST_GRP_NAME && - !strcmp(RTA_DATA(grp), MPTCP_PM_EVENTS)) + !strcmp(RTA_DATA(grp), MPTCP_PM_EV_GRP_NAME)) got_events_grp = 1; grp = RTA_NEXT(grp, grp_len);