Lines Matching refs:xdp
229 struct veth_rq *rq, bool xdp) in veth_forward_skb() argument
231 return __dev_forward_skb(dev, skb) ?: xdp ? in veth_forward_skb()
491 static int veth_xdp_tx(struct net_device *dev, struct xdp_buff *xdp, in veth_xdp_tx() argument
494 struct xdp_frame *frame = convert_to_xdp_frame(xdp); in veth_xdp_tx()
523 struct xdp_buff xdp; in veth_xdp_rcv_one() local
526 xdp.data_hard_start = hard_start; in veth_xdp_rcv_one()
527 xdp.data = frame->data; in veth_xdp_rcv_one()
528 xdp.data_end = frame->data + frame->len; in veth_xdp_rcv_one()
529 xdp.data_meta = frame->data - frame->metasize; in veth_xdp_rcv_one()
530 xdp.rxq = &rq->xdp_rxq; in veth_xdp_rcv_one()
532 act = bpf_prog_run_xdp(xdp_prog, &xdp); in veth_xdp_rcv_one()
536 delta = frame->data - xdp.data; in veth_xdp_rcv_one()
537 len = xdp.data_end - xdp.data; in veth_xdp_rcv_one()
541 xdp.data_hard_start = head; in veth_xdp_rcv_one()
542 xdp.rxq->mem = frame->mem; in veth_xdp_rcv_one()
543 if (unlikely(veth_xdp_tx(rq->dev, &xdp, bq) < 0)) { in veth_xdp_rcv_one()
553 xdp.data_hard_start = head; in veth_xdp_rcv_one()
554 xdp.rxq->mem = frame->mem; in veth_xdp_rcv_one()
555 if (xdp_do_redirect(rq->dev, &xdp, xdp_prog)) { in veth_xdp_rcv_one()
601 struct xdp_buff xdp; in veth_xdp_rcv_skb() local
654 xdp.data_hard_start = skb->head; in veth_xdp_rcv_skb()
655 xdp.data = skb_mac_header(skb); in veth_xdp_rcv_skb()
656 xdp.data_end = xdp.data + pktlen; in veth_xdp_rcv_skb()
657 xdp.data_meta = xdp.data; in veth_xdp_rcv_skb()
658 xdp.rxq = &rq->xdp_rxq; in veth_xdp_rcv_skb()
659 orig_data = xdp.data; in veth_xdp_rcv_skb()
660 orig_data_end = xdp.data_end; in veth_xdp_rcv_skb()
662 act = bpf_prog_run_xdp(xdp_prog, &xdp); in veth_xdp_rcv_skb()
668 get_page(virt_to_page(xdp.data)); in veth_xdp_rcv_skb()
670 xdp.rxq->mem = rq->xdp_mem; in veth_xdp_rcv_skb()
671 if (unlikely(veth_xdp_tx(rq->dev, &xdp, bq) < 0)) { in veth_xdp_rcv_skb()
679 get_page(virt_to_page(xdp.data)); in veth_xdp_rcv_skb()
681 xdp.rxq->mem = rq->xdp_mem; in veth_xdp_rcv_skb()
682 if (xdp_do_redirect(rq->dev, &xdp, xdp_prog)) in veth_xdp_rcv_skb()
698 delta = orig_data - xdp.data; in veth_xdp_rcv_skb()
705 off = xdp.data_end - orig_data_end; in veth_xdp_rcv_skb()
710 metalen = xdp.data - xdp.data_meta; in veth_xdp_rcv_skb()
721 page_frag_free(xdp.data); in veth_xdp_rcv_skb()
1149 static int veth_xdp(struct net_device *dev, struct netdev_bpf *xdp) in veth_xdp() argument
1151 switch (xdp->command) { in veth_xdp()
1153 return veth_xdp_set(dev, xdp->prog, xdp->extack); in veth_xdp()
1155 xdp->prog_id = veth_xdp_query(dev); in veth_xdp()