summaryrefslogtreecommitdiffstats
path: root/lib/test_bpf.c
diff options
context:
space:
mode:
authorVadim Fedorenko <vfedorenko@novek.ru>2021-09-10 00:04:09 +0200
committerDaniel Borkmann <daniel@iogearbox.net>2021-09-10 23:20:13 +0200
commit3384c7c7641b44987e35eadbc9df6c16a0520159 (patch)
treec9f94e549e26966186c4e3a6672ce42b6a470b83 /lib/test_bpf.c
parentbpf: Add hardware timestamp field to __sk_buff (diff)
downloadlinux-3384c7c7641b44987e35eadbc9df6c16a0520159.tar.xz
linux-3384c7c7641b44987e35eadbc9df6c16a0520159.zip
selftests/bpf: Test new __sk_buff field hwtstamp
Analogous to the gso_segs selftests introduced in commit d9ff286a0f59 ("bpf: allow BPF programs access skb_shared_info->gso_segs field"). Signed-off-by: Vadim Fedorenko <vfedorenko@novek.ru> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/20210909220409.8804-3-vfedorenko@novek.ru
Diffstat (limited to 'lib/test_bpf.c')
-rw-r--r--lib/test_bpf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index 830a18ecffc8..0018d51b93b0 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -8800,6 +8800,7 @@ static __init struct sk_buff *build_test_skb(void)
skb_shinfo(skb[0])->gso_type |= SKB_GSO_DODGY;
skb_shinfo(skb[0])->gso_segs = 0;
skb_shinfo(skb[0])->frag_list = skb[1];
+ skb_shinfo(skb[0])->hwtstamps.hwtstamp = 1000;
/* adjust skb[0]'s len */
skb[0]->len += skb[1]->len;