mbox series

[bpf-next,v2,0/4] Fixes for BPF selftests on Loongarch

Message ID cover.1719302367.git.tanggeliang@kylinos.cn (mailing list archive)
Headers show
Series Fixes for BPF selftests on Loongarch | expand

Message

Geliang Tang June 25, 2024, 8:24 a.m. UTC
From: Geliang Tang <tanggeliang@kylinos.cn>

v2:
 - add patch 2, a new fix for sk_msg_memcopy_from_iter.
 - update patch 3, only test "sk->sk_prot->close" as Eric suggested.
 - update patch 4, use "goto err" instead of "return" as Eduard
   suggested.
 - add "fixes" tag for patch 1-3.
 - change subject prefixes as "bpf-next" to trigger BPF CI.
 - cc Loongarch maintainers too.

BPF selftests seem to have not been fully tested on Loongarch. When I
ran these tests on Loongarch recently, some errors occur. This patch set
contains some null-check related fixes for these errors.

Geliang Tang (4):
  skmsg: null check for sg_page in sk_msg_recvmsg
  skmsg: null check for sg_page in sk_msg_memcopy_from_iter
  inet: null check for close in inet_release
  selftests/bpf: Null checks for link in bpf_tcp_ca

 net/core/skmsg.c                                 |  4 ++++
 net/ipv4/af_inet.c                               |  3 ++-
 .../selftests/bpf/prog_tests/bpf_tcp_ca.c        | 16 ++++++++++++----
 3 files changed, 18 insertions(+), 5 deletions(-)

Comments

Huacai Chen June 25, 2024, 8:29 a.m. UTC | #1
On Tue, Jun 25, 2024 at 4:25 PM Geliang Tang <geliang@kernel.org> wrote:
>
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> v2:
>  - add patch 2, a new fix for sk_msg_memcopy_from_iter.
>  - update patch 3, only test "sk->sk_prot->close" as Eric suggested.
>  - update patch 4, use "goto err" instead of "return" as Eduard
>    suggested.
>  - add "fixes" tag for patch 1-3.
>  - change subject prefixes as "bpf-next" to trigger BPF CI.
>  - cc Loongarch maintainers too.
>
> BPF selftests seem to have not been fully tested on Loongarch. When I
> ran these tests on Loongarch recently, some errors occur. This patch set
> contains some null-check related fixes for these errors.
Is the root cause that LoongArch lacks bpf trampoline?

Huacai

>
> Geliang Tang (4):
>   skmsg: null check for sg_page in sk_msg_recvmsg
>   skmsg: null check for sg_page in sk_msg_memcopy_from_iter
>   inet: null check for close in inet_release
>   selftests/bpf: Null checks for link in bpf_tcp_ca
>
>  net/core/skmsg.c                                 |  4 ++++
>  net/ipv4/af_inet.c                               |  3 ++-
>  .../selftests/bpf/prog_tests/bpf_tcp_ca.c        | 16 ++++++++++++----
>  3 files changed, 18 insertions(+), 5 deletions(-)
>
> --
> 2.43.0
>
Geliang Tang June 25, 2024, 9:08 a.m. UTC | #2
On Tue, 2024-06-25 at 16:29 +0800, Huacai Chen wrote:
> On Tue, Jun 25, 2024 at 4:25 PM Geliang Tang <geliang@kernel.org>
> wrote:
> > 
> > From: Geliang Tang <tanggeliang@kylinos.cn>
> > 
> > v2:
> >  - add patch 2, a new fix for sk_msg_memcopy_from_iter.
> >  - update patch 3, only test "sk->sk_prot->close" as Eric
> > suggested.
> >  - update patch 4, use "goto err" instead of "return" as Eduard
> >    suggested.
> >  - add "fixes" tag for patch 1-3.
> >  - change subject prefixes as "bpf-next" to trigger BPF CI.
> >  - cc Loongarch maintainers too.
> > 
> > BPF selftests seem to have not been fully tested on Loongarch. When
> > I
> > ran these tests on Loongarch recently, some errors occur. This
> > patch set
> > contains some null-check related fixes for these errors.
> Is the root cause that LoongArch lacks bpf trampoline?

No. These errors don't seem to be directly related to the lack of BPF
trampoline. I have indeed got some errors since lacking BPF trampoline,
which is probably like this:

 test_dctcp:PASS:bpf_dctcp__open_and_load 0 nsec
 test_dctcp:FAIL:bpf_map__attach_struct_ops unexpected error: -524
 #29/1    bpf_tcp_ca/dctcp:FAIL
 test_cubic:PASS:bpf_cubic__open_and_load 0 nsec
 test_cubic:FAIL:bpf_map__attach_struct_ops unexpected error: -524
 #29/2    bpf_tcp_ca/cubic:FAIL
 test_dctcp_fallback:PASS:dctcp_skel 0 nsec
 test_dctcp_fallback:PASS:bpf_dctcp__load 0 nsec
 test_dctcp_fallback:FAIL:dctcp link unexpected error: -524
 #29/4    bpf_tcp_ca/dctcp_fallback:FAIL
 test_write_sk_pacing:PASS:open_and_load 0 nsec
 test_write_sk_pacing:FAIL:attach_struct_ops unexpected error: -524
 #29/6    bpf_tcp_ca/write_sk_pacing:FAIL

Thanks,
-Geliang

> 
> Huacai
> 
> > 
> > Geliang Tang (4):
> >   skmsg: null check for sg_page in sk_msg_recvmsg
> >   skmsg: null check for sg_page in sk_msg_memcopy_from_iter
> >   inet: null check for close in inet_release
> >   selftests/bpf: Null checks for link in bpf_tcp_ca
> > 
> >  net/core/skmsg.c                                 |  4 ++++
> >  net/ipv4/af_inet.c                               |  3 ++-
> >  .../selftests/bpf/prog_tests/bpf_tcp_ca.c        | 16
> > ++++++++++++----
> >  3 files changed, 18 insertions(+), 5 deletions(-)
> > 
> > --
> > 2.43.0
> >
Huacai Chen June 25, 2024, 9:14 a.m. UTC | #3
On Tue, Jun 25, 2024 at 5:08 PM Geliang Tang <geliang@kernel.org> wrote:
>
> On Tue, 2024-06-25 at 16:29 +0800, Huacai Chen wrote:
> > On Tue, Jun 25, 2024 at 4:25 PM Geliang Tang <geliang@kernel.org>
> > wrote:
> > >
> > > From: Geliang Tang <tanggeliang@kylinos.cn>
> > >
> > > v2:
> > >  - add patch 2, a new fix for sk_msg_memcopy_from_iter.
> > >  - update patch 3, only test "sk->sk_prot->close" as Eric
> > > suggested.
> > >  - update patch 4, use "goto err" instead of "return" as Eduard
> > >    suggested.
> > >  - add "fixes" tag for patch 1-3.
> > >  - change subject prefixes as "bpf-next" to trigger BPF CI.
> > >  - cc Loongarch maintainers too.
> > >
> > > BPF selftests seem to have not been fully tested on Loongarch. When
> > > I
> > > ran these tests on Loongarch recently, some errors occur. This
> > > patch set
> > > contains some null-check related fixes for these errors.
> > Is the root cause that LoongArch lacks bpf trampoline?
>
> No. These errors don't seem to be directly related to the lack of BPF
> trampoline. I have indeed got some errors since lacking BPF trampoline,
> which is probably like this:
If so, these errors seem not specific to LoongArch.

Huacai

>
>  test_dctcp:PASS:bpf_dctcp__open_and_load 0 nsec
>  test_dctcp:FAIL:bpf_map__attach_struct_ops unexpected error: -524
>  #29/1    bpf_tcp_ca/dctcp:FAIL
>  test_cubic:PASS:bpf_cubic__open_and_load 0 nsec
>  test_cubic:FAIL:bpf_map__attach_struct_ops unexpected error: -524
>  #29/2    bpf_tcp_ca/cubic:FAIL
>  test_dctcp_fallback:PASS:dctcp_skel 0 nsec
>  test_dctcp_fallback:PASS:bpf_dctcp__load 0 nsec
>  test_dctcp_fallback:FAIL:dctcp link unexpected error: -524
>  #29/4    bpf_tcp_ca/dctcp_fallback:FAIL
>  test_write_sk_pacing:PASS:open_and_load 0 nsec
>  test_write_sk_pacing:FAIL:attach_struct_ops unexpected error: -524
>  #29/6    bpf_tcp_ca/write_sk_pacing:FAIL
>
> Thanks,
> -Geliang
>
> >
> > Huacai
> >
> > >
> > > Geliang Tang (4):
> > >   skmsg: null check for sg_page in sk_msg_recvmsg
> > >   skmsg: null check for sg_page in sk_msg_memcopy_from_iter
> > >   inet: null check for close in inet_release
> > >   selftests/bpf: Null checks for link in bpf_tcp_ca
> > >
> > >  net/core/skmsg.c                                 |  4 ++++
> > >  net/ipv4/af_inet.c                               |  3 ++-
> > >  .../selftests/bpf/prog_tests/bpf_tcp_ca.c        | 16
> > > ++++++++++++----
> > >  3 files changed, 18 insertions(+), 5 deletions(-)
> > >
> > > --
> > > 2.43.0
> > >
>