Lines Matching defs:xdp
77 static __always_inline int handle_ipv4(struct xdp_md *xdp, struct bpf_dynptr *xdp_ptr)
98 if (ethhdr_sz + iphdr_sz + tcphdr_sz > xdp->data_end - xdp->data)
121 if (bpf_xdp_adjust_head(xdp, 0 - (int)iphdr_sz))
124 bpf_dynptr_from_xdp(xdp, 0, &new_xdp_ptr);
159 static __always_inline int handle_ipv6(struct xdp_md *xdp, struct bpf_dynptr *xdp_ptr)
177 if (ethhdr_sz + iphdr_sz + tcphdr_sz > xdp->data_end - xdp->data)
200 if (bpf_xdp_adjust_head(xdp, 0 - (int)ipv6hdr_sz))
203 bpf_dynptr_from_xdp(xdp, 0, &new_xdp_ptr);
230 SEC("xdp")
231 int _xdp_tx_iptunnel(struct xdp_md *xdp)
240 bpf_dynptr_from_xdp(xdp, 0, &ptr);
248 return handle_ipv4(xdp, &ptr);
251 return handle_ipv6(xdp, &ptr);