[PATCH mptcp-next] Squash to "bpf: Add bpf_mptcp_sched_ops"

Geliang Tang posted 1 patch 1 year, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/9ab93a02e7bf2ea1b2cfd40ce9e2001970d2e890.1656586148.git.geliang.tang@suse.com
Maintainers: Daniel Borkmann <daniel@iogearbox.net>, Mat Martineau <mathew.j.martineau@linux.intel.com>, Yonghong Song <yhs@fb.com>, Jakub Kicinski <kuba@kernel.org>, Eric Dumazet <edumazet@google.com>, Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>, "David S. Miller" <davem@davemloft.net>, Matthieu Baerts <matthieu.baerts@tessares.net>, KP Singh <kpsingh@kernel.org>, Alexei Starovoitov <ast@kernel.org>, Andrii Nakryiko <andrii@kernel.org>, John Fastabend <john.fastabend@gmail.com>, Paolo Abeni <pabeni@redhat.com>
There is a newer version of this series
net/mptcp/bpf.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
[PATCH mptcp-next] Squash to "bpf: Add bpf_mptcp_sched_ops"
Posted by Geliang Tang 1 year, 10 months ago
Rename optional_ops to optional_sched_ops, rename is_optional() to
is_optional_sched(). We may add optional_pm_ops and is_optional_pm()
in bpf.c in the future for BPF path managers.

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 net/mptcp/bpf.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c
index e86dff4272d5..a450b0521ef6 100644
--- a/net/mptcp/bpf.c
+++ b/net/mptcp/bpf.c
@@ -21,7 +21,7 @@ extern struct btf *btf_vmlinux;
 static const struct btf_type *mptcp_sched_type __read_mostly;
 static u32 mptcp_sched_id;
 
-static u32 optional_ops[] = {
+static u32 optional_sched_ops[] = {
 	offsetof(struct mptcp_sched_ops, init),
 	offsetof(struct mptcp_sched_ops, release),
 };
@@ -92,12 +92,12 @@ static int bpf_mptcp_sched_check_member(const struct btf_type *t,
 	return 0;
 }
 
-static bool is_optional(u32 member_offset)
+static bool is_optional_sched(u32 member_offset)
 {
 	unsigned int i;
 
-	for (i = 0; i < ARRAY_SIZE(optional_ops); i++) {
-		if (member_offset == optional_ops[i])
+	for (i = 0; i < ARRAY_SIZE(optional_sched_ops); i++) {
+		if (member_offset == optional_sched_ops[i])
 			return true;
 	}
 
@@ -132,7 +132,7 @@ static int bpf_mptcp_sched_init_member(const struct btf_type *t,
 
 	/* Ensure bpf_prog is provided for compulsory func ptr */
 	prog_fd = (int)(*(unsigned long *)(udata + moff));
-	if (!prog_fd && !is_optional(moff))
+	if (!prog_fd && !is_optional_sched(moff))
 		return -EINVAL;
 
 	return 0;
-- 
2.35.3


Re: [PATCH mptcp-next] Squash to "bpf: Add bpf_mptcp_sched_ops"
Posted by Matthieu Baerts 1 year, 10 months ago
Hi Geliang, Mat,

On 30/06/2022 12:49, Geliang Tang wrote:
> Rename optional_ops to optional_sched_ops, rename is_optional() to
> is_optional_sched(). We may add optional_pm_ops and is_optional_pm()
> in bpf.c in the future for BPF path managers.

Thank you for the patch and the review!

Now in our tree:

- 546b86f8921c: "squashed" in "bpf: Add bpf_mptcp_sched_ops"
- Results: 083eb67a4d91..223590507ff9 (export)

Builds and tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20220630T173458
https://github.com/multipath-tcp/mptcp_net-next/actions/workflows/build-validation.yml?query=branch:export

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net

Re: [PATCH mptcp-next] Squash to "bpf: Add bpf_mptcp_sched_ops"
Posted by Mat Martineau 1 year, 10 months ago
On Thu, 30 Jun 2022, Geliang Tang wrote:

> Rename optional_ops to optional_sched_ops, rename is_optional() to
> is_optional_sched(). We may add optional_pm_ops and is_optional_pm()
> in bpf.c in the future for BPF path managers.
>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>

Fine to squash this, thanks Geliang.

- Mat

> ---
> net/mptcp/bpf.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c
> index e86dff4272d5..a450b0521ef6 100644
> --- a/net/mptcp/bpf.c
> +++ b/net/mptcp/bpf.c
> @@ -21,7 +21,7 @@ extern struct btf *btf_vmlinux;
> static const struct btf_type *mptcp_sched_type __read_mostly;
> static u32 mptcp_sched_id;
>
> -static u32 optional_ops[] = {
> +static u32 optional_sched_ops[] = {
> 	offsetof(struct mptcp_sched_ops, init),
> 	offsetof(struct mptcp_sched_ops, release),
> };
> @@ -92,12 +92,12 @@ static int bpf_mptcp_sched_check_member(const struct btf_type *t,
> 	return 0;
> }
>
> -static bool is_optional(u32 member_offset)
> +static bool is_optional_sched(u32 member_offset)
> {
> 	unsigned int i;
>
> -	for (i = 0; i < ARRAY_SIZE(optional_ops); i++) {
> -		if (member_offset == optional_ops[i])
> +	for (i = 0; i < ARRAY_SIZE(optional_sched_ops); i++) {
> +		if (member_offset == optional_sched_ops[i])
> 			return true;
> 	}
>
> @@ -132,7 +132,7 @@ static int bpf_mptcp_sched_init_member(const struct btf_type *t,
>
> 	/* Ensure bpf_prog is provided for compulsory func ptr */
> 	prog_fd = (int)(*(unsigned long *)(udata + moff));
> -	if (!prog_fd && !is_optional(moff))
> +	if (!prog_fd && !is_optional_sched(moff))
> 		return -EINVAL;
>
> 	return 0;
> -- 
> 2.35.3
>
>
>

--
Mat Martineau
Intel