mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
selftests/bpf: Test wire_len/gso_segs in BPF_PROG_TEST_RUN
Make sure we can pass arbitrary data in wire_len/gso_segs. Signed-off-by: Stanislav Fomichev <sdf@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/20191213223028.161282-2-sdf@google.com
This commit is contained in:
parent
850a88cc40
commit
a06bf42f5a
2 changed files with 7 additions and 0 deletions
|
@ -11,6 +11,8 @@ void test_skb_ctx(void)
|
|||
.cb[4] = 5,
|
||||
.priority = 6,
|
||||
.tstamp = 7,
|
||||
.wire_len = 100,
|
||||
.gso_segs = 8,
|
||||
};
|
||||
struct bpf_prog_test_run_attr tattr = {
|
||||
.data_in = &pkt_v4,
|
||||
|
|
|
@ -18,5 +18,10 @@ int process(struct __sk_buff *skb)
|
|||
skb->priority++;
|
||||
skb->tstamp++;
|
||||
|
||||
if (skb->wire_len != 100)
|
||||
return 1;
|
||||
if (skb->gso_segs != 8)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue