From patchwork Wed Oct 30 04:03:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13855896 X-Patchwork-Delegate: matthieu.baerts@tessares.net 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 4BDEB28EB for ; Wed, 30 Oct 2024 04:03: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=1730261025; cv=none; b=Ivu15AOk7ggP5D1F2775G7lbXbc8qBIjgcFS3kvTUmRkfu1uEiDdu/S0H/92tY05xtPU4Qarx/5W9RoKoiEfalWrWhZawavF2/EMnejniq/REZyldVdyi+waQ4JENZ64nn7ltgYxjQObVcnQob/kOt7MmpMsa9dNEXyXK7P3pwg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730261025; c=relaxed/simple; bh=qCYDQ+A3rY5RCgBwXvI0z88JnUEX8dUHouhwvs6OIa8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LjgkN+PlRJfFvup21bTsZGqINA95RXfTX6ycnR6Y7AZIXG/aylJfL8CeJDk3WDmpwIP+Pcd8Gqi4oDHORA5d8372SAMPTM9QfF3Eo+YAHKWS0zP5n/ytQXRdfNXO3uFQHpMByef2BBa1482Gv2NLbPMgC9n3b9P03a1jde5G0IU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eQvH4lNk; 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="eQvH4lNk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 213F8C4CEE6; Wed, 30 Oct 2024 04:03:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730261024; bh=qCYDQ+A3rY5RCgBwXvI0z88JnUEX8dUHouhwvs6OIa8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eQvH4lNkJZQt1e37wFrQ26Z771ncA4dWysc0Ulrv9LbSjw7iENl7sqxLP7//3TSis zeY3jGcdGNEkHudEkdfq+NeXVp1bqUqEDBJ5bJDjpPS4aaqDExxVSfolJC0UMJMaB2 npKjdQzQtcHZpdcAcJ4LDPLPmXFHLi+3/tnMuS8T1ASZOUiNSqvqdKS5Pkmg/Dlrl4 Xl6HY/iBSJCL8EllwvUfbD/QfXRLzkKX4yxpcQgN8qTjX6bnyrj9hfevFtBo7ymBWx vOYGwZOCzcDfsmKlgEPRqPhXWj36bZC5vHt2kTVanujBVLxH3prIe5NMJgw7ZGT4I1 7ls1sS39680OA== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 1/4] selftests/bpf: Drop netns helpers in mptcp Date: Wed, 30 Oct 2024 12:03:35 +0800 Message-ID: <4666f23dec74e96e610469190687d8b20c3de904.1730260715.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Geliang Tang New netns selftest helpers netns_new() and netns_free() has been added in network_helpers.c, let's use them in mptcp selftests too instead of using MPTCP's own helpers create_netns() and cleanup_netns(). Signed-off-by: Geliang Tang --- .../testing/selftests/bpf/prog_tests/mptcp.c | 42 ++++++------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c index be746e0fc393..e32eceabfc40 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -90,24 +90,6 @@ struct mptcp_storage { char ca_name[TCP_CA_NAME_MAX]; }; -static struct nstoken *create_netns(void) -{ - SYS(fail, "ip netns add %s", NS_TEST); - SYS(fail, "ip -net %s link set dev lo up", NS_TEST); - - return open_netns(NS_TEST); -fail: - return NULL; -} - -static void cleanup_netns(struct nstoken *nstoken) -{ - if (nstoken) - close_netns(nstoken); - - SYS_NOFAIL("ip netns del %s", NS_TEST); -} - static int start_mptcp_server(int family, const char *addr_str, __u16 port, int timeout_ms) { @@ -227,15 +209,15 @@ static int run_test(int cgroup_fd, int server_fd, bool is_mptcp) static void test_base(void) { - struct nstoken *nstoken = NULL; + struct netns_obj *netns = NULL; int server_fd, cgroup_fd; cgroup_fd = test__join_cgroup("/mptcp"); if (!ASSERT_GE(cgroup_fd, 0, "test__join_cgroup")) return; - nstoken = create_netns(); - if (!ASSERT_OK_PTR(nstoken, "create_netns")) + netns = netns_new(NS_TEST, true); + if (!ASSERT_OK_PTR(netns, "netns_new")) goto fail; /* without MPTCP */ @@ -258,7 +240,7 @@ static void test_base(void) close(server_fd); fail: - cleanup_netns(nstoken); + netns_free(netns); close(cgroup_fd); } @@ -343,21 +325,21 @@ static int run_mptcpify(int cgroup_fd) static void test_mptcpify(void) { - struct nstoken *nstoken = NULL; + struct netns_obj *netns = NULL; int cgroup_fd; cgroup_fd = test__join_cgroup("/mptcpify"); if (!ASSERT_GE(cgroup_fd, 0, "test__join_cgroup")) return; - nstoken = create_netns(); - if (!ASSERT_OK_PTR(nstoken, "create_netns")) + netns = netns_new(NS_TEST, true); + if (!ASSERT_OK_PTR(netns, "netns_new")) goto fail; ASSERT_OK(run_mptcpify(cgroup_fd), "run_mptcpify"); fail: - cleanup_netns(nstoken); + netns_free(netns); close(cgroup_fd); } @@ -473,7 +455,7 @@ static void run_subflow(void) static void test_subflow(void) { struct mptcp_subflow *skel; - struct nstoken *nstoken; + struct netns_obj *netns; int cgroup_fd; cgroup_fd = test__join_cgroup("/mptcp_subflow"); @@ -496,8 +478,8 @@ static void test_subflow(void) if (!ASSERT_OK_PTR(skel->links._getsockopt_subflow, "attach _getsockopt_subflow")) goto skel_destroy; - nstoken = create_netns(); - if (!ASSERT_OK_PTR(nstoken, "create_netns: mptcp_subflow")) + netns = netns_new(NS_TEST, true); + if (!ASSERT_OK_PTR(netns, "netns_new: mptcp_subflow")) goto skel_destroy; if (endpoint_init("subflow", 2) < 0) @@ -506,7 +488,7 @@ static void test_subflow(void) run_subflow(); close_netns: - cleanup_netns(nstoken); + netns_free(netns); skel_destroy: mptcp_subflow__destroy(skel); close_cgroup: From patchwork Wed Oct 30 04:03:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13855897 X-Patchwork-Delegate: matthieu.baerts@tessares.net 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 D2B4628EB for ; Wed, 30 Oct 2024 04:03:46 +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=1730261026; cv=none; b=Y2TqHqvHNq11nsZNeGzc1eofWC115wGO316ntKhaj6kMaqyyU72yivHoOY/OcDu0mTkxEz9+tYNLMt648tilk9C47xXcrSTHy6FA0CCC9nwdISwpfXRpQ02R61asALH8qMj2yey0zJ0H4RvURoM4xrfOZhznyDM8zkWgIk8vPNQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730261026; c=relaxed/simple; bh=VJQ1aKlsLshIkH3sj6TGGlKsTeHZhvlQK9tA0H0kfnI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Jq8eHxBbidI6E0wUqF8j2ytIP2XF3YiRHIZUr3USVabt5jnjgOI0e3XrQWubfCnuU2PdTajdU97qCUpUFXiLGnan9SAi5L9EkVk7kxmGGPqooDsS7IDyVH4tH0ImMNzmsen004iJS9yVf04Gn181dsTgQq4UUAoFmerq6YsjH20= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YWlJ1b6O; 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="YWlJ1b6O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 721F5C4CEC7; Wed, 30 Oct 2024 04:03:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730261026; bh=VJQ1aKlsLshIkH3sj6TGGlKsTeHZhvlQK9tA0H0kfnI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YWlJ1b6Oe+p0uTprXYkNH2zAxJiROggBNkHYFToYZydXRlRgol0Duclte2r/T9/aN +60bbGI0lnX+HRdd+oP0lOt+x64WxKGudtD1Y7hhzJopt2Py2Nx6Ty+yNSIOSKnoYh 1TPxGFttT4H3at8Jqq8xpinIV67NFfiKDQX+gD9d2pm8rkXSHOtoY6cF7Xxr4bCWZg +XK7MTAZuozs4gXr1kJ7T4gGAeISabqr2fi4oksitoAUovPUOWdM/cFDdvX8ySJpIl DkuCKYsqZyj/0GQYS0J+k8AW7q0Fj/rKUPT9ydWDJp6zR/uuiC8eMwXfKEZNanhv2/ pVqlXy0jiYT9A== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 2/4] Squash to "selftests/bpf: Add mptcp_subflow bpf_iter subtest" Date: Wed, 30 Oct 2024 12:03:36 +0800 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Geliang Tang Use new netns helpers. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/prog_tests/mptcp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c index e32eceabfc40..238d2f1cd96e 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -526,7 +526,7 @@ static void run_iters_subflow(void) static void test_iters_subflow(void) { struct mptcp_bpf_iters *skel; - struct nstoken *nstoken; + struct netns_obj *netns; int cgroup_fd; cgroup_fd = test__join_cgroup("/iters_subflow"); @@ -542,8 +542,8 @@ static void test_iters_subflow(void) if (!ASSERT_OK_PTR(skel->links.iters_subflow, "attach getsockopt")) goto skel_destroy; - nstoken = create_netns(); - if (!ASSERT_OK_PTR(nstoken, "create_netns: iters_subflow")) + netns = netns_new(NS_TEST, true); + if (!ASSERT_OK_PTR(netns, "netns_new: iters_subflow")) goto skel_destroy; if (endpoint_init("subflow", 4) < 0) @@ -555,7 +555,7 @@ static void test_iters_subflow(void) ASSERT_EQ(skel->bss->ids, 10, "subflow ids"); close_netns: - cleanup_netns(nstoken); + netns_free(netns); skel_destroy: mptcp_bpf_iters__destroy(skel); close_cgroup: From patchwork Wed Oct 30 04:03:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13855898 X-Patchwork-Delegate: matthieu.baerts@tessares.net 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 3E77628EB for ; Wed, 30 Oct 2024 04:03:47 +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=1730261028; cv=none; b=H2gQvpS0LQCU3XM5INyfm3eYcQmwOwId+8Ol3cpWGv+zvDQAJTFrhM+EEpG0H+O+rm7HOPn+X6tsDUCAXlPzSmiH0v7jBXsKzTjV0BWU+TbInxUfO4Axa2g7AejPXRZif0ZqFHsZcRi87LTLSCQHlDZKfDYkr8+c7rKQJyFir8g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730261028; c=relaxed/simple; bh=7JoCTUryXzBGwqSW8UWuGMlgJClakIHPhEpnzr4+Q3w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PGAJFngkYNdIZEJMwPIzoDIxri07RI7dt8AXSvzonWpWVBZ3EEoYSdnOukjK3mr/8MOZatJf1rji3gu0AOgrG+tn1rHxs6+PAPdmYLPFW8Al+6gSs/rIbvln4oBCHH4V1JCanQ1RXPRFvYbTKUMQ0DHwKBsDHhFTjOqfkgmCkqI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LdH25qWS; 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="LdH25qWS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05F03C4CEC7; Wed, 30 Oct 2024 04:03:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730261027; bh=7JoCTUryXzBGwqSW8UWuGMlgJClakIHPhEpnzr4+Q3w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LdH25qWSeR8prpUFEBkY2mflHfd8BN5qYMXJAKQCriZglqc3mVLhnq1lhujYtj5tP dDLAqFmntA2uZmqGtZ1/o7dhx3LtyhxG7kzB4YS/c2yEFlgYFIGpd/hehZ//oQ4nJO Gu/q8FDRiwwWrC0GikTwoFnKvlLj53e7h4PQ87cBJJzXT7g+MdHv1r9CO7NKGWX6M8 2BWJBBhSZojMwjhTgGPEIEe1uZvpwpb91fg7oR2yAkOENeUL13ZF+2jOwVMR7Q7Bgx WFfN+iRHDZdFZ1P0uLKa5lNpP4URVcMYXyNFtpeAaMvk15L+ZFOz3cDC4+oSlZLMGz TqQ/mpU++0thA== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 3/4] Squash to "selftests/bpf: Add bpf scheduler test" Date: Wed, 30 Oct 2024 12:03:37 +0800 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Geliang Tang Use new netns helpers. Signed-off-by: Geliang Tang --- .../testing/selftests/bpf/prog_tests/mptcp.c | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c index 238d2f1cd96e..8db1def2e219 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -562,12 +562,12 @@ static void test_iters_subflow(void) close(cgroup_fd); } -static struct nstoken *sched_init(char *flags, char *sched) +static struct netns_obj *sched_init(char *flags, char *sched) { - struct nstoken *nstoken; + struct netns_obj *netns; - nstoken = create_netns(); - if (!ASSERT_OK_PTR(nstoken, "create_netns")) + netns = netns_new(NS_TEST, true); + if (!ASSERT_OK_PTR(netns, "netns_new")) return NULL; if (endpoint_init("subflow", 2) < 0) @@ -575,9 +575,9 @@ static struct nstoken *sched_init(char *flags, char *sched) SYS(fail, "ip netns exec %s sysctl -qw net.mptcp.scheduler=%s", NS_TEST, sched); - return nstoken; + return netns; fail: - cleanup_netns(nstoken); + netns_free(netns); return NULL; } @@ -635,16 +635,16 @@ static void send_data_and_verify(char *sched, bool addr1, bool addr2) static void test_default(void) { - struct nstoken *nstoken; + struct netns_obj *netns; - nstoken = sched_init("subflow", "default"); - if (!nstoken) + netns = sched_init("subflow", "default"); + if (!netns) goto fail; send_data_and_verify("default", WITH_DATA, WITH_DATA); fail: - cleanup_netns(nstoken); + netns_free(netns); } static void test_bpf_sched(struct bpf_object *obj, char *sched, From patchwork Wed Oct 30 04:03:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13855899 X-Patchwork-Delegate: matthieu.baerts@tessares.net 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 4214428EB for ; Wed, 30 Oct 2024 04:03:49 +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=1730261029; cv=none; b=c3UgUtN7FVk5fZJnY+b9dxnu6q1T/JyD20vVCI7w2DHkIwZ/ANyFB+B4Cs6g6BOpB8iiG0PJv+s07GDvUbby17MZPWbYFRvXCdDdXVxAkRhdZ42OgVbnZg5CWzuvpMX2P6p0TwT28LC4BSD5chlRrtjo6+0N+kO05NGTCveBw28= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730261029; c=relaxed/simple; bh=3OUVW0d0WRCpb1hLfX3XmcTBEmsRYLjG/pnaP40SdWY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X35lfGBpqOAymx6GCHOFa+4xvyqChfIrFW53wtdy67pDoLGjnbXxN7Vyx/j9+ANfISLI7qbb5pkuVnlpW0BdYrrWC5wsM8YLDN4lkx8jfO0oZ/8n+E9Z38KQ15FP+LhhS+9bbj+0w/hEA/u4PhqJ0L8Fxyitoj5toWohg6Vh/ww= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mDl3kYtj; 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="mDl3kYtj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5283EC4CEE4; Wed, 30 Oct 2024 04:03:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730261029; bh=3OUVW0d0WRCpb1hLfX3XmcTBEmsRYLjG/pnaP40SdWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mDl3kYtjd9Fj5edYzQq9SpPodcZrvCekmlGf7gKR5DeZ2mU1GSHQ5GdPWbXzCXQwX lutlUfR0N+LjzB1vqzDWjfou1rvkmb0qlTKGmJd+NYD9Hqr61lCpijNfmNmJgPvfeP By2meCQ4FrKWGt2ftoQfk8ngFnEEkGm3hgQMaBxapluURWeKQly4DF4rEbQG/N9imp DCIFbHglfnYx3nP2BZydF8bzbHtBATkuR7b/BbyaeczuIfVD5vWjeuCKs1rnFDJso4 Xzd0OD65MA9ivrHNl+N1eLe0/t79J8JCntaGTpp4Jes48Uie5YqzAhVfRYNa/NA0cv jptANYlXCN9kg== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 4/4] Squash to "selftests/bpf: Add bpf_first scheduler & test" Date: Wed, 30 Oct 2024 12:03:38 +0800 Message-ID: <3155c5faa74d04130eb8d257f11de50603b1f5ac.1730260715.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Geliang Tang Use new netns helpers. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/prog_tests/mptcp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c index 8db1def2e219..1d68bbda3370 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -651,7 +651,7 @@ static void test_bpf_sched(struct bpf_object *obj, char *sched, bool addr1, bool addr2) { char bpf_sched[MPTCP_SCHED_NAME_MAX] = "bpf_"; - struct nstoken *nstoken; + struct netns_obj *netns; struct bpf_link *link; struct bpf_map *map; @@ -664,14 +664,14 @@ static void test_bpf_sched(struct bpf_object *obj, char *sched, if (CHECK(!link, sched, "attach_struct_ops: %d\n", errno)) return; - nstoken = sched_init("subflow", strcat(bpf_sched, sched)); - if (!nstoken) + netns = sched_init("subflow", strcat(bpf_sched, sched)); + if (!netns) goto fail; send_data_and_verify(sched, addr1, addr2); fail: - cleanup_netns(nstoken); + netns_free(netns); bpf_link__destroy(link); }