1 // SPDX-License-Identifier: GPL-2.0
3 #include <bpf/bpf_helpers.h>
4 #include "bpf_trace_helpers.h"
7 /* Structure does not need to contain all entries,
8 * as "preserve_access_index" will use BTF to fix this...
11 } __attribute__((preserve_access_index));
14 /* Structure does not need to contain all entries,
15 * as "preserve_access_index" will use BTF to fix this...
17 struct net_device *dev;
19 } __attribute__((preserve_access_index));
25 void *data_hard_start;
27 struct xdp_rxq_info *rxq;
28 } __attribute__((preserve_access_index));
30 __u64 test_result_fentry = 0;
31 SEC("fentry/_xdp_tx_iptunnel")
32 int BPF_PROG(trace_on_entry, struct xdp_buff *xdp)
34 test_result_fentry = xdp->rxq->dev->ifindex;
38 __u64 test_result_fexit = 0;
39 SEC("fexit/_xdp_tx_iptunnel")
40 int BPF_PROG(trace_on_exit, struct xdp_buff *xdp, int ret)
42 test_result_fexit = ret;