diff options
author | Matteo Croce <mcroce@microsoft.com> | 2021-05-14 20:39:54 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-05-14 15:20:10 -0700 |
commit | 224bf7db5518d804932c0c78b1206ebb21f43d6a (patch) | |
tree | 328d2f0ad4d1a349cb9b9bd672a0ef9040a49292 /drivers/vhost | |
parent | 082294f294f6de4b50be0af354adb83e45816db4 (diff) | |
download | linux-224bf7db5518d804932c0c78b1206ebb21f43d6a.tar.gz linux-224bf7db5518d804932c0c78b1206ebb21f43d6a.tar.bz2 linux-224bf7db5518d804932c0c78b1206ebb21f43d6a.zip |
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>
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/net.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index df82b124170e..6414bd5741b8 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -744,11 +744,9 @@ static int vhost_net_build_xdp(struct vhost_net_virtqueue *nvq, if (copied != len) return -EFAULT; - xdp->data_hard_start = buf; - xdp->data = buf + pad; - xdp->data_end = xdp->data + len; + xdp_init_buff(xdp, buflen, NULL); + xdp_prepare_buff(xdp, buf, pad, len, true); hdr->buflen = buflen; - xdp->frame_sz = buflen; --net->refcnt_bias; alloc_frag->offset += buflen; |