summaryrefslogtreecommitdiff
path: root/drivers/vhost
diff options
context:
space:
mode:
authorJonathan Lemon <jonathan.lemon@gmail.com>2021-01-07 01:18:40 +0300
committerJakub Kicinski <kuba@kernel.org>2021-01-08 03:08:37 +0300
commit9ee5e5ade033875191a2d2e470033e9cdde44a6a (patch)
tree83afacafdceb7f0d0c3b17c9e358cf7a11e32fe7 /drivers/vhost
parent04c2d33eabdc76df730e1e356f6b2c656381d7d5 (diff)
downloadlinux-9ee5e5ade033875191a2d2e470033e9cdde44a6a.tar.xz
tap/tun: add skb_zcopy_init() helper for initialization.
Replace direct assignments with skb_zcopy_init() for zerocopy cases where a new skb is initialized, without changing the reference counts. Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/vhost')
-rw-r--r--drivers/vhost/net.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index f834a097895e..3b744031ec8f 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -903,6 +903,7 @@ static void handle_tx_zerocopy(struct vhost_net *net, struct socket *sock)
ubuf->callback = vhost_zerocopy_callback;
ubuf->ctx = nvq->ubufs;
ubuf->desc = nvq->upend_idx;
+ ubuf->flags = SKBFL_ZEROCOPY_FRAG;
refcount_set(&ubuf->refcnt, 1);
msg.msg_control = &ctl;
ctl.type = TUN_MSG_UBUF;