Make sure BPF_PROG_TEST_RUN accepts tstamp and exports any modifications that BPF program does. 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/20191015183125.124413-2-sdf@google.com
23 lines
383 B
C
23 lines
383 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include <linux/bpf.h>
|
|
#include "bpf_helpers.h"
|
|
|
|
int _version SEC("version") = 1;
|
|
char _license[] SEC("license") = "GPL";
|
|
|
|
SEC("skb_ctx")
|
|
int process(struct __sk_buff *skb)
|
|
{
|
|
#pragma clang loop unroll(full)
|
|
for (int i = 0; i < 5; i++) {
|
|
if (skb->cb[i] != i + 1)
|
|
return 1;
|
|
skb->cb[i]++;
|
|
}
|
|
skb->priority++;
|
|
skb->tstamp++;
|
|
|
|
return 0;
|
|
}
|