提交 a06bf42f 编写于 作者: S Stanislav Fomichev 提交者: Alexei Starovoitov

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: NStanislav Fomichev <sdf@google.com>
Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
Acked-by: NMartin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20191213223028.161282-2-sdf@google.com
上级 850a88cc
......@@ -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;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册