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@kernel.org>
---
.../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@gmail.com>