RE: [PATCH bpf-next] selftests: bpf: Check bpf_msg_push_data return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Felix Maurer wrote:
> bpf_msg_push_data may return a non-zero value to indicate an error. The
> return value should be checked to prevent undetected errors.
> 
> To indicate an error, the BPF programs now perform a different action
> than their intended one to make the userspace test program notice the
> error, i.e., the programs supposed to pass/redirect drop, the program
> supposed to drop passes.
> 
> Fixes: 84fbfe026acaa ("bpf: test_sockmap add options to use msg_push_data")
> Signed-off-by: Felix Maurer <fmaurer@xxxxxxxxxx>
> ---
>  .../selftests/bpf/progs/test_sockmap_kern.h   | 26 +++++++++++++------
>  1 file changed, 18 insertions(+), 8 deletions(-)

LGTM. As a general comment we should be looking to convert test_sockmap
over to the modern globals method to detect errors like used in all the
other tests. Also I've been considering porting the tests we need into
the more generally used test_progs framework. Or go the other way and
take some of the general functions used in test_prog and use them in
test_sockmap.

Right now code wise test_sockmap is a bit of an island. But, this patch
is good we shouldn't block small useful fixes because we are waiting for
me to conjure up some time to do a bigger overhaul. I mention in case
someone else is able to pick it up. Feel free to ping me if its
interesting. Otherwise I'll get to it when I can.

Acked-by: John Fastabend <john.fastabend@xxxxxxxxx>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux