diff options
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r-- | drivers/vhost/net.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 4e656f89cb22..fb01ce6d981c 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -620,6 +620,7 @@ static void handle_tx_zerocopy(struct vhost_net *net, struct socket *sock) | |||
620 | .msg_controllen = 0, | 620 | .msg_controllen = 0, |
621 | .msg_flags = MSG_DONTWAIT, | 621 | .msg_flags = MSG_DONTWAIT, |
622 | }; | 622 | }; |
623 | struct tun_msg_ctl ctl; | ||
623 | size_t len, total_len = 0; | 624 | size_t len, total_len = 0; |
624 | int err; | 625 | int err; |
625 | struct vhost_net_ubuf_ref *uninitialized_var(ubufs); | 626 | struct vhost_net_ubuf_ref *uninitialized_var(ubufs); |
@@ -664,8 +665,10 @@ static void handle_tx_zerocopy(struct vhost_net *net, struct socket *sock) | |||
664 | ubuf->ctx = nvq->ubufs; | 665 | ubuf->ctx = nvq->ubufs; |
665 | ubuf->desc = nvq->upend_idx; | 666 | ubuf->desc = nvq->upend_idx; |
666 | refcount_set(&ubuf->refcnt, 1); | 667 | refcount_set(&ubuf->refcnt, 1); |
667 | msg.msg_control = ubuf; | 668 | msg.msg_control = &ctl; |
668 | msg.msg_controllen = sizeof(ubuf); | 669 | ctl.type = TUN_MSG_UBUF; |
670 | ctl.ptr = ubuf; | ||
671 | msg.msg_controllen = sizeof(ctl); | ||
669 | ubufs = nvq->ubufs; | 672 | ubufs = nvq->ubufs; |
670 | atomic_inc(&ubufs->refcount); | 673 | atomic_inc(&ubufs->refcount); |
671 | nvq->upend_idx = (nvq->upend_idx + 1) % UIO_MAXIOV; | 674 | nvq->upend_idx = (nvq->upend_idx + 1) % UIO_MAXIOV; |