From nobody Thu Nov 21 11:56:33 2024 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 DCB3A230998 for ; Thu, 21 Nov 2024 02:45:57 +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=1732157157; cv=none; b=bD15ijc9L+l+hlk/Us4sBxMUceWtpAW0/5nXsZQElWfuEaQ16z9B9WUSBYS//LGHuTVJF8hnP5wqLw961c4sa5enKh/kSNIJuAcfJyJkE7iP0DeU4oQfJenXO7O/CoU1lqp1obgVlrTQtsfY4NDKobEqJ7lt42twsTS7fbFR+y0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732157157; c=relaxed/simple; bh=G9iZystPsNcfAOCqxBnP/CMJaZbsw80HcpJNOP2iml8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EhbIC12BdXalPoA8OJgp1GcSSPwsV7QjNawX/NkgQgNvpqyFEOcG6wF7zD+O183fg0GIVyEwxlmGy6gdjoeWYtHqLE5CXncGWzWpEZ+FZw39YQFkc6mvhYzHqk05mW2me6Cs3p6paLXpc2YAAinPrt9XRSXAjxdtNOJOViVWM7c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oGVw67Rs; 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="oGVw67Rs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FEF4C4CECD; Thu, 21 Nov 2024 02:45:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732157157; bh=G9iZystPsNcfAOCqxBnP/CMJaZbsw80HcpJNOP2iml8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oGVw67Rsby2+gw3+8qxYlRKtOWXiKPpbTfhJLginSLLBWMYjK1zbfa4nAP33gBXFN ITNd1lV/TQUTaaVGXygJSw364JyCoKdjKxCr4lE3PWhTaqYxfC7kvNmgMlGg7nIRCO cRWP5SwfZRGBCnjr5HAqQkXskJvx8XYqYtsDpKWu/XDxqYdqrgMLMzgVpLqY1vy3pe 9W+sPDDy1QUjsVZOSVhp3qGgEzDXqtNuaMFXbyHyhqSOPeSPyzWS731z/rM+BG8ppZ L32x7T1G3AHDYkW3CEQLp8du4u5oDA2GV1FFWYVtm64n3z3FnuYAoAb2H7mTtfnqGg 9ZsneS8N9AM6g== From: Geliang Tang To: mptcp@lists.linux.dev Cc: baohua@kernel.org, Geliang Tang Subject: [PATCH mptcp-next 1/8] mptcp: split get_subflow interface into two Date: Thu, 21 Nov 2024 10:45:40 +0800 Message-ID: <5887e174fc52db76e9ce6a4683a694a693f8567a.1732153672.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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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/bpf.c | 11 +++++++++-- net/mptcp/sched.c | 33 ++++++++++++++++++++++----------- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/include/net/mptcp.h b/include/net/mptcp.h index 814b5f2e3ed5..2c85ca92bb1c 100644 --- a/include/net/mptcp.h +++ b/include/net/mptcp.h @@ -103,13 +103,14 @@ struct mptcp_out_options { #define MPTCP_SUBFLOWS_MAX 8 =20 struct mptcp_sched_data { - bool reinject; u8 subflows; struct mptcp_subflow_context *contexts[MPTCP_SUBFLOWS_MAX]; }; =20 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); =20 char name[MPTCP_SCHED_NAME_MAX]; diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c index e9db856972cb..ab1de189ba4b 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; } =20 -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) } =20 static struct mptcp_sched_ops __bpf_mptcp_sched_ops =3D { - .get_subflow =3D __bpf_mptcp_sched_get_subflow, + .get_send =3D __bpf_mptcp_sched_get_send, + .get_retrans =3D __bpf_mptcp_sched_get_retrans, .init =3D __bpf_mptcp_sched_init, .release =3D __bpf_mptcp_sched_release, }; diff --git a/net/mptcp/sched.c b/net/mptcp/sched.c index 6da60e35932f..7560693e5b7a 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); =20 -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 =3D 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; =20 - ssk =3D data->reinject ? mptcp_subflow_get_retrans(msk) : - mptcp_subflow_get_send(msk); + ssk =3D mptcp_subflow_get_retrans(msk); if (!ssk) return -EINVAL; =20 @@ -31,7 +43,8 @@ static int mptcp_sched_default_get_subflow(struct mptcp_s= ock *msk, } =20 static struct mptcp_sched_ops mptcp_sched_default =3D { - .get_subflow =3D mptcp_sched_default_get_subflow, + .get_send =3D mptcp_sched_default_get_send, + .get_retrans =3D mptcp_sched_default_get_retrans, .name =3D "default", .owner =3D THIS_MODULE, }; @@ -73,7 +86,7 @@ void mptcp_get_available_schedulers(char *buf, size_t max= len) =20 int mptcp_register_scheduler(struct mptcp_sched_ops *sched) { - if (!sched->get_subflow) + if (!sched->get_send || !sched->get_retrans) return -EINVAL; =20 spin_lock(&mptcp_sched_list_lock); @@ -184,11 +197,10 @@ int mptcp_sched_get_send(struct mptcp_sock *msk) return 0; } =20 - data.reinject =3D false; if (msk->sched =3D=3D &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); } =20 int mptcp_sched_get_retrans(struct mptcp_sock *msk) @@ -207,9 +219,8 @@ int mptcp_sched_get_retrans(struct mptcp_sock *msk) return 0; } =20 - data.reinject =3D true; if (msk->sched =3D=3D &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); + return msk->sched->get_retrans(msk, &data); } --=20 2.43.0 From nobody Thu Nov 21 11:56:33 2024 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 0AB4413AA38 for ; Thu, 21 Nov 2024 02:45:59 +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=1732157160; cv=none; b=FLtfOWFhdyDF4oK8ZNI8n4hqdV46sGqNUENVCW+gcd2K5+CEB3CXIRArFMYPZiIF487SW6vp0ydkcPJGwvI6UHCnrK+vli/O0B01LCJQ0Dph1i3c7fKFN68s/vAr6F8iPPvMsOVVCevl0C1iqyXjwLF3uoMK6f6o6NFhSsJmGkw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732157160; c=relaxed/simple; bh=uhAM2fpJLIUWjiXCtbWvVgvwvbT7z6XZn4ZHWMdpioo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GX97jeFOOxP3K7UskAlByJf0QqAqQTfCDGd55wp3be1seE53gFP/viFxxMsJsmLbKrGndyb81hEw0ux2Vp+btZ9mPFod/W1U43ZV+mBp6Md1mlfGgjnnPi1bDyRuUkxME/sV6zqrFVa6I4vxNJMX6DY0rTLyrA/OL/hhMnwMHg4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gX/opddV; 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="gX/opddV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15C92C4CECD; Thu, 21 Nov 2024 02:45:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732157159; bh=uhAM2fpJLIUWjiXCtbWvVgvwvbT7z6XZn4ZHWMdpioo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gX/opddV9dKLT12BJAbbr6TFMXu+e53sQ6RWVa9SC/f0Fslaf3H9ioh1WsNvDXgaF OT54l9ofE8Gn49HzTmlPNzHcQB+xgRlPVsAHuKYHyMyydhOUzFAlwzZIe0ADyweAot 0jq62lsGC2yWcOTQ6sHGHT8acc2v/uMIJR95dpRkwWPFsCJv528ikMFn85NiUfK2M/ DIQIXN1jE/uiaYYdCGmpPXpm+PRUR8+jbNbwwokZ2i5dEBHvvv80a1DOW+IUSQ2kPy xJPKNAKg4XOoBpoHLB0LGjHzmDE3hEpWEVdnzGpaQE22SPRfsWECsXd3MotHJQD+f4 qVvYM4tX23d7g== From: Geliang Tang To: mptcp@lists.linux.dev Cc: baohua@kernel.org, Geliang Tang Subject: [PATCH mptcp-next 2/8] Squash to "selftests/bpf: Add bpf_first scheduler & test" Date: Thu, 21 Nov 2024 10:45:41 +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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang Split get_subflow() interface into two: get_send() and get_retrans(). Signed-off-by: Geliang Tang --- .../selftests/bpf/progs/mptcp_bpf_first.c | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_first.c b/tools/te= sting/selftests/bpf/progs/mptcp_bpf_first.c index d57399b407a7..36bf9adffb2c 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_first.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_first.c @@ -16,18 +16,32 @@ void BPF_PROG(mptcp_sched_first_release, struct mptcp_s= ock *msk) { } =20 -SEC("struct_ops") -int BPF_PROG(bpf_first_get_subflow, struct mptcp_sock *msk, - struct mptcp_sched_data *data) +static int bpf_first_get_subflow(struct mptcp_sock *msk, + struct mptcp_sched_data *data) { mptcp_subflow_set_scheduled(bpf_mptcp_subflow_ctx_by_pos(data, 0), true); return 0; } =20 -SEC(".struct_ops") +SEC("struct_ops") +int BPF_PROG(bpf_first_get_send, struct mptcp_sock *msk, + struct mptcp_sched_data *data) +{ + return bpf_first_get_subflow(msk, data); +} + +SEC("struct_ops") +int BPF_PROG(bpf_first_get_retrans, struct mptcp_sock *msk, + struct mptcp_sched_data *data) +{ + return bpf_first_get_subflow(msk, data); +} + +SEC(".struct_ops.link") struct mptcp_sched_ops first =3D { .init =3D (void *)mptcp_sched_first_init, .release =3D (void *)mptcp_sched_first_release, - .get_subflow =3D (void *)bpf_first_get_subflow, + .get_send =3D (void *)bpf_first_get_send, + .get_retrans =3D (void *)bpf_first_get_retrans, .name =3D "bpf_first", }; --=20 2.43.0 From nobody Thu Nov 21 11:56:33 2024 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 5455C230998 for ; Thu, 21 Nov 2024 02:46:01 +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=1732157162; cv=none; b=ogy51FIu9JfFDREMh/gjcGQY86Q4dPApQ3e5+QxBIH9BD5/C0h7jVMXixMMVEaBU+oTPKCVOCScwmr1VyEwXLKffnAm7gOV2tjNWDLOSNkb7p7IDcbY/YzsEP679h72vCBUVLpJrk1lnQk5+YEeS63Tj7BT+6JNaaMR0PuAmURU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732157162; c=relaxed/simple; bh=xBQau2dB3ZqMsch50kW/RVprbPHbSyvtjxRPMjGe6zc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LHpC9P7ZEDVQiVqvT8la/5o2qKHdACmayBzrXj++tQkXCvk19+P/MmqFdpCPKvDaQMQqIaqTI9RuBRrYNy3c5lJa64t7UWJy6qhuucQoU7XhTfAfsefui91ThiMkNdK6sA/FhGuwUpPbqEjoXITCxdZLMnroSpi0whok+xldwa0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=T7KIgsSI; 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="T7KIgsSI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FB10C4CED3; Thu, 21 Nov 2024 02:45:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732157161; bh=xBQau2dB3ZqMsch50kW/RVprbPHbSyvtjxRPMjGe6zc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T7KIgsSI5v0dU3j6Y1FNR/NMcdHmpcT1zmS4QQAfwJh78ZRmFvYUd2BlPsNwZ+4ia 9wvaIyG3h4VoUPtC2jLP+0Pmo8Okg0GW2rLlX2S2TPmNGomcar6RwMZAmZopBci0Z0 ZJ24e+mkb4IZQGyjhmo8WgUDJP6VJEvZmKNGoryaPC4BMiz7TVuSodi91Kc61DspWI APwDUgg7so4fykCXIkSqGam1wTmJ/gIOOq4BxecnCkJoBTkdYUbVcwqo1ERje2JOoH JeuhKobPPrAUTw8+TP9ZVdYuhXmhVbcmHa1S/wrgK/VqAvWbOsShgIAYj0zQq8f9Fs D1tfeUmRrq5VA== From: Geliang Tang To: mptcp@lists.linux.dev Cc: baohua@kernel.org, Geliang Tang Subject: [PATCH mptcp-next 3/8] Squash to "selftests/bpf: Add bpf_bkup scheduler & test" Date: Thu, 21 Nov 2024 10:45:42 +0800 Message-ID: <2dca04396fe589024c2f373d4531f0d1a50c7d98.1732153672.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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang Split get_subflow() interface into two: get_send() and get_retrans(). Signed-off-by: Geliang Tang --- .../selftests/bpf/progs/mptcp_bpf_bkup.c | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_bkup.c b/tools/tes= ting/selftests/bpf/progs/mptcp_bpf_bkup.c index 296f0318d843..41e6639253a4 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_bkup.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_bkup.c @@ -16,9 +16,8 @@ void BPF_PROG(mptcp_sched_bkup_release, struct mptcp_sock= *msk) { } =20 -SEC("struct_ops") -int BPF_PROG(bpf_bkup_get_subflow, struct mptcp_sock *msk, - struct mptcp_sched_data *data) +static int bpf_bkup_get_subflow(struct mptcp_sock *msk, + struct mptcp_sched_data *data) { int nr =3D -1; =20 @@ -43,10 +42,25 @@ int BPF_PROG(bpf_bkup_get_subflow, struct mptcp_sock *m= sk, return 0; } =20 -SEC(".struct_ops") +SEC("struct_ops") +int BPF_PROG(bpf_bkup_get_send, struct mptcp_sock *msk, + struct mptcp_sched_data *data) +{ + return bpf_bkup_get_subflow(msk, data); +} + +SEC("struct_ops") +int BPF_PROG(bpf_bkup_get_retrans, struct mptcp_sock *msk, + struct mptcp_sched_data *data) +{ + return bpf_bkup_get_subflow(msk, data); +} + +SEC(".struct_ops.link") struct mptcp_sched_ops bkup =3D { .init =3D (void *)mptcp_sched_bkup_init, .release =3D (void *)mptcp_sched_bkup_release, - .get_subflow =3D (void *)bpf_bkup_get_subflow, + .get_send =3D (void *)bpf_bkup_get_send, + .get_retrans =3D (void *)bpf_bkup_get_retrans, .name =3D "bpf_bkup", }; --=20 2.43.0 From nobody Thu Nov 21 11:56:33 2024 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 56D6770811 for ; Thu, 21 Nov 2024 02:46:03 +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=1732157164; cv=none; b=LF9rVn+Ckcs1jn6c+i2JeUDLaE1wTRzcM0ww4CB0YTTJrTOsS/3/oeL/7yr1zlnBQoeu/xPniiA+dG6AE8NLankldBv5GxOGVPXjedRia4PrWegu5Lj4TM9gkfWhykTmm7ty5fPsEooLUCoKpjCe+XhAzKgfhsJSMVfc5IOqvLw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732157164; c=relaxed/simple; bh=AeWZtJ5U7Ugzbhy2UmQVa5y4LFmY0aV3WatqrX5zEsc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JWoU656MAiSiYtx4PxQ8p8rWiLqGOPNjUrUbH9PggAhtSAgXVV2YrJG9dK7q/b9em9MYA2K34Nt0VBDi6ooKWUKWrI60fCzNN1Ew0Sw+CkxPOl5PY8FdzTnLFEHrytNj9RwfeVpvFr1bk8Ll2LgBJR1Z5s/2746QYgpxk1th6qQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MhDsxwyO; 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="MhDsxwyO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55EF8C4CECD; Thu, 21 Nov 2024 02:46:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732157163; bh=AeWZtJ5U7Ugzbhy2UmQVa5y4LFmY0aV3WatqrX5zEsc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MhDsxwyO8v9XUhuu62CH3sJ3hUp2gME7jYXoHFQ46iRu8lzwF5UhP7fJQWgiLPWgk 1xK3KuqkvE4rbasyq+OOHW3hm/c/orbivLiB0fYchE99Ya3g2yHr4ATET0rHFygSj8 H2ZvPAoGCyfC2mBZjKwmvIM+KHw2cHoNI68WrlPpemI9TVTcrpaac9jM/MQekehQuR L+7EQNhGhR+8wDZewR4dN/RAssZYByHlrJO6r8B+iFhTazlE6Ewo533M1Jqc14UJsh Kxm9qYD8ukfD4DxoWKg8uKFKrmxsGZZN2JGm89WUId0Q1yQV7I8BY4F/ZbEvGuNInh Q67hMPCHsyLpA== From: Geliang Tang To: mptcp@lists.linux.dev Cc: baohua@kernel.org, Geliang Tang Subject: [PATCH mptcp-next 4/8] Squash to "selftests/bpf: Add bpf_rr scheduler & test" Date: Thu, 21 Nov 2024 10:45:43 +0800 Message-ID: <9f2ffc12379e38ec5f9b5dde113b9cbd57855f0d.1732153672.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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang Split get_subflow() interface into two: get_send() and get_retrans(). Signed-off-by: Geliang Tang --- .../selftests/bpf/progs/mptcp_bpf_rr.c | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c b/tools/testi= ng/selftests/bpf/progs/mptcp_bpf_rr.c index 638ea6aa63b7..ec7853a9716c 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c @@ -30,9 +30,8 @@ void BPF_PROG(mptcp_sched_rr_release, struct mptcp_sock *= msk) bpf_sk_storage_delete(&mptcp_rr_map, msk); } =20 -SEC("struct_ops") -int BPF_PROG(bpf_rr_get_subflow, struct mptcp_sock *msk, - struct mptcp_sched_data *data) +static int bpf_rr_get_subflow(struct mptcp_sock *msk, + struct mptcp_sched_data *data) { struct mptcp_subflow_context *subflow; struct mptcp_rr_storage *ptr; @@ -69,10 +68,25 @@ int BPF_PROG(bpf_rr_get_subflow, struct mptcp_sock *msk, return 0; } =20 -SEC(".struct_ops") +SEC("struct_ops") +int BPF_PROG(bpf_rr_get_send, struct mptcp_sock *msk, + struct mptcp_sched_data *data) +{ + return bpf_rr_get_subflow(msk, data); +} + +SEC("struct_ops") +int BPF_PROG(bpf_rr_get_retrans, struct mptcp_sock *msk, + struct mptcp_sched_data *data) +{ + return bpf_rr_get_subflow(msk, data); +} + +SEC(".struct_ops.link") struct mptcp_sched_ops rr =3D { .init =3D (void *)mptcp_sched_rr_init, .release =3D (void *)mptcp_sched_rr_release, - .get_subflow =3D (void *)bpf_rr_get_subflow, + .get_send =3D (void *)bpf_rr_get_send, + .get_retrans =3D (void *)bpf_rr_get_retrans, .name =3D "bpf_rr", }; --=20 2.43.0 From nobody Thu Nov 21 11:56:33 2024 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 5889E230998 for ; Thu, 21 Nov 2024 02:46:06 +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=1732157166; cv=none; b=vEmjOztHyq2k43ExYbLxrLwbV+43DTfGGCPlf6l+5ykM6mVvNL48+XKOxvxLig0cTt5JhkHyfZX9tc5P1pNEeh1q7iyEsLY9MhAMrU3Iwa0mIdsmzPMYsofi8jgtj5Oiu8+nxZLVH0y/Uz1rjLBt7Bo+/OCHIgPkw8xBOJ9QhmU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732157166; c=relaxed/simple; bh=La87yMilvBk53aeE0uYVXlx2Z3/hHXb1zguOywLxoUo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RPiiCHc1J+Z7HzaAAiqyWHrQ9hakZvwEZAzkOMF934hf+Z5Aa6E+ceUytIaU32ruYr+9NFDA9PmekQNuwHyhGrn67aCa/2ZiY4mkwGLRKSfB+ixj733Q4upFy33vOQkTJN0kr67mSkRXD0vrDZ3a0DYQV/MdukKajNwr+EqVOnc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nBDK783x; 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="nBDK783x" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 797E5C4CECE; Thu, 21 Nov 2024 02:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732157166; bh=La87yMilvBk53aeE0uYVXlx2Z3/hHXb1zguOywLxoUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nBDK783xXDH9g3fK7kag7vrC5nly2JSaCAepfznGrN6J0LuceCilBxQ3gP7Det1OE TDNrN76u8m64t8qr0Lvl5r0drEhZjlj/S06vOyq83HbvuOpfWBT5h2bjw6JjYr5HjU Lrxr/jTYJSJ2FEUja8OpWfK04PNMube8wPtzhavu9dxn4FsKuX0oBYr3ICuiiu6B+W nxvK3zhguL9xr4DTablE6NlogYFzi8tRN66dn02CnDq0YE+uh28IU5oHYwedEkeGbh /diqUQ++8eZAlln8QR7PP8yS3b7Z4j78celMRh2xrBfl1IQdwIu9ubjDs6A3c8Ng7x eYf9n99+xWfzw== From: Geliang Tang To: mptcp@lists.linux.dev Cc: baohua@kernel.org, Geliang Tang Subject: [PATCH mptcp-next 5/8] Squash to "selftests/bpf: Add bpf_red scheduler & test" Date: Thu, 21 Nov 2024 10:45:44 +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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang Split get_subflow() interface into two: get_send() and get_retrans(). Signed-off-by: Geliang Tang --- .../selftests/bpf/progs/mptcp_bpf_red.c | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_red.c b/tools/test= ing/selftests/bpf/progs/mptcp_bpf_red.c index cc0aab732fc4..acd0b03378f2 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_red.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_red.c @@ -16,9 +16,8 @@ void BPF_PROG(mptcp_sched_red_release, struct mptcp_sock = *msk) { } =20 -SEC("struct_ops") -int BPF_PROG(bpf_red_get_subflow, struct mptcp_sock *msk, - struct mptcp_sched_data *data) +static int bpf_red_get_subflow(struct mptcp_sock *msk, + struct mptcp_sched_data *data) { for (int i =3D 0; i < data->subflows && i < MPTCP_SUBFLOWS_MAX; i++) { if (!bpf_mptcp_subflow_ctx_by_pos(data, i)) @@ -30,10 +29,25 @@ int BPF_PROG(bpf_red_get_subflow, struct mptcp_sock *ms= k, return 0; } =20 -SEC(".struct_ops") +SEC("struct_ops") +int BPF_PROG(bpf_red_get_send, struct mptcp_sock *msk, + struct mptcp_sched_data *data) +{ + return bpf_red_get_subflow(msk, data); +} + +SEC("struct_ops") +int BPF_PROG(bpf_red_get_retrans, struct mptcp_sock *msk, + struct mptcp_sched_data *data) +{ + return bpf_red_get_subflow(msk, data); +} + +SEC(".struct_ops.link") struct mptcp_sched_ops red =3D { .init =3D (void *)mptcp_sched_red_init, .release =3D (void *)mptcp_sched_red_release, - .get_subflow =3D (void *)bpf_red_get_subflow, + .get_send =3D (void *)bpf_red_get_send, + .get_retrans =3D (void *)bpf_red_get_retrans, .name =3D "bpf_red", }; --=20 2.43.0 From nobody Thu Nov 21 11:56:33 2024 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 8FF7470811 for ; Thu, 21 Nov 2024 02:46:08 +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=1732157168; cv=none; b=BnHLq3h3YQspeJ6P44msBLRLiF5SHgb1CJJQSNGP3IRQ3Aw+1XUNCkrRhDJXeaMm5VWw6DINWg0QJYDm8nTTbGSKKotABuguPCtjmaLx8BxPcIELT6tqxgLplADzyQBlZfrE8nqWwv0d90yG1ZsXV+6iZ1sPD7BAVQUZBGb489U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732157168; c=relaxed/simple; bh=Yueh5AaWE3t1dM8SXP/W1ewFHErqQKtbSEylD6STjxc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ebYI5/qeas2KG2lXRP+fMK/rs5Fdb3XJDCvo26/dWJ1sPkRyLJZGQPMli7cfxl0WTgnGEsOs/zqiBIwD8nEWjgGB+upqpxFDvqagoBTC/DL2bSpIC/DXBy/Iq1471e7Tot4gnM2TqXyxR7J+IGLUbemcdnrt5fGiHmAPmDTtn9Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Tjtw/wSS; 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="Tjtw/wSS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DF9BC4CECD; Thu, 21 Nov 2024 02:46:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732157168; bh=Yueh5AaWE3t1dM8SXP/W1ewFHErqQKtbSEylD6STjxc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tjtw/wSSI0dMaWJ9ild0hdTIJ2pXm1BOvPi5jVbnHDJc9lPpO2LpsiuVf5Zh2xzUX qpDcpDxxyOEXUqtlRtRtW9XvfaByA3k/8VOzY/6L/LK0ggy/KNrhvSMd5CMSQGuUfn aDfmxf6qqOleFhkxEPQVj5y30biaR6iNvWgoBvnZ3IzZ4Ti38DMjBF9N3WZlx8h+D4 ax39xnEXczXt4l4PtWpCKURTpgIXTyUOyBR2vZVFgyKEn7/gUsNSbVwpX+DbuN6wHO ElswIUuZ1IjhIg42mEUqRSZFzGAjxVtUFfKXTNfZoPqxtoDwKqkaWMFUvH0AVFEdxX w/GpNIKRsHedA== From: Geliang Tang To: mptcp@lists.linux.dev Cc: baohua@kernel.org, Geliang Tang Subject: [PATCH mptcp-next 6/8] Squash to "selftests/bpf: Add bpf_burst scheduler & test" Date: Thu, 21 Nov 2024 10:45:45 +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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 | 32 ++++++++----------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c b/tools/te= sting/selftests/bpf/progs/mptcp_bpf_burst.c index eb21119aa8f7..2785ccbc3807 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_burst.c @@ -9,6 +9,10 @@ char _license[] SEC("license") =3D "GPL"; =20 #define MPTCP_SEND_BURST_SIZE 65428 =20 +#define SSK_MODE_ACTIVE 0 +#define SSK_MODE_BACKUP 1 +#define SSK_MODE_MAX 2 + #define min(a, b) ((a) < (b) ? (a) : (b)) =20 struct bpf_subflow_send_info { @@ -23,10 +27,6 @@ extern bool tcp_stream_memory_free(const struct sock *sk= , int wake) __ksym; extern bool bpf_mptcp_subflow_queues_empty(struct sock *sk) __ksym; extern void mptcp_pm_subflow_chk_stale(const struct mptcp_sock *msk, struc= t sock *ssk) __ksym; =20 -#define SSK_MODE_ACTIVE 0 -#define SSK_MODE_BACKUP 1 -#define SSK_MODE_MAX 2 - static __always_inline __u64 div_u64(__u64 dividend, __u32 divisor) { return dividend / divisor; @@ -67,8 +67,9 @@ void BPF_PROG(mptcp_sched_burst_release, struct mptcp_soc= k *msk) { } =20 -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; } =20 -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 =3D MPTCP_SUBFLOWS_MAX, pick =3D MPTCP_SUBFLOWS_MAX, subflow_i= d; struct mptcp_subflow_context *subflow; @@ -189,19 +191,11 @@ static int bpf_burst_get_retrans(struct mptcp_sock *m= sk, return 0; } =20 -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") +SEC(".struct_ops.link") struct mptcp_sched_ops burst =3D { .init =3D (void *)mptcp_sched_burst_init, .release =3D (void *)mptcp_sched_burst_release, - .get_subflow =3D (void *)bpf_burst_get_subflow, + .get_send =3D (void *)bpf_burst_get_send, + .get_retrans =3D (void *)bpf_burst_get_retrans, .name =3D "bpf_burst", }; --=20 2.43.0 From nobody Thu Nov 21 11:56:33 2024 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 B6D6270811 for ; Thu, 21 Nov 2024 02:46:10 +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=1732157170; cv=none; b=SCbTUksgtglABKnVybJ7L/ppDlcL2geABp90boxYXzCW8WPR7CZndHV3JwI+YSsPva7cMNGix/+CJ3YwyF6BoNAp8dEU6Oib+wu93ouf8rVPPPPzyxCnTFqkxEU2ZmZ0j6A18SV3uTKY/GCbqoPrUfCcsz7GIOTj7a5C4grVEY4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732157170; c=relaxed/simple; bh=A1iLh4aSCA8bGIG5PLWjdNZCaBIqRTbyK6HDgi5vfNg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p0o43oKGvGLdP/bkH6G1JSK/yqZ8J33oQ1qCQWBG5P5r4cvWjmhUbvVyNwoCgMQU0L3WEJqrwiVmYkF318ieDwCNhIUeHz6OYd93M6P1kfYZIak7gCLtKndRaimJmQi3PZmVrmo4BgWjJUN9ETZS/z7gMhhUltZZWPulUH4BQzc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EORtkCod; 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="EORtkCod" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2DBAC4CECD; Thu, 21 Nov 2024 02:46:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732157170; bh=A1iLh4aSCA8bGIG5PLWjdNZCaBIqRTbyK6HDgi5vfNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EORtkCodBzaiFD1OKUdUqhdYziAqNg/tPGyHFrAY/hMMGNJyqnKQg8lFPZ8TpAnaQ bl5HhB4BVu1cZZEfLhnM5nv38aoATrkrDhNKW/8i2Mr8QKCOEt7AOr3gB9rXCXsGaY UL9UpswgQ/CYOn6NA4/rgYx2MCh9fdwWdat7pa4wAByzraWQMdH9FEexZzVUMVFcjO VGeRQcr4d2X0/V4oJX4tx0vXv5+q4ALJVKJYV4NGVlA8cT89eclRxgB8ZQf6m4jRhj daIE7LPahLPMD+E4ZOlXTYTIhi9SELp/iYUeKiDZ46YifD0bDuFFVgv81HvqzC7oD6 Y4GOliUWnLTDQ== From: Geliang Tang To: mptcp@lists.linux.dev Cc: baohua@kernel.org, Geliang Tang Subject: [PATCH mptcp-next 7/8] Squash to "bpf: Export mptcp packet scheduler helpers" Date: Thu, 21 Nov 2024 10:45:46 +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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 ab1de189ba4b..a6cf4d1a48a9 100644 --- a/net/mptcp/bpf.c +++ b/net/mptcp/bpf.c @@ -329,7 +329,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) =20 static const struct btf_kfunc_id_set bpf_mptcp_sched_kfunc_set =3D { --=20 2.43.0 From nobody Thu Nov 21 11:56:33 2024 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 EBF431292CE for ; Thu, 21 Nov 2024 02: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=1732157173; cv=none; b=J5KQ//8AGzPmkjhSVutckOnK5eJ20rCOlmaqVRXbcg0i7CupIxSzhLLbjLvd2q96M2KveXLO2MwtmWtwnG5ZnnGNYN1tuA7yufr39OSLqy8gc4kSV7Ybg+ltxaYBy/WORwa8T7CSm6ROmEJhhP4ncqrPsp79rvMJZufurI7Lelc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732157173; c=relaxed/simple; bh=5uEXXgeIwPZVlEiJnHGp+xETFVnXEEebqDugI0rqlBU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HdNPErZ23Z/ENbM5jPuoPLJCHQDR0GigY+2LAU7f9opk94K62Ozr9RgeePzxJotvYNNahWndGJdQD3z8GE1uDZlka78ivrwawMrCjcjDelWwUm4PlaO/dxYKYerCWJXTvYBX1OLDf+IPTtcAuiB6TCC7+M4H6dDMJLVq7w6z89k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NkWQsF8X; 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="NkWQsF8X" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7856C4CECD; Thu, 21 Nov 2024 02:46:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732157172; bh=5uEXXgeIwPZVlEiJnHGp+xETFVnXEEebqDugI0rqlBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NkWQsF8XGjDdsAYwPCuYE/MX5ey/MYYxcaqzPvkKvqqTd7HWT2M8WHOfEUTrJ3wqp MKPbIKmwLEYl0da4os0Lb85DeRAlE33NAqSW1N73In2Oaq8t49A4RAK8pGL+qSIUo2 6fZ0EwTdtru9NqGTYNZiZBvZw4LPrZZPxfnkqbGRqNZ7QJS0f5M7UsMRCB6eOrQTCp wweS1jSDzbff/8s8NCGJk7BIgVvvaCrUvkOs6XLqB7XlOLgBv85DxcSj+Pf7KaG3MO fpbVNFhVBhbzcd9Xi4E5BpR/VmgvT9ed/OsmPsWvN9JYNGErE1ey2obv+khHeyg0mU +qMxq003mU8Iw== From: Geliang Tang To: mptcp@lists.linux.dev Cc: baohua@kernel.org, Geliang Tang Subject: [PATCH mptcp-next 8/8] Squash to "selftests/bpf: Add bpf_burst scheduler & test" Date: Thu, 21 Nov 2024 10:45:47 +0800 Message-ID: <3cfad7412c5d2fc439614357519855887a638ec6.1732153672.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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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; =20 - skel =3D mptcp_bpf_burst__open_and_load(); - if (!ASSERT_OK_PTR(skel, "open_and_load: burst")) + skel =3D mptcp_bpf_burst__open(); + if (!ASSERT_OK_PTR(skel, "open: burst")) return; =20 + err =3D 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); } =20 --=20 2.43.0