RE: [PATCH v2 bpf-next 3/3] selftests/bpf: Add tests for program extensions

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

 



Alexei Starovoitov wrote:
> Add program extension tests that build on top of fexit_bpf2bpf tests.
> Replace three global functions in previously loaded test_pkt_access.c program
> with three new implementations:
> int get_skb_len(struct __sk_buff *skb);
> int get_constant(long val);
> int get_skb_ifindex(int val, struct __sk_buff *skb, int var);
> New function return the same results as original only if arguments match.
> 
> new_get_skb_ifindex() demonstrates that 'skb' argument doesn't have to be first
> and only argument of BPF program. All normal skb based accesses are available.
> 
> Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx>
> ---
>  .../selftests/bpf/prog_tests/fexit_bpf2bpf.c  | 20 ++++++-
>  .../selftests/bpf/progs/fexit_bpf2bpf.c       | 57 +++++++++++++++++++
>  .../selftests/bpf/progs/test_pkt_access.c     |  8 ++-
>  3 files changed, 83 insertions(+), 2 deletions(-)

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