vhost_net: use XDP helpers
Make use of the xdp_{init,prepare}_buff() helpers instead of an open-coded version. Also, the field xdp->rxq was never set, so pass NULL to xdp_init_buff() to clear it. Signed-off-by: Matteo Croce <mcroce@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
082294f294
commit
224bf7db55
@ -744,11 +744,9 @@ static int vhost_net_build_xdp(struct vhost_net_virtqueue *nvq,
|
|||||||
if (copied != len)
|
if (copied != len)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
|
||||||
xdp->data_hard_start = buf;
|
xdp_init_buff(xdp, buflen, NULL);
|
||||||
xdp->data = buf + pad;
|
xdp_prepare_buff(xdp, buf, pad, len, true);
|
||||||
xdp->data_end = xdp->data + len;
|
|
||||||
hdr->buflen = buflen;
|
hdr->buflen = buflen;
|
||||||
xdp->frame_sz = buflen;
|
|
||||||
|
|
||||||
--net->refcnt_bias;
|
--net->refcnt_bias;
|
||||||
alloc_frag->offset += buflen;
|
alloc_frag->offset += buflen;
|
||||||
|
Reference in New Issue
Block a user