mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07: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
@ -11,6 +11,8 @@ void test_skb_ctx(void)
|
|||||||
.cb[4] = 5,
|
.cb[4] = 5,
|
||||||
.priority = 6,
|
.priority = 6,
|
||||||
.tstamp = 7,
|
.tstamp = 7,
|
||||||
|
.wire_len = 100,
|
||||||
|
.gso_segs = 8,
|
||||||
};
|
};
|
||||||
struct bpf_prog_test_run_attr tattr = {
|
struct bpf_prog_test_run_attr tattr = {
|
||||||
.data_in = &pkt_v4,
|
.data_in = &pkt_v4,
|
||||||
|
@ -18,5 +18,10 @@ int process(struct __sk_buff *skb)
|
|||||||
skb->priority++;
|
skb->priority++;
|
||||||
skb->tstamp++;
|
skb->tstamp++;
|
||||||
|
|
||||||
|
if (skb->wire_len != 100)
|
||||||
|
return 1;
|
||||||
|
if (skb->gso_segs != 8)
|
||||||
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user