From patchwork Mon Dec 23 08:30:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13918597 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 D6A4D18E02A for ; Mon, 23 Dec 2024 08:30: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=1734942624; cv=none; b=U4jjAHgJ+ES3nRzNWwrb4YsQX1SoMGPcAEAIMBwLlN4toTHu947XSV+LRHS3khwruLa+zID7vWKjzWYUhquvB5jk8xuX5YYR43itCRrQ50Wz42aOIjgmhc1Ww9uVyYPOj3geRB8jBWoTllFVdysabO9ECpAW2rb/TyZZU7ubGB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734942624; c=relaxed/simple; bh=Gc5LKxQ3OcogXSwdYqvHiBccFxxgprSou6++gckWMV0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IDtzyBH2PAojmr3Ppng1jHCaL1WAu9z/gZZNWsUOUuo6irhwaLRsrx7RddWfVx56f+hypzbNgmfR291xVVNekCMToGIxe5H0jpMzXMhwyj6jZKA7BekF+KtN3PY+YCGGOx8nB9J2m0WoFEm/tvstBuN2vJLIMqqSzI3f+HKzctI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TR3qrxy+; 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="TR3qrxy+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EAD1C4CED4; Mon, 23 Dec 2024 08:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734942624; bh=Gc5LKxQ3OcogXSwdYqvHiBccFxxgprSou6++gckWMV0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TR3qrxy+Zigh8LnwH5HaAY4NiPfEyYyD9p/uCYxdxzFkHmStVHtp98UQBdLFGc+5Q XM9ggf0UUHopKB2Hofun+Aid7DE2h0hoWKti3pdxLrg4OTdrfhaaqFFres5DCstunt bF92k1Q0OaUOPkrbxvaTxh2z2fLanQ5qqTG/fVF1M4NnOzbOMceuvxCSAxTl9XgLAy dvsZkrSK+6IOu7qTlx/WMBFRaOeXKw+XyADkFdBTU9EzpJrDNblskMTp0MyDj3Vob1 WcOK491juweWGJaYa8u8B/hRhJUThvy9sfMd1baV2SWyZbb3tTwwXu6yOPJndqj4hX KVjZGayYEuMbg== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 1/9] mptcp: split get_subflow interface into two Date: Mon, 23 Dec 2024 16:30:07 +0800 Message-ID: <90848e85beae21f0ab67c5b6bc629bd8911c1891.1734942318.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 get_retrans() interface of the burst packet scheduler invokes a sleeping function mptcp_pm_subflow_chk_stale(), which calls __lock_sock_fast(). So get_retrans() interface should be set with BPF_F_SLEEPABLE flag in BPF. But get_send() interface of this scheduler can't be set with BPF_F_SLEEPABLE flag since it's invoked in ack_update_msk() under mptcp data lock. So this patch has to split get_subflow() interface of packet scheduer into two interfaces: get_send() and get_retrans(). Then we can set get_retrans() interface alone with BPF_F_SLEEPABLE flag. Signed-off-by: Geliang Tang --- include/net/mptcp.h | 5 +++-- net/mptcp/sched.c | 35 ++++++++++++++++++++++++----------- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/include/net/mptcp.h b/include/net/mptcp.h index 94d5976f7b8d..72d6e6597add 100644 --- a/include/net/mptcp.h +++ b/include/net/mptcp.h @@ -103,13 +103,14 @@ struct mptcp_out_options { #define MPTCP_SUBFLOWS_MAX 8 struct mptcp_sched_data { - bool reinject; u8 subflows; struct mptcp_subflow_context *contexts[MPTCP_SUBFLOWS_MAX]; }; struct mptcp_sched_ops { - int (*get_subflow)(struct mptcp_sock *msk, + int (*get_send)(struct mptcp_sock *msk, + struct mptcp_sched_data *data); + int (*get_retrans)(struct mptcp_sock *msk, struct mptcp_sched_data *data); char name[MPTCP_SCHED_NAME_MAX]; diff --git a/net/mptcp/sched.c b/net/mptcp/sched.c index 6da60e35932f..0b1e472e59a0 100644 --- a/net/mptcp/sched.c +++ b/net/mptcp/sched.c @@ -16,13 +16,25 @@ static DEFINE_SPINLOCK(mptcp_sched_list_lock); static LIST_HEAD(mptcp_sched_list); -static int mptcp_sched_default_get_subflow(struct mptcp_sock *msk, +static int mptcp_sched_default_get_send(struct mptcp_sock *msk, + struct mptcp_sched_data *data) +{ + struct sock *ssk; + + ssk = mptcp_subflow_get_send(msk); + if (!ssk) + return -EINVAL; + + mptcp_subflow_set_scheduled(mptcp_subflow_ctx(ssk), true); + return 0; +} + +static int mptcp_sched_default_get_retrans(struct mptcp_sock *msk, struct mptcp_sched_data *data) { struct sock *ssk; - ssk = data->reinject ? mptcp_subflow_get_retrans(msk) : - mptcp_subflow_get_send(msk); + ssk = mptcp_subflow_get_retrans(msk); if (!ssk) return -EINVAL; @@ -31,7 +43,8 @@ static int mptcp_sched_default_get_subflow(struct mptcp_sock *msk, } static struct mptcp_sched_ops mptcp_sched_default = { - .get_subflow = mptcp_sched_default_get_subflow, + .get_send = mptcp_sched_default_get_send, + .get_retrans = mptcp_sched_default_get_retrans, .name = "default", .owner = THIS_MODULE, }; @@ -73,7 +86,7 @@ void mptcp_get_available_schedulers(char *buf, size_t maxlen) int mptcp_register_scheduler(struct mptcp_sched_ops *sched) { - if (!sched->get_subflow) + if (!sched->get_send) return -EINVAL; spin_lock(&mptcp_sched_list_lock); @@ -184,11 +197,10 @@ int mptcp_sched_get_send(struct mptcp_sock *msk) return 0; } - data.reinject = false; if (msk->sched == &mptcp_sched_default || !msk->sched) - return mptcp_sched_default_get_subflow(msk, &data); + return mptcp_sched_default_get_send(msk, &data); mptcp_sched_data_set_contexts(msk, &data); - return msk->sched->get_subflow(msk, &data); + return msk->sched->get_send(msk, &data); } int mptcp_sched_get_retrans(struct mptcp_sock *msk) @@ -207,9 +219,10 @@ int mptcp_sched_get_retrans(struct mptcp_sock *msk) return 0; } - data.reinject = true; if (msk->sched == &mptcp_sched_default || !msk->sched) - return mptcp_sched_default_get_subflow(msk, &data); + return mptcp_sched_default_get_retrans(msk, &data); mptcp_sched_data_set_contexts(msk, &data); - return msk->sched->get_subflow(msk, &data); + if (!msk->sched->get_retrans) + return msk->sched->get_send(msk, &data); + return msk->sched->get_retrans(msk, &data); } From patchwork Mon Dec 23 08:30:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13918598 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 D59BA1514CC for ; Mon, 23 Dec 2024 08:30:26 +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=1734942626; cv=none; b=oDHEt1yJFxnmRUmjlqVhXFsxZb9IMkwWTQdRGaB8WDtFFLuLp4uejPz9MOVV6KZMlTiqwubru2gRqJUxtWaq+jecBP7GmE8LSCCL3l1HXL5HmjGKAOJB4afAl5kzhUwOBFQi1wHpC1YzW9or7QDT+zaq9oI1wnUOaVbRZgfSWrU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734942626; c=relaxed/simple; bh=MnplbIa5aZflN54kg3ewAWhVKcNBCX6oRBVowXEqfZc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E4JboEcwUh/bTQJqFl8gTCH4zf8w1U6ICVlUh4TPO3gva9fNHT8BdOrAtVu2OmuAdHEK0pDUKyN68bgRCG/54biNcd3mzUDQTeodKmVqApP6Rqbzvg5B4+X+QJY0a3PGeCmIQXNFKRYS1hOAqYPLHSHilonzMk++XpqtmC1X8Q0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OxOpJawo; 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="OxOpJawo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28A17C4AF0B; Mon, 23 Dec 2024 08:30:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734942626; bh=MnplbIa5aZflN54kg3ewAWhVKcNBCX6oRBVowXEqfZc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OxOpJawoQos68atz0Y/Gi15LhU9QT715dDCvmZJxQjOrDUzijglnbKzRnIZbZ6fOj R9gQWy8SvKxoGxrTljVUeb88wtxbmpK5LsWx6VM0NBFLRNUK3vM1TlyPm7zlUKekeC y/6Qi31Q5/Wk9pF8zJwlJUstJ2mwR+KTOQRHZbNfkKfAypc8ZpTONRZltZVPkHwXdM i2bqA2aGWy2GSpfpSPQclmmIsMLoMIPo5Vi7nG9kHgm23mbJNnz3TmZeFyNN1qzu3Y TbXpp5ub468u1urSdx1Lkr2fOHFBf9lQh3rsepjBhIhpgnbK5IKLI6051OYfrWDZkN 8ESHN/VFtz11A== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 2/9] Squash to "bpf: Add bpf_mptcp_sched_ops" Date: Mon, 23 Dec 2024 16:30:08 +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 Please update the subject to bpf: Add mptcp packet scheduler struct_ops Split get_subflow interface into two. Signed-off-by: Geliang Tang --- net/mptcp/bpf.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c index 923895322b2c..8d4865177037 100644 --- a/net/mptcp/bpf.c +++ b/net/mptcp/bpf.c @@ -156,7 +156,13 @@ static int bpf_mptcp_sched_init(struct btf *btf) return 0; } -static int __bpf_mptcp_sched_get_subflow(struct mptcp_sock *msk, +static int __bpf_mptcp_sched_get_send(struct mptcp_sock *msk, + struct mptcp_sched_data *data) +{ + return 0; +} + +static int __bpf_mptcp_sched_get_retrans(struct mptcp_sock *msk, struct mptcp_sched_data *data) { return 0; @@ -171,7 +177,8 @@ static void __bpf_mptcp_sched_release(struct mptcp_sock *msk) } static struct mptcp_sched_ops __bpf_mptcp_sched_ops = { - .get_subflow = __bpf_mptcp_sched_get_subflow, + .get_send = __bpf_mptcp_sched_get_send, + .get_retrans = __bpf_mptcp_sched_get_retrans, .init = __bpf_mptcp_sched_init, .release = __bpf_mptcp_sched_release, }; From patchwork Mon Dec 23 08:30:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13918599 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 B7E7819006B for ; Mon, 23 Dec 2024 08:30:28 +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=1734942628; cv=none; b=CB/d6goyiJVjpTX1dIwcuoGB1Tq6PFJapmb0wMwMDTcjBn2ukgyhodMnFml6Ue3Wjcvp9b25mnC6e3j93KHVMuJ4wzO/SB02GBTXQzL1p/k1eZLkUc8dCIJsWEyzuDkpMvyaNk3eeaVAkoXjiObgKzyIRICQcavoDuQiFrGjoKw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734942628; c=relaxed/simple; bh=W4wLhdV6SVB3Zm49Q3kdDFdiJYEuZLkT8leQz+0HI9w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IKVw16TltVagNP+gho3DwKS61fkhX+EzD1b5Nq8OFw4lI8rUyXN2cX4zSuK13CTKNWI4cruVKhg8oThnOje9cGEYI0Vg9cL5cUsq7g4QCI3K2unoYkt0rvUeLedPetSNc5RAqvdloj4KzdSc4UIe3qZ9hniMUUPG5YGDXTNnnoM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BqBwLktW; 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="BqBwLktW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0137BC4CED3; Mon, 23 Dec 2024 08:30:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734942628; bh=W4wLhdV6SVB3Zm49Q3kdDFdiJYEuZLkT8leQz+0HI9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BqBwLktW26BMDrLj+6ESDu0A/V+sceLa34d272pTFILx3770A9bJ5dy7kchAjNZE/ W//LPle3ZE3vBvlJJ+RPjVTj2lw+DtS4Ja1eY9D3G0Xwl9aJSf4qeww1wxS4WlcMGg RBXRTh7hoZqljysmt8/HZfct6A7huqvM+fxmQJwGfpmqvaqp/2ByVK0SbVkjp9VIRc xNXPmu/TrJhDLvPm1zjQA9NA6fLEjGcRIfHWyQ/2Kkc6sS0pXNCrq8Il48VFhBcupK 0ulpEqouhaUKwB95XSNCCS550qNtV9vKYTG747fzdvSn/nBbSgjqO0F69FNqje77Q2 xDIzgFpnO6hgg== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 3/9] Squash to "selftests/bpf: Add bpf_first scheduler & test" Date: Mon, 23 Dec 2024 16:30:09 +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 interface get_send() instead of get_subflow(). Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/progs/mptcp_bpf_first.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_first.c b/tools/testing/selftests/bpf/progs/mptcp_bpf_first.c index d57399b407a7..ab71ae3c6506 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_first.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_first.c @@ -17,7 +17,7 @@ void BPF_PROG(mptcp_sched_first_release, struct mptcp_sock *msk) } SEC("struct_ops") -int BPF_PROG(bpf_first_get_subflow, struct mptcp_sock *msk, +int BPF_PROG(bpf_first_get_send, struct mptcp_sock *msk, struct mptcp_sched_data *data) { mptcp_subflow_set_scheduled(bpf_mptcp_subflow_ctx_by_pos(data, 0), true); @@ -28,6 +28,6 @@ SEC(".struct_ops") struct mptcp_sched_ops first = { .init = (void *)mptcp_sched_first_init, .release = (void *)mptcp_sched_first_release, - .get_subflow = (void *)bpf_first_get_subflow, + .get_send = (void *)bpf_first_get_send, .name = "bpf_first", }; From patchwork Mon Dec 23 08:30:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13918600 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 5A26D19006B for ; Mon, 23 Dec 2024 08:30: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=1734942630; cv=none; b=N4wqrgEWqU6neBL07bZMUF8tXCpL2nCi+YqHurnn4VUG4lrN/RvIx1gihher/t+jh8OjrmQWmG220MIfcG2nI9D9FA3JNoB9LIjhM5balDlPwtmTGWI61Qj81ru7xPQC7O5Zxjg9who031TWdj0ss0V61cbiJjBu1rVT4pZ5Wtw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734942630; c=relaxed/simple; bh=Aja8Gq3oBQp7l+XYoK0YGV++xr/0opdmGfhXrHOSM4s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o5rA5N4vz86WsOyP94JPPeyGGmT5z4JCzLHcWsIKqqxZhSTLk0xzmmO1xJekjL4IgUof+7AdpVdQXistkONmFidUFrApIRx4SSQwbS35WH5jn/LdO3VhNiOYXQ4GsiY2yxF70ywYv+Cefk00J6z/ckcMuJs7bOG386ysDz4SYmg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fofKe28W; 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="fofKe28W" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE2CEC4CED6; Mon, 23 Dec 2024 08:30:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734942629; bh=Aja8Gq3oBQp7l+XYoK0YGV++xr/0opdmGfhXrHOSM4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fofKe28WnbAsgitBVCsmktLDLRnX+sxcm45HlhLPRvP+1lshYWaXquNZxl3W95Q9q SOqR/+PrRGWtNqYdodQ0YaZ4djdb4pI+dvRzHdJz8bDC4ySrlNzWN3KMfnmYHs5TGh 44xNWW10DqexmObk8KeZlQf4cS1JoFWIyVBAjwLzjJA1JWlEtDcd5ffZ9rht466PXR UGisr3ioR+47gr1dnlwqBY/1SoBgIvpj3K4ykcfOr8aDDWi61H09PiAiPmFvuRSt1C xEWlIytxCe32OUOb7oQkIEQYgdsNVkw6PHyyTh3jCsQJooLlnmi43YKWfNAF20ER7L 5yTPDNE67t4ug== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 4/9] Squash to "selftests/bpf: Add bpf_bkup scheduler & test" Date: Mon, 23 Dec 2024 16:30:10 +0800 Message-ID: <2a87550e79b18aca1d0f6f6caf265b9f04b5d8ce.1734942318.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 interface get_send() instead of get_subflow(). Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/progs/mptcp_bpf_bkup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_bkup.c b/tools/testing/selftests/bpf/progs/mptcp_bpf_bkup.c index 296f0318d843..29be67e2f2ef 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_bkup.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_bkup.c @@ -17,7 +17,7 @@ void BPF_PROG(mptcp_sched_bkup_release, struct mptcp_sock *msk) } SEC("struct_ops") -int BPF_PROG(bpf_bkup_get_subflow, struct mptcp_sock *msk, +int BPF_PROG(bpf_bkup_get_send, struct mptcp_sock *msk, struct mptcp_sched_data *data) { int nr = -1; @@ -47,6 +47,6 @@ SEC(".struct_ops") struct mptcp_sched_ops bkup = { .init = (void *)mptcp_sched_bkup_init, .release = (void *)mptcp_sched_bkup_release, - .get_subflow = (void *)bpf_bkup_get_subflow, + .get_send = (void *)bpf_bkup_get_send, .name = "bpf_bkup", }; From patchwork Mon Dec 23 08:30:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13918601 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 22C7C19004D for ; Mon, 23 Dec 2024 08:30:31 +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=1734942632; cv=none; b=c2iSzTlVLdtNwGvLdmWN+6raROtuUH6duWMagE2P9KxSsifa4qvacv9048hPyMI53QeEnW6L7GJnW9p0/zeasjlIKdhgcfdkUkQmaJXxuRnRlVSKW7zw4uzZxTNn7XtKJ1LzZTR0Nf+qOmb37A0JFtn+7nZBnQ8qVefe0YNr320= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734942632; c=relaxed/simple; bh=UqTcQ1PZTKUdJs+cKK9dUBBLPnxmp1B9FxeWgk3TETc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eTcbfAqd4ZZ6/r2Rx7gbQC/bR9PNvVMUWji/Zf8rT9AcPdx+LEc0UJgzl6x4WUK+MvKEuOtuYkQ9nvIa/PsBoSLeTjBmBLmLjLPtjNKOrZ9GAHIcJfcNIFGH0VxhoPoCYwGSey+EJ2S2d3SgRdK8Hsst/OB3qRwNBzY4b8uIELY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=J+3xx2Fb; 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="J+3xx2Fb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EF9CC4CED3; Mon, 23 Dec 2024 08:30:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734942631; bh=UqTcQ1PZTKUdJs+cKK9dUBBLPnxmp1B9FxeWgk3TETc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J+3xx2FbljtkpfMg44l3zFHaJMnQDkUbFc1+0frBhAH/3PsYmkYNeso/q7NizPuon esi2w/aoVMHpJ55ySqnE8JW0haI2FYsrTU9hTO+Wzyc6drkXfYW4vvIjqrmKo95oCu QLEhJ4uNGmN/0aibiQnE7oeJ9RpzOhxzThkK1Mf2DZ6uxQKPVicbObtm9yNGZdaWrp yuFjyK5E2hGWS3LhX1O8ehwvesjZJBwo/eUh6QEIBmWHeEYpllUUsiiijTQVRqBlEN IXu/kelvLvO5U98zn5YSKqYiLE3DQk9ucVUUCqQ+09PGrMrkd154ir0nwxsczu2X7o fsSYyzvUyMteA== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 5/9] Squash to "selftests/bpf: Add bpf_rr scheduler & test" Date: Mon, 23 Dec 2024 16:30:11 +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 interface get_send() instead of get_subflow(). Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c b/tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c index 638ea6aa63b7..405e96c116d5 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c @@ -31,7 +31,7 @@ void BPF_PROG(mptcp_sched_rr_release, struct mptcp_sock *msk) } SEC("struct_ops") -int BPF_PROG(bpf_rr_get_subflow, struct mptcp_sock *msk, +int BPF_PROG(bpf_rr_get_send, struct mptcp_sock *msk, struct mptcp_sched_data *data) { struct mptcp_subflow_context *subflow; @@ -73,6 +73,6 @@ SEC(".struct_ops") struct mptcp_sched_ops rr = { .init = (void *)mptcp_sched_rr_init, .release = (void *)mptcp_sched_rr_release, - .get_subflow = (void *)bpf_rr_get_subflow, + .get_send = (void *)bpf_rr_get_send, .name = "bpf_rr", }; From patchwork Mon Dec 23 08:30:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13918602 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 2281E1684AC for ; Mon, 23 Dec 2024 08:30: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=1734942635; cv=none; b=EgidPwL+fz0j14kgNijoQ18XC06VvVr6okyPZGjMfuxha2FUDHPflhGVm5jV5RN++lMAgzUJxbje6YqnEYaQWevBMpdADWVWgGgZRO8YQxMxtr8d02KgW35hCUBKRspw2yEUspviEgKY2s0A3EkXJqzZQ46YNc1/7vZQg2gZlrg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734942635; c=relaxed/simple; bh=I22WxGzRgJLvDeIB27h8KOkWLz54eilPichDgTyoYzs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JIBLx+lIzE3b9IFZ5Rz+aEU8JmIvXLf6So7rjnFj0owgSX2Y8k/oD0xEK/B5K86sOSiOYoGfa6r8o3tTg/wn4WufqQmWW1OpeMJtp6qnWBHaYgGHbsNQEesqi8bBbqssy9TP5Pj+LQ9FpLlsNkauw3JF9FydAS7WVJcyZKvz0aU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=m/5vCp2D; 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="m/5vCp2D" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C6CCC4CED3; Mon, 23 Dec 2024 08:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734942633; bh=I22WxGzRgJLvDeIB27h8KOkWLz54eilPichDgTyoYzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m/5vCp2Df0wtH8Vfj3smDmfppcc6NTNNplguQuM1Bbs6JjQj4GxN3KK9T65dnqXz0 Zqq7Xy8zBnQ/mdo2r1GAMynmCJjNzyUvF++uBXyzeEAjUnnwIyOEfc89alCBfiIooe arsYcSy2o+L9SF5VExRvBsAOZtyhtfdIkJ5sXzAqRkyb2oTNFDCWD5EAYsxs2jRF7+ 0ujudHH8E19IoSM8mV9GV3MwWYH9zijJtRLKFmNU4a8oQ+87TA1WwyrjmIYNZn/VQA 2SJd8FTE336+IXdItOjEmVzXnKuA/iuh14Q3lYXAXrWHBBJz/jfZ2qZh9yWck9nBxv DOL9nbwZT8PGw== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 6/9] Squash to "selftests/bpf: Add bpf_red scheduler & test" Date: Mon, 23 Dec 2024 16:30:12 +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 interface get_send() instead of get_subflow(). Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/progs/mptcp_bpf_red.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_red.c b/tools/testing/selftests/bpf/progs/mptcp_bpf_red.c index cc0aab732fc4..627502e3c851 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_red.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_red.c @@ -17,7 +17,7 @@ void BPF_PROG(mptcp_sched_red_release, struct mptcp_sock *msk) } SEC("struct_ops") -int BPF_PROG(bpf_red_get_subflow, struct mptcp_sock *msk, +int BPF_PROG(bpf_red_get_send, struct mptcp_sock *msk, struct mptcp_sched_data *data) { for (int i = 0; i < data->subflows && i < MPTCP_SUBFLOWS_MAX; i++) { @@ -34,6 +34,6 @@ SEC(".struct_ops") struct mptcp_sched_ops red = { .init = (void *)mptcp_sched_red_init, .release = (void *)mptcp_sched_red_release, - .get_subflow = (void *)bpf_red_get_subflow, + .get_send = (void *)bpf_red_get_send, .name = "bpf_red", }; From patchwork Mon Dec 23 08:30:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13918603 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 9AEA264A for ; Mon, 23 Dec 2024 08:30:35 +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=1734942635; cv=none; b=C2US0SVEWvHZZ4/juA1viX/ZVG9Izo/85NuKjEFsDFj9UsTWjPpelrj4KWoGG+qBRnCkGEhFqlKRMGUSJpg5e4hW42viP+32EWOENzwve+Jzoc+3jxF5DOvgYxu+HzBUL/K6fFzpiqE+rhYQqMKH0Jwhlo95UYPo81TXXItCAE8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734942635; c=relaxed/simple; bh=txcXVQ1X6wdf7hLwaFIEoQz6R3N+BrHET3IpUn1wgbA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sNSUJgrzlxMq3g5HpxxDA2+dBXXzXSvlD7L8ZL4+98LK+CIPzpvroigs29DR9ZsrwkLhypcEa6lJeSmNTNbxX9zGWnSbri7OYlcppn4OyUpjbgDNSVyfNgfwfCiBSPFHq17uJsDb1qquH2r1nI2Z2JvpcOz0oBuMLgqgM70FMaY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=i6VKOIWn; 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="i6VKOIWn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E3AAC4CED6; Mon, 23 Dec 2024 08:30:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734942635; bh=txcXVQ1X6wdf7hLwaFIEoQz6R3N+BrHET3IpUn1wgbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i6VKOIWnGaH3fttg/6Pq9aqIrRrTTAFIPWT9hXNM6787yoCD0ZEXufs6El97MG5OE IU7fqLZIKzJIfgR15RgavEVSk/zRFr84nzUDCXor3QkVl/ce+t3K3CPlZqA2I6wz0d XNCZoBF44fmsJma5ReJSdEpKxueVCz4WsM5kesx6xuKOawnId+/K1mwTw8Kedm903u Gt2x4C4ccVFErwKzvFGr//oF37zxjkc0GYkN12ti+HcP3rxuCQd7CPEbNiV4lTEWVb 9aT0S7QfxkuuMr85G65rIhl9FKbM92WRqGyo9NbU2kmmflM14apE2Ct8fWAapMKz41 kNPdh4yCH2lFg== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 7/9] Squash to "selftests/bpf: Add bpf_burst scheduler & test" Date: Mon, 23 Dec 2024 16:30:13 +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 Split get_subflow() interface into two: get_send() and get_retrans(). Signed-off-by: Geliang Tang --- .../selftests/bpf/progs/mptcp_bpf_burst.c | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c b/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c index eb21119aa8f7..5743601df9dc 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c @@ -67,8 +67,9 @@ void BPF_PROG(mptcp_sched_burst_release, struct mptcp_sock *msk) { } -static int bpf_burst_get_send(struct mptcp_sock *msk, - struct mptcp_sched_data *data) +SEC("struct_ops") +int BPF_PROG(bpf_burst_get_send, struct mptcp_sock *msk, + struct mptcp_sched_data *data) { struct bpf_subflow_send_info send_info[SSK_MODE_MAX]; struct mptcp_subflow_context *subflow; @@ -141,8 +142,9 @@ static int bpf_burst_get_send(struct mptcp_sock *msk, return 0; } -static int bpf_burst_get_retrans(struct mptcp_sock *msk, - struct mptcp_sched_data *data) +SEC("struct_ops") +int BPF_PROG(bpf_burst_get_retrans, struct mptcp_sock *msk, + struct mptcp_sched_data *data) { int backup = MPTCP_SUBFLOWS_MAX, pick = MPTCP_SUBFLOWS_MAX, subflow_id; struct mptcp_subflow_context *subflow; @@ -189,19 +191,11 @@ static int bpf_burst_get_retrans(struct mptcp_sock *msk, return 0; } -SEC("struct_ops") -int BPF_PROG(bpf_burst_get_subflow, struct mptcp_sock *msk, - struct mptcp_sched_data *data) -{ - if (data->reinject) - return bpf_burst_get_retrans(msk, data); - return bpf_burst_get_send(msk, data); -} - SEC(".struct_ops") struct mptcp_sched_ops burst = { .init = (void *)mptcp_sched_burst_init, .release = (void *)mptcp_sched_burst_release, - .get_subflow = (void *)bpf_burst_get_subflow, + .get_send = (void *)bpf_burst_get_send, + .get_retrans = (void *)bpf_burst_get_retrans, .name = "bpf_burst", }; From patchwork Mon Dec 23 08:30:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13918604 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 6A7C113EFE3 for ; Mon, 23 Dec 2024 08:30:37 +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=1734942637; cv=none; b=FzplvGCMOyStU4JcRXOh8GHWHNGjxfAzhy2MfsqNS9H9MDD7+/bCfJWLEcc3YPyAZCT7J9THg3IS1z6Judzbl8l1MF/dMFIKiODSWAPpts7lfPcKVm9VLz7JzO7Zp47zzH4klG4dmYcVo1dDHikACigd4GbwrXjnPNVIuU09J10= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734942637; c=relaxed/simple; bh=LUQuTzxkBX5sfuJitn7NkP2npiQELMruqS5lyeJRIIo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MOYnnXh9JZkA5VOKcDxr5mO/Dz13qJR+1bRZl9h3SypDrpGp37GJICLMMbm95STY5GASjV2DJsBU97HMZjucAmdwWD1rIZCczzAwUKDNiRtJjcgwD5oduD2ae4hAfY6+GSBi7Xr0zVT8IDsqrA9MDK9TPppBh1iBia2QfPG8xXA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=o/zaZOqt; 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="o/zaZOqt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E717C4CED3; Mon, 23 Dec 2024 08:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734942637; bh=LUQuTzxkBX5sfuJitn7NkP2npiQELMruqS5lyeJRIIo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o/zaZOqts2PsxQCYvlfRBY8pv+NgO1LIVfhzAj9i9KdWrjF0sUkINYQ+PimETYhId DkeuZCLYccyXxADXFEXr5u2Cvec/7i6JnWZnNvr012pFiqrGfu6XHa+vqv1OURHUgj 6BBhnnwZ+jAAMBiEUxEqS/kHADIl1LdVy8n+qmxUznWrrxo347d3B3Nno8CCoHSoty IpoqMOky05wlWZCViifNR5Cq4xu8Q7otU3/tU/hZdN3V04eqruD0p+U2ITg+3nY+eQ V7ABsYLmrdpcLkj6LTnthgF33YSzPsoOUPaou1OSRqpPdjgkqdi02XvOR31Y6IxWaF +XbXWFDpgWOLA== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 8/9] Squash to "bpf: Export mptcp packet scheduler helpers" Date: Mon, 23 Dec 2024 16:30:14 +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 Set KF_SLEEPABLE flag for mptcp_pm_subflow_chk_stale. Signed-off-by: Geliang Tang --- net/mptcp/bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c index 8d4865177037..be222fa5f308 100644 --- a/net/mptcp/bpf.c +++ b/net/mptcp/bpf.c @@ -334,7 +334,7 @@ BTF_ID_FLAGS(func, mptcp_set_timeout) BTF_ID_FLAGS(func, mptcp_wnd_end) BTF_ID_FLAGS(func, tcp_stream_memory_free) BTF_ID_FLAGS(func, bpf_mptcp_subflow_queues_empty) -BTF_ID_FLAGS(func, mptcp_pm_subflow_chk_stale) +BTF_ID_FLAGS(func, mptcp_pm_subflow_chk_stale, KF_SLEEPABLE) BTF_KFUNCS_END(bpf_mptcp_sched_kfunc_ids) static const struct btf_kfunc_id_set bpf_mptcp_sched_kfunc_set = { From patchwork Mon Dec 23 08:30:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13918605 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 3F75738385 for ; Mon, 23 Dec 2024 08:30: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=1734942639; cv=none; b=VUocqEXuTogtVqwSDmOQbNKiWOn/2MjlO+fiJruJmVK5uNzZtbVJlyIALf6KpSIR3T/zNVNeHA27NhRrQgfDJgkvtv2vYXSMDnsdLwRmm135QnZ0IXGdjdUxWj1a/RyOpdtP6E4w5pyFPRB6L7eZE1OxtW0vq+OWyTJa7ywSnMw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734942639; c=relaxed/simple; bh=DOV5jlc/2tbtZAr0I6BJys/FNUb2KWhy4UROIn3RVIg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ey8Z4bKovn6EqrXrlg232IKE3O8Y+CAslwME9nkZsqWmM35H3UXxErGzPm8DQgBt9N8+rKsqXEN0gD0kMJIJ7JoKjzoAmLWKe+MKfrlxlIcbQawBdgAPcIGF3A8sFZO+cMFJN6Ob573ovSIKxuX5SyKrIiKwNkoIjPAuL02wiCw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gjzmSZRe; 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="gjzmSZRe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB773C4CEDC; Mon, 23 Dec 2024 08:30:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734942639; bh=DOV5jlc/2tbtZAr0I6BJys/FNUb2KWhy4UROIn3RVIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gjzmSZRenNxZcNiepeo7sS42H99u/oQqwiJBrX1gsfG5spDDu8M0FIBZspJwdK2U0 fVQG6dXjO8Nmgj1/ur998F3HGu+SZaHEe4P0T7YF3yucxDyXBVxzjxyzJAETDQsXVk jX9FH8WW8iGMTUmxlOdQTocc6Q2fs+naxL253NZE95EcMaDY/XUy0clyVwe4k8wm0N 2TAYL0nTnQQAjec8J4KFR9RFrwkawkOcFw4HD5Q1U63jdt23BU5dAq8N4R8GnaG47C WLg/5SN5yp1vargRnsVdd8R8eQd6pzF5SbdlmIfzL0n4GU9TtEcB5VxngDJjndrfQI s11zDXuIrJLYQ== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 9/9] Squash to "selftests/bpf: Add bpf_burst scheduler & test" Date: Mon, 23 Dec 2024 16:30:15 +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 Set BPF_F_SLEEPABLE flags for bpf_burst_get_retrans. Signed-off-by: Geliang Tang --- tools/testing/selftests/bpf/prog_tests/mptcp.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c index 1d68bbda3370..d7a640dce7da 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -726,12 +726,22 @@ static void test_red(void) static void test_burst(void) { struct mptcp_bpf_burst *skel; + int err; - skel = mptcp_bpf_burst__open_and_load(); - if (!ASSERT_OK_PTR(skel, "open_and_load: burst")) + skel = mptcp_bpf_burst__open(); + if (!ASSERT_OK_PTR(skel, "open: burst")) return; + err = bpf_program__set_flags(skel->progs.bpf_burst_get_retrans, + BPF_F_SLEEPABLE); + if (!ASSERT_OK(err, "set sleepable flags")) + goto skel_destroy; + + if (!ASSERT_OK(mptcp_bpf_burst__load(skel), "load: burst")) + goto skel_destroy; + test_bpf_sched(skel->obj, "burst", WITH_DATA, WITH_DATA); +skel_destroy: mptcp_bpf_burst__destroy(skel); }