Overall, I am glad to see XDP support more widely available. Minor stuff in implementation.
> > +/* this function is not called from the receive_buf path directly as > + * we want to use the page model for rx merge buffer and big buffers > + * and not use the fast path for driving skb's around > + */ > +static inline u32 do_xdp_prog(struct virtnet_info *vi, > + struct receive_queue *rq, > + void *buf, int offset, int len) > +{ Do not mark non-trivial static functions as inline. The compiler will do it anyway if it thinks it is appropriate. +static int virtnet_xdp_query(struct net_device *dev) Use bool here. @@ -366,13 +420,22 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, ... if (unlikely(!curr_skb)) goto err_skb; + while (--num_buf) { int num_skb_frags; @@ -1878,7 +2000,6 @@ static int virtnet_probe(struct virtio_device *vdev) if (virtnet_change_mtu(dev, mtu)) __virtio_clear_bit(vdev, VIRTIO_NET_F_MTU); } - if (vi->any_header_sg) dev->needed_headroom = vi->hdr_len; This parts of the patch is white space creep. I.e other edits you did that stayed around. Do you have any performance numbers? Does the receive into pages hurt the non XDP performance?