From patchwork Sat Jul 27 09:03:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts \(NGI0\)" X-Patchwork-Id: 815530 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 912B64D8BA; Sat, 27 Jul 2024 09:04: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=1722071073; cv=none; b=dx6az8wy79+S8K08KPbYHAQ5OJ5T5kVAR1RJYSD6isidcGADJftNrtv4QxqjHUysZ17FqoM3JUGcXi+fwtBwrrrPCVsONTP0pl0xLWnWUED5r64gxKc9e6pJQs8hNZpcDrjlejF91bziKiThegm2LQ9gHKP+rKtD4u9wHWEjYCw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722071073; c=relaxed/simple; bh=pn2hIRT1RrJODV0kTBUrju3+oLj48rM81icGCX71GDQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PSxbC3LShWcdoRQvOPgCjRgMSp/Y05Du5pSN64pKPVkV3KFuR8rr9gbnAOcRWbYaoPGfim9B+Gg40ErOfSlLkKui4GxGqqFp2riaE/N44rHziPKfAJdnbxb4OVJLAtYz7h4/AtfoSM00vL4sJ+FuQg3w9z8J6oUad9SZ/KRjSK8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lLR4M/jJ; 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="lLR4M/jJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F04DC4AF0A; Sat, 27 Jul 2024 09:04:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722071073; bh=pn2hIRT1RrJODV0kTBUrju3+oLj48rM81icGCX71GDQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lLR4M/jJ6yAbkeJgXWnxbpA0FgaAdRFoO3Toy+rK2X4KqrwrO5YKpxJPuQiEbMdit Mn1ET40t9uNYfsd3U9Gm/sAiXNEjQtmTe1yH5dr3qsCQ1j9GkNFbVr35J7OSAk50Sb gbHuLnXnnxuGNGM6jn2jk/rXBqklTg7mu0mzOPPE5y64cEzQ9MlLDo8uuUXFu97ZMw tjCeEKLnReAMtR5EtlmAHMvEzTu4reLeGR2IDF17iyHuAtf9aEDFwcHKkbbqb4jsgR 3XEDNVE76TiuapvwEUnoD2/IzZ5JPqNvVNJoibOxO0z9+o07lkI5wNxLFP8XToTHnf s/ocQ96n1DbuA== From: "Matthieu Baerts (NGI0)" Date: Sat, 27 Jul 2024 11:03:59 +0200 Subject: [PATCH net 1/5] mptcp: fix user-space PM announced address accounting Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240727-upstream-net-20240726-mptcp-fix-signal-readd-v1-1-1e7d25a23362@kernel.org> References: <20240727-upstream-net-20240726-mptcp-fix-signal-readd-v1-0-1e7d25a23362@kernel.org> In-Reply-To: <20240727-upstream-net-20240726-mptcp-fix-signal-readd-v1-0-1e7d25a23362@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-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1806; i=matttbe@kernel.org; h=from:subject:message-id; bh=8ys1pb4FgWbv1b46VcKxx8z0yyqmgTUcPtfWhv86Vzo=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmpLga2oUq3nKrg/FJmKzGXRw7EdI82AgtBcfRP ETPr4CbAsaJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZqS4GgAKCRD2t4JPQmmg c8ZnD/98RkZpHp7pRIkZ9gIZim2P3bjZqRv20l9YfIJ4lOa7YDJxV5VNnUIfOmsY7HtksbWb6ey sdmP3kuyVnIK84at4OiqAeEdpCIHFaZott2HlREGQT/rMcB3EvWL91jo8F6efTKpaNFjWDZc7CB e3TK/U4KOVbavmOPVRnqnJPdnYLR1KCX5VgNyiZYP8n7Sp7BoYspcZpvhXgMRi5b2Kku7H5ZRH0 RiI3/F23WehhUSiz7j6/HDnenp7nK7656pFGB0lR39TMSEddYOrzy0DAJSrrjvCuLWPJBhpOjMP ZXKS+bLgHskSgKGT1Ofo5kpZTMOoFKJ4vAftgMtp5dRAWg93q1O7s72qaK2sK0KPngOcb09u1Aj Utf+nUfBKMNcfoK+l6bNmX2U7x6ueIvgHpikhrdPmloeGrEB05NWEM/FNFB4qOdt7KsRqk5Iex7 rCMwifFfrhW6MhWFy9oXQZYtZAG7vALt72yS2FCStZFgZ4vzANldtFBSZmi9IJMD963gmrcxzIf e5a8GNGllxQ6a/z8GHaZKe90YZx6BWp+Q9CJCcuyEY4FCWYDU2/DN+qfIBcrXpFeuYVASstDXby OeckESXWyt3jmZvzpN5C/+eNmW6sAUUmE7ImFoj4tj1atHH8OqHje0CCCPJJGx+zMQi6n1C3sIE Eo9iPUiCUFVeAlw== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 From: Paolo Abeni Currently the per-connection announced address counter is never decreased. When the user-space PM is in use, this just affect the information exposed via diag/sockopt, but it could still foul the PM to wrong decision. Add the missing accounting for the user-space PM's sake. Fixes: 8b1c94da1e48 ("mptcp: only send RM_ADDR in nl_cmd_remove") Cc: stable@vger.kernel.org Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_netlink.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index ea9e5817b9e9..b399f2b7a369 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1534,16 +1534,25 @@ void mptcp_pm_remove_addrs(struct mptcp_sock *msk, struct list_head *rm_list) { struct mptcp_rm_list alist = { .nr = 0 }; struct mptcp_pm_addr_entry *entry; + int anno_nr = 0; list_for_each_entry(entry, rm_list, list) { - if ((remove_anno_list_by_saddr(msk, &entry->addr) || - lookup_subflow_by_saddr(&msk->conn_list, &entry->addr)) && - alist.nr < MPTCP_RM_IDS_MAX) - alist.ids[alist.nr++] = entry->addr.id; + if (alist.nr >= MPTCP_RM_IDS_MAX) + break; + + /* only delete if either announced or matching a subflow */ + if (remove_anno_list_by_saddr(msk, &entry->addr)) + anno_nr++; + else if (!lookup_subflow_by_saddr(&msk->conn_list, + &entry->addr)) + continue; + + alist.ids[alist.nr++] = entry->addr.id; } if (alist.nr) { spin_lock_bh(&msk->pm.lock); + msk->pm.add_addr_signaled -= anno_nr; mptcp_pm_remove_addr(msk, &alist); spin_unlock_bh(&msk->pm.lock); } From patchwork Sat Jul 27 09:04:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts \(NGI0\)" X-Patchwork-Id: 814804 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 8E1675644E; Sat, 27 Jul 2024 09:04: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=1722071076; cv=none; b=eCLqHe1yIZNLRmeiQkM9oIxCGShzKPQ/hDjZXWLlUoUTbk4/rFaPcGtHeh7D+ovc4W/HNtHf0a6VR3COkbx58toRnw3V8B8mYx8JJlM/yiT9cOgLmcx8BLH/1XR/hjwWQmySq2yclHDlCskxSZLunFKYcn2cEszIopLTxcM9qhY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722071076; c=relaxed/simple; bh=SpiGDFVVItBkk2hUaR++T+dqgnkf1BKqsH2W3d4BbxA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=p8qxBEm4knx2wXhZbUQ7gZJxY1N0yf2EjJuLxBmpyAIxlfvygUd/riCXgMhfK3Z1womMRYAphAB9x14IAoqWcmJVQcHJO3csP6GOa0ji6iVtzKIhNKkq7GAkmdLYxJy7JmZ/Vz3hIT2OKHcDA16IcafWKroGxa7RzewFBiueORg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=smG1ejq7; 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="smG1ejq7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DBBCC4AF09; Sat, 27 Jul 2024 09:04:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722071076; bh=SpiGDFVVItBkk2hUaR++T+dqgnkf1BKqsH2W3d4BbxA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=smG1ejq74bTlNov3jNKz5q7iTIVDu5KwMGgseSluI7fkXkspa6ZMzErxqnzPbFsLp WZaSlIz+2sT6F3UjMB3yA+kGaLEr6lImBRkAj2nTcsGvX/wzeZ4jsn9uCuwUm4/VvU PrOFiq2qXfaux/SoNS5wnU96Os/3dARRdjAQxRnmpPOwZLyl+UJagmnXXDRhLD/br+ SPPWx/np/1tF0kzlzCCN6tqUieb8hdPBhnWGUrUFyC0b8qZSwBwcD9vHRDTY6FIJy9 Q4ckPedWIMFEDfr16HcTwdRX+uu3jAsfx/x6g2MAxJe2VB2aAL34aEKTi8hJ3+a8A9 MooDG50Q8fz5A== From: "Matthieu Baerts (NGI0)" Date: Sat, 27 Jul 2024 11:04:00 +0200 Subject: [PATCH net 2/5] mptcp: fix NL PM announced address accounting Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240727-upstream-net-20240726-mptcp-fix-signal-readd-v1-2-1e7d25a23362@kernel.org> References: <20240727-upstream-net-20240726-mptcp-fix-signal-readd-v1-0-1e7d25a23362@kernel.org> In-Reply-To: <20240727-upstream-net-20240726-mptcp-fix-signal-readd-v1-0-1e7d25a23362@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-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2080; i=matttbe@kernel.org; h=from:subject:message-id; bh=T66oV6CP4f0kaix+xkHtdBR+09B9n+xPUh6tQPDiSEk=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmpLga8+q3SbPbXlwi0Bl7uRvL8dbXdv4jDKYZS BOx3GEbKL6JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZqS4GgAKCRD2t4JPQmmg c8SxD/95W4XuNVPXDAq6pIt5eCIYrBUbMHELrjygkm25so6nWCZZuwd+QEjEmVQTBQCrVEJqhOI 8tC0HNeMZ3Zc/zCRrT10mcYvksr1ZOPpeKOaM/mkrkQGp4yql9fXBLVOBbLAgxHTesc3ych1Z1M H8HG/WELaYTXFaX5PiU7Ah06b4sOS7AOSNfVUhZvwZjfZa0XYGx+IincULP+PwFRTYFeVXLsD3e FKaxaXzVwexRlxd22kp0iOfkf8j/zKmVDknH9Koer/H0pwQ2TaZgbwBtHa6GoSXqtfXfK+znuVY Wxe5ENkZcMoAVB3gKy3BKS134kUxg9iS5H7IrbOmIxB8kizdwAgH1mxND9lXCjXhlPKpm2bSHMj V+mETzJwLShS4LwW6Z2Hk8Xr8kvQ3pnAStv1JJsz+DdN5p/Y+YvSlFigk1QdzCgLEznSDZlodQ9 1TpZxMVg5oie+Co+Uy6Mcu6eSQ4gFQmTHXfUxNlSjH8i5O/y7XhN8ogbMbXcZbbGqMDmvnIoBwo NEkSfte6sULvI/eJyDqwauGzJ3mmIShYinlrrTo0BmPY2mvLVMXwLRe3s3gP9gKBERRPiF6hTFI Bxx86HwLcNxdwpjnXSZbDFLtV1IfJnSHvSLqVw5wUF8VEtbZFR4mKxK7s/Qz7w8qxIqSEaXavZQ /7shxohN6IBfaoA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 From: Paolo Abeni Currently the per connection announced address counter is never decreased. As a consequence, after connection establishment, if the NL PM deletes an endpoint and adds a new/different one, no additional subflow is created for the new endpoint even if the current limits allow that. Address the issue properly updating the signaled address counter every time the NL PM removes such addresses. Fixes: 01cacb00b35c ("mptcp: add netlink-based PM") Cc: stable@vger.kernel.org Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/pm_netlink.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index b399f2b7a369..f65831de5c1a 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1401,6 +1401,7 @@ static bool mptcp_pm_remove_anno_addr(struct mptcp_sock *msk, ret = remove_anno_list_by_saddr(msk, addr); if (ret || force) { spin_lock_bh(&msk->pm.lock); + msk->pm.add_addr_signaled -= ret; mptcp_pm_remove_addr(msk, &list); spin_unlock_bh(&msk->pm.lock); } @@ -1565,17 +1566,18 @@ static void mptcp_pm_remove_addrs_and_subflows(struct mptcp_sock *msk, struct mptcp_pm_addr_entry *entry; list_for_each_entry(entry, rm_list, list) { - if (lookup_subflow_by_saddr(&msk->conn_list, &entry->addr) && - slist.nr < MPTCP_RM_IDS_MAX) + if (slist.nr < MPTCP_RM_IDS_MAX && + lookup_subflow_by_saddr(&msk->conn_list, &entry->addr)) slist.ids[slist.nr++] = entry->addr.id; - if (remove_anno_list_by_saddr(msk, &entry->addr) && - alist.nr < MPTCP_RM_IDS_MAX) + if (alist.nr < MPTCP_RM_IDS_MAX && + remove_anno_list_by_saddr(msk, &entry->addr)) alist.ids[alist.nr++] = entry->addr.id; } if (alist.nr) { spin_lock_bh(&msk->pm.lock); + msk->pm.add_addr_signaled -= alist.nr; mptcp_pm_remove_addr(msk, &alist); spin_unlock_bh(&msk->pm.lock); } From patchwork Sat Jul 27 09:04:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts \(NGI0\)" X-Patchwork-Id: 815529 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 609DB6CDCC; Sat, 27 Jul 2024 09:04:39 +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=1722071079; cv=none; b=gOfiGWFmGUtTeaCPqZ5t2P2MU64fsVRntCdIEICy5m1qne2ZzdvXwg/rBfgssnFwftSdKE7paCUO15ySYQDIu9Ovg+4073Pu7c1VFzXYFC+lazvjiJkPwmQ2g4B1hHvnBkpytLRQ1yRDE2rF64ydK+4pqENOo4vjljC7UbNDEw4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722071079; c=relaxed/simple; bh=V3zN+OxK0C/dybQY9jqujF+bUKvkdcqvyAUmVdnWlww=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=k6/2/xKPNvGN04MgEGVBoZi65GuSnBePskOo2MPgXsuppAqhBJPm+E0lk82hNC108IK3Q1NoOtrhnEGbMIMbhTYzs1uHkWeFmyCT1qiAV3sv23UGvG0lKq7/CsmYKZbO++hjTGs90rinXPiJKFVctKXfkgZ6eU7EgISmpmwnO8Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pduMOcX8; 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="pduMOcX8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A703C4AF0E; Sat, 27 Jul 2024 09:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722071079; bh=V3zN+OxK0C/dybQY9jqujF+bUKvkdcqvyAUmVdnWlww=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=pduMOcX8mQt60o3+uketKw4yrSScpNlKrEzuStS05LnuA42IEiITrfyNZB5xlo9I1 yHIQl1V7o2I7YqvxSBzxeLSAfCD4qfwDhgIrA+GIaGFa0lkntmS9w4tBJfWcf/Vynl C9C9gYzrLUHdJbIPvrCxKenZ/mAvaGFygSSrjZTB06wfMoclVdDM4O9RHR68dY5RvZ 6jsN5tuH1Ey0YSqDfG9XcFQImAqq5m7+iTWCffACUI+DVJmHYmfByVFPa+vnqxAgEn Zrd5U4U5B3uHHTWFDRBS7qR7vEIzdqmt53NVaWK49SV/wVMJbHodP5uw6yiveF+zvG PpMXNTSUtMvqA== From: "Matthieu Baerts (NGI0)" Date: Sat, 27 Jul 2024 11:04:01 +0200 Subject: [PATCH net 3/5] selftests: mptcp: add explicit test case for remove/readd Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240727-upstream-net-20240726-mptcp-fix-signal-readd-v1-3-1e7d25a23362@kernel.org> References: <20240727-upstream-net-20240726-mptcp-fix-signal-readd-v1-0-1e7d25a23362@kernel.org> In-Reply-To: <20240727-upstream-net-20240726-mptcp-fix-signal-readd-v1-0-1e7d25a23362@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-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1660; i=matttbe@kernel.org; h=from:subject:message-id; bh=jQIxgQ8nPpyNkqG+0+5KEG8+ixuEiDZsNbtus6NCsR0=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmpLga+KUGo6bpQhqq177WYWGobQbcjc5pi2xM8 hudz3Z9HmKJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZqS4GgAKCRD2t4JPQmmg c+jgD/92TC8t1uxryKpSxJv77Z8Y0ug0of9QZHbZfEFKkRRLzknZajSRgvnAOZWi1wCVY7cenQQ 7NufOm9Oa5i6N0fEBPuMPgDuofQMINa6qdzT30Q5nFgRXoSorvdNq5lOOt8yhBDaXWpclYinJSb hq2Wsu/w1EIFEvJLIY9q8thwM0Uyhh67ll+9cQG+lD4yF0vl+r7v0jqsAFdPuR5+Ci4p1GtVMq2 fn+rgW93OOwxzY5XcIsFu5ivFk2M+swszZbZsIxMm9D7HjSCKFPN+YsSE7T96LiRrTp/GSs0uTQ 01hf0jO1LM+q7eb9PbBvRtbu0l8WTTjS7U9XsI/xjUf0RaqTHSpNOAfOc+UiSxy9D4PX50Kpsfg nljlEJszuHnGv0FNtp/UuP2qwOzrucCC7LxAUJ92XNSpBGHHMbw32jRaO1ije5xwCXk3sF94vCY CCuQ/0CnRl89pgylFY7C5UWP9K9bgWF4XcgRpNYLJuzUEWNSrVViC9RJpJMhw1UnYwdnB5t6VPl +iQngthhrEGRBjQEFWhJVCT4CPN7iNxscWLy9C2ku9R7fIfJ7WnmOa4dBVjIiBqdpmn1geCrTn9 U8Hy6Zz9dLOr0eizBqvpSZqqjIHBnmnYQsndiP9P9NcsC+6a21cc12xXuDpRdLKCCbt5NGpeA59 ojLzxIo4+ScrPuw== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 From: Paolo Abeni Delete and re-create a signal endpoint and ensure that the PM actually deletes and re-create the subflow. Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 108aeeb84ef1..9c091fc267c4 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3526,6 +3526,35 @@ endpoint_tests() chk_mptcp_info subflows 1 subflows 1 mptcp_lib_kill_wait $tests_pid fi + + # remove and re-add + if reset "delete re-add signal" && + mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then + pm_nl_set_limits $ns1 1 1 + pm_nl_set_limits $ns2 1 1 + pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal + test_linkfail=4 speed=20 \ + run_tests $ns1 $ns2 10.0.1.1 & + local tests_pid=$! + + wait_mpj $ns2 + pm_nl_check_endpoint "creation" \ + $ns1 10.0.2.1 id 1 flags signal + chk_subflow_nr "before delete" 2 + chk_mptcp_info subflows 1 subflows 1 + + pm_nl_del_endpoint $ns1 1 10.0.2.1 + sleep 0.5 + chk_subflow_nr "after delete" 1 + chk_mptcp_info subflows 0 subflows 0 + + pm_nl_add_endpoint $ns1 10.0.2.1 flags signal + wait_mpj $ns2 + chk_subflow_nr "after re-add" 2 + chk_mptcp_info subflows 1 subflows 1 + mptcp_lib_kill_wait $tests_pid + fi + } # [$1: error message] From patchwork Sat Jul 27 09:04:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts \(NGI0\)" X-Patchwork-Id: 814803 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 6F83C7345B; Sat, 27 Jul 2024 09:04:42 +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=1722071082; cv=none; b=DtYwS61zVxEs/j1g34skcOx7L+Nk7dm1VEAHSwlfMnWdGO6mAZ08gXW7a+SkC1m0834cOIFIY09pLFoGi45gXvr65K5R4s9DrcX7eAj1yakrylruSYVadSc5ycYHdzz8HfrMSmfaGRoBoCEMI2u2j5cqhomSoP0y8MJ/0XEe1kU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722071082; c=relaxed/simple; bh=bSOt8metnNP3/iqWxOWzMI46nYQl9PqNnxav/zmkGn0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fQV0CYeNjpQPsiETQAmDUkhr8zEu0xoc0yjzraGhjhg/1DgPgKJ+ThGIV36tV5iAItzeefP7NJkM+p6nDN/Qk51zCGraKNPT7rTJzJaAwmeEiifI00kMFOYNDGOT8Q5ZxTmd13hZGwz7BRgGrM3DPp6539JJt/YsR3qyO/sLvEw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E6KJCa9C; 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="E6KJCa9C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A12AC32781; Sat, 27 Jul 2024 09:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722071082; bh=bSOt8metnNP3/iqWxOWzMI46nYQl9PqNnxav/zmkGn0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=E6KJCa9CZCTMltum0Icev5f3AeNvpq7pGg48Q74ruuiIUMxwRA6goUWgASSyhoz3q d7M4JtXA/j1lLLpaDuJ/Gdl6qjc/I4aBOw8tBVvCFLYIN4vFArGz6kx3+mU4unsH8R 0YuSg5FS0w4tbnc5+YNwTAULuZWp7BuvjjL4UJYxCPxGZF4R9gKAmnOuxY0G6WArMG jqf3RgkpgHOgVbdHSA4vbVu9sl3P7o6btT3hRuIqSFZDbzukEx0uMJjG5+6FJdZ2AN Hy5bnTw3XZ0VRBgYyu10/Dt3BJHZ/P3H3uoTWHyKt3Ljn2o4Pq7BOCn+A8AqhIHklT XIOp+YGrhzTqQ== From: "Matthieu Baerts (NGI0)" Date: Sat, 27 Jul 2024 11:04:02 +0200 Subject: [PATCH net 4/5] selftests: mptcp: fix error path Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240727-upstream-net-20240726-mptcp-fix-signal-readd-v1-4-1e7d25a23362@kernel.org> References: <20240727-upstream-net-20240726-mptcp-fix-signal-readd-v1-0-1e7d25a23362@kernel.org> In-Reply-To: <20240727-upstream-net-20240726-mptcp-fix-signal-readd-v1-0-1e7d25a23362@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-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=966; i=matttbe@kernel.org; h=from:subject:message-id; bh=e5G+qBWEYbAT7+emrmtR+ukYBzYToM7rlgjg4Y+sDZE=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmpLga749PMCC/7juHKqBn/sepRpTMVAoI7FFvG hYa2qz00E2JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZqS4GgAKCRD2t4JPQmmg cw+oD/0YZ26mQwpGF/ugZqhRj8FrJhJJcFTPrK9O+MqePopy0NHUEK+M6PkqDx51RXMlwGzgpDH JDoyRB1ZDwhvX/vvKcKuyM+b0jiFIAfq17njzdgE1UTt0NFzwH/2pg4PRvU+nRPpW9t0CYRePuW Aru8SnouAY8SMtAgPlfWHjp5dNtqmhB/4SU7uS96bwuEPOAuHd8DeLLdcs6d/4Nh4jPoY1u/ima 2xX8GlEZLo4p5rca//4dJQpk1WI3QfiOcAEETKEnqmivnik0k6M2FUaJauHzvuMLk8kJWIrM2W5 gQJyrWZzEdBfQxiD+LaZ0NFMaIrJmluB7dczjfOe0N3SO756BWxKgyh67c5MMlR6FXiawOPSi6+ 5rEB9m+EyWVfC4b04I0Qop3tIkoBlBL8j9RNSqhqB8W2iSRxNIkW4Kya21AveOPftpIiBPXQzVD dYtoI6+pUpQYRnY8Xs0/ryME7CRuyq02FN/OzbS9sVZOec1iUwhUcqVzy7w7jfSjUvlVedo5beL BneJy+guyclTJZtefdWiB2HzI3hkGZOppQLx5z8rleBT3O4wECSsQpU9z8tRegaKSUB2Xu4TjJM yqYAffFYbyvclfA/HlJg7dm9qEKrzqIx9/PBHYbWKEiMHd2B6/hBIoRUO/YYBdePbK0xLsYEPGu eBwap7k/QRxGxVw== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 From: Paolo Abeni pm_nl_check_endpoint() currently calls an not existing helper to mark the test as failed. Fix the wrong call. Fixes: 03668c65d153 ("selftests: mptcp: join: rework detailed report") Cc: stable@vger.kernel.org Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 9c091fc267c4..55d84a1bde15 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -661,7 +661,7 @@ pm_nl_check_endpoint() done if [ -z "${id}" ]; then - test_fail "bad test - missing endpoint id" + fail_test "bad test - missing endpoint id" return fi From patchwork Sat Jul 27 09:04:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthieu Baerts \(NGI0\)" X-Patchwork-Id: 815528 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 B939E7605E; Sat, 27 Jul 2024 09:04:45 +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=1722071085; cv=none; b=PZqXVEQCT739aZ0jXmg1uxvYk7sLfOwlt0VVyfecLzUEJxl/vjlCA5T6L+GpP61DuWAq7TlpsUtQtRjc6DvfMpFrNplF5IJLa9snp+LIuc7oPWwnUqZ7LcBc030y0yg49MPRabmIo5aL6VLrKOG95ZnIydnf9E3nou6KUccBVM0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722071085; c=relaxed/simple; bh=q39VdB8mNDwQCHK2MaVvtUOIGr7ySla1YQ4BspARZ0s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pNOM3wh/s3RGCnbyQbYW8z98yLQAg2A2/geFgFRR+RYkOoxxU8nAq12MzxHhTbw36xho/PqthOa21VqXhJNfQhRmeRPtecaOhTiyJqMv5zSXYr0Ga7vMiWzQX3E7jVLvOoyso3GB0taf8XPe5RbqGIcNU7w/8E+hrX9orVme1F4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Qm4FU4OT; 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="Qm4FU4OT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 752BEC32786; Sat, 27 Jul 2024 09:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722071085; bh=q39VdB8mNDwQCHK2MaVvtUOIGr7ySla1YQ4BspARZ0s=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Qm4FU4OT67yK7L/vLx+ZfptuNxuaf+R5Sj4eNaMkOoV1F6pEAG3DbzGmn+bPF4NGP E5+hdwtIOdKKAojjYqpnPq1740xt8nbJCKtaWXwFGXE1AP7pQdnSek+rOx/nt7pHes UzsrpRMuryE4+Q5+KorwqUqgSbBXZSqMy50p/JacPqe8dwF5RPqmh/J4/ZeaI9judE McaqQVbE0O9iB896xZM+AxivktKL9IaFUYQJJbgJWfHJpBFfRYVLRLJ2OegbfCRA1W 7E6P/dB4EdrAKqtB8KsxgmMpT2yDZ1OAAN2KylExjXg0ygRAaWjqR3mJEz+QD9gYg8 vdfhZ5w7keybQ== From: "Matthieu Baerts (NGI0)" Date: Sat, 27 Jul 2024 11:04:03 +0200 Subject: [PATCH net 5/5] selftests: mptcp: always close input's FD if opened Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240727-upstream-net-20240726-mptcp-fix-signal-readd-v1-5-1e7d25a23362@kernel.org> References: <20240727-upstream-net-20240726-mptcp-fix-signal-readd-v1-0-1e7d25a23362@kernel.org> In-Reply-To: <20240727-upstream-net-20240726-mptcp-fix-signal-readd-v1-0-1e7d25a23362@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-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , Liu Jing , stable@vger.kernel.org X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1072; i=matttbe@kernel.org; h=from:subject:message-id; bh=NLv7vDmMfDiB+NnrIJN7GOD0VoD4/6JVrrZIzXMgiKk=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmpLgad50O+zraWBHV/l9cPIPKdcvCuD6dSZTjz MRljk8mIp+JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZqS4GgAKCRD2t4JPQmmg c1xbEADnqbeI0hlFn8X6aE504BR9NWZQuFFUH+RMgnSH1dUBjKorIj9cCF6z24fDPOjueOheMWu ab45Sf2hOSVTreB2dHmbgGgPHC2t5fUByAfCCqWQiUQiO3ImOnRqahiuZRXUm3a5J9Qxw/RCc8b XTiTpwdiYyt5Jk1ZTrtlLwjIdZ6v26CBbKHipatyh47Rbp/GrAXOndHg6nd9o1sx25xOkdmrcC4 8pE+nykqWfkysh2Mm4rxS2y8zV5mfVXugQmfNOKO7Zm33ySxfkqGXbehFt/6FIEa9GrlSd2o+XP zKArv0xLIDWkLLYaW/LjprtExNyCe6Qdh9mGSyqlwnXD0cF38TdD/V70TozVjUHKhqQBmu48doJ 7DH5uelxfowf7fsBAC0IkAAT1vqbpQNcKtTVWT3uN97DLncqvGox8M1A4sGCo6R3mvq31apTc7n WI2FccZgIe9L+KqxgbIPVJ2O8fZGBXkZZx88HL18tAOIx4yNz2lqnx3uL1mN3b5TyGUduOTusjf Y0VJiDSXijgVQO6FAIoat9nO5bW4kxAIDwbE4nEiwqKyZEjveFYtSSjsKqWcCB+5evAICiRs3h5 JnwqOMKv3ak+1dqJyshuw0NWjp6Jwum9xuKpyB8UlJJCoVEN5mJGzzqtxQtejBRCP7s3f3nyYzt UjfU/hV9j8jPfSA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 From: Liu Jing In main_loop_s function, when the open(cfg_input, O_RDONLY) function is run, the last fd is not closed if the "--cfg_repeat > 0" branch is not taken. Fixes: 05be5e273c84 ("selftests: mptcp: add disconnect tests") Cc: stable@vger.kernel.org Signed-off-by: Liu Jing Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c index d2043ec3bf6d..4209b9569039 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -1115,11 +1115,11 @@ int main_loop_s(int listensock) return 1; } - if (--cfg_repeat > 0) { - if (cfg_input) - close(fd); + if (cfg_input) + close(fd); + + if (--cfg_repeat > 0) goto again; - } return 0; }