[PATCH mptcp-next 2/2] mptcp: bpf: Remove unused arguments from btf_struct_access()

Matthieu Baerts posted 2 patches 2 years, 10 months ago
Maintainers: Matthieu Baerts <matthieu.baerts@tessares.net>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Alexei Starovoitov <ast@kernel.org>, Andrii Nakryiko <andrii@kernel.org>, David Vernet <void@manifault.com>
[PATCH mptcp-next 2/2] mptcp: bpf: Remove unused arguments from btf_struct_access()
Posted by Matthieu Baerts 2 years, 10 months ago
This is a Squash-to patch for commit "bpf: Add bpf_mptcp_sched_ops",
similar to what has been done upstream for BPF TCP CA, see the commit
below.

Fixes: b7e852a9ec96 ("bpf: Remove unused arguments from btf_struct_access().")
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
 net/mptcp/bpf.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c
index 60f60868187f..f876c45aff27 100644
--- a/net/mptcp/bpf.c
+++ b/net/mptcp/bpf.c
@@ -35,10 +35,7 @@ bpf_mptcp_sched_get_func_proto(enum bpf_func_id func_id,
 
 static int bpf_mptcp_sched_btf_struct_access(struct bpf_verifier_log *log,
 					     const struct bpf_reg_state *reg,
-					     int off, int size,
-					     enum bpf_access_type atype,
-					     u32 *next_btf_id,
-					     enum bpf_type_flag *flag)
+					     int off, int size)
 {
 	const struct btf_type *t;
 	size_t end;
-- 
2.39.2
Re: mptcp: bpf: Remove unused arguments from btf_struct_access(): Tests Results
Posted by MPTCP CI 2 years, 10 months ago
Hi Matthieu,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/5059865924599808
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5059865924599808/summary/summary.txt

- KVM Validation: debug (except selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/5622815878021120
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5622815878021120/summary/summary.txt

- KVM Validation: normal (only selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/6185765831442432
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/6185765831442432/summary/summary.txt

- KVM Validation: debug (only selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/6748715784863744
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/6748715784863744/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/6d8ceeecf1d4


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-debug

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)
Re: mptcp: bpf: Remove unused arguments from btf_struct_access(): Build Failure
Posted by MPTCP CI 2 years, 10 months ago
Hi Matthieu,

Thank you for your modifications, that's great!

But sadly, our CI spotted some issues with it when trying to build it.

You can find more details there:

  https://patchwork.kernel.org/project/mptcp/patch/20230414092934.4065227-3-matthieu.baerts@tessares.net/
  https://github.com/multipath-tcp/mptcp_net-next/actions/runs/4698487727

Status: failure
Initiator: MPTCPimporter
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/6d8ceeecf1d4

Feel free to reply to this email if you cannot access logs, if you need
some support to fix the error, if this doesn't seem to be caused by your
modifications or if the error is a false positive one.

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)
Re: mptcp: bpf: Remove unused arguments from btf_struct_access(): Build Failure
Posted by Matthieu Baerts 2 years, 10 months ago
Hello,

On 14/04/2023 11:50, MPTCP CI wrote:
> Hi Matthieu,
> 
> Thank you for your modifications, that's great!
> 
> But sadly, our CI spotted some issues with it when trying to build it.
> 
> You can find more details there:
> 
>   https://patchwork.kernel.org/project/mptcp/patch/20230414092934.4065227-3-matthieu.baerts@tessares.net/
>   https://github.com/multipath-tcp/mptcp_net-next/actions/runs/4698487727

I didn't think about that but the failure is normal. That's because each
individual commit is tested and the fix is done in the second one.

The first patch fails with:

>     CC      net/mptcp/bpf.o
>   net/mptcp/bpf.c:73:35: error: initialization of 'int (*)(struct bpf_verifier_log *, const struct bpf_reg_state *, int,  int)' from incompatible pointer type 'int (*)(struct bpf_verifier_log *, const struct bpf_reg_state *, int,  int,  enum bpf_access_type,  u32 *, enum bpf_type_flag *)' {aka 'int (*)(struct bpf_verifier_log *, const struct bpf_reg_state *, int,  int,  enum bpf_access_type,  unsigned int *, enum bpf_type_flag *)'} [-Werror=incompatible-pointer-types]
>      73 |         .btf_struct_access      = bpf_mptcp_sched_btf_struct_access,
>         |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   net/mptcp/bpf.c:73:35: note: (near initialization for 'bpf_mptcp_sched_verifier_ops.btf_struct_access')
>   cc1: all warnings being treated as errors

But the second one is OK:

>     CC      net/mptcp/bpf.o
>     AR      net/mptcp/built-in.a

I'm going to apply these two patches then.

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