Lines Matching refs:xdp
1233 static int tun_xdp(struct net_device *dev, struct netdev_bpf *xdp) in tun_xdp() argument
1235 switch (xdp->command) { in tun_xdp()
1237 return tun_xdp_set(dev, xdp->prog, xdp->extack); in tun_xdp()
1239 xdp->prog_id = tun_xdp_query(dev); in tun_xdp()
1310 struct xdp_frame *xdp = frames[i]; in tun_xdp_xmit() local
1314 void *frame = tun_xdp_to_ptr(xdp); in tun_xdp_xmit()
1318 xdp_return_frame_rx_napi(xdp); in tun_xdp_xmit()
1331 static int tun_xdp_tx(struct net_device *dev, struct xdp_buff *xdp) in tun_xdp_tx() argument
1333 struct xdp_frame *frame = convert_to_xdp_frame(xdp); in tun_xdp_tx()
1624 struct xdp_buff *xdp, u32 act) in tun_xdp_act() argument
1630 err = xdp_do_redirect(tun->dev, xdp, xdp_prog); in tun_xdp_act()
1635 err = tun_xdp_tx(tun->dev, xdp); in tun_xdp_act()
1703 struct xdp_buff xdp; in tun_build_skb() local
1706 xdp.data_hard_start = buf; in tun_build_skb()
1707 xdp.data = buf + pad; in tun_build_skb()
1708 xdp_set_data_meta_invalid(&xdp); in tun_build_skb()
1709 xdp.data_end = xdp.data + len; in tun_build_skb()
1710 xdp.rxq = &tfile->xdp_rxq; in tun_build_skb()
1712 act = bpf_prog_run_xdp(xdp_prog, &xdp); in tun_build_skb()
1717 err = tun_xdp_act(tun, xdp_prog, &xdp, act); in tun_build_skb()
1725 pad = xdp.data - xdp.data_hard_start; in tun_build_skb()
1726 len = xdp.data_end - xdp.data; in tun_build_skb()
2421 struct xdp_buff *xdp, int *flush, in tun_xdp_one() argument
2424 unsigned int datasize = xdp->data_end - xdp->data; in tun_xdp_one()
2425 struct tun_xdp_hdr *hdr = xdp->data_hard_start; in tun_xdp_one()
2442 xdp_set_data_meta_invalid(xdp); in tun_xdp_one()
2443 xdp->rxq = &tfile->xdp_rxq; in tun_xdp_one()
2445 act = bpf_prog_run_xdp(xdp_prog, xdp); in tun_xdp_one()
2446 err = tun_xdp_act(tun, xdp_prog, xdp, act); in tun_xdp_one()
2448 put_page(virt_to_head_page(xdp->data)); in tun_xdp_one()
2461 page = virt_to_head_page(xdp->data); in tun_xdp_one()
2474 skb = build_skb(xdp->data_hard_start, buflen); in tun_xdp_one()
2480 skb_reserve(skb, xdp->data - xdp->data_hard_start); in tun_xdp_one()
2481 skb_put(skb, xdp->data_end - xdp->data); in tun_xdp_one()
2529 struct xdp_buff *xdp; in tun_sendmsg() local
2545 xdp = &((struct xdp_buff *)ctl->ptr)[i]; in tun_sendmsg()
2546 tun_xdp_one(tun, tfile, xdp, &flush, &tpage); in tun_sendmsg()