Merge remote-tracking branches 'regulator/fix/anatop', 'regulator/fix/gpio', 'regulat...
[firefly-linux-kernel-4.4.55.git] / drivers / vhost / net.c
index 2bbfc25e582cb8b334a1ef4083b22da56c48cc65..9eda69e406787a55a347370328cdf07d5375dc0a 100644 (file)
@@ -61,8 +61,7 @@ MODULE_PARM_DESC(experimental_zcopytx, "Enable Zero Copy TX;"
 enum {
        VHOST_NET_FEATURES = VHOST_FEATURES |
                         (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) |
-                        (1ULL << VIRTIO_NET_F_MRG_RXBUF) |
-                        (1ULL << VIRTIO_F_VERSION_1),
+                        (1ULL << VIRTIO_NET_F_MRG_RXBUF)
 };
 
 enum {
@@ -357,13 +356,13 @@ static void handle_tx(struct vhost_net *net)
                iov_iter_init(&msg.msg_iter, WRITE, vq->iov, out, len);
                iov_iter_advance(&msg.msg_iter, hdr_size);
                /* Sanity check */
-               if (!iov_iter_count(&msg.msg_iter)) {
+               if (!msg_data_left(&msg)) {
                        vq_err(vq, "Unexpected header len for TX: "
                               "%zd expected %zd\n",
                               len, hdr_size);
                        break;
                }
-               len = iov_iter_count(&msg.msg_iter);
+               len = msg_data_left(&msg);
 
                zcopy_used = zcopy && len >= VHOST_GOODCOPY_LEN
                                   && (nvq->upend_idx + 1) % UIO_MAXIOV !=
@@ -390,7 +389,7 @@ static void handle_tx(struct vhost_net *net)
                        ubufs = NULL;
                }
                /* TODO: Check specific error and bomb out unless ENOBUFS? */
-               err = sock->ops->sendmsg(NULL, sock, &msg, len);
+               err = sock->ops->sendmsg(sock, &msg, len);
                if (unlikely(err < 0)) {
                        if (zcopy_used) {
                                vhost_net_ubuf_put(ubufs);
@@ -566,7 +565,7 @@ static void handle_rx(struct vhost_net *net)
                /* On overrun, truncate and discard */
                if (unlikely(headcount > UIO_MAXIOV)) {
                        iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1);
-                       err = sock->ops->recvmsg(NULL, sock, &msg,
+                       err = sock->ops->recvmsg(sock, &msg,
                                                 1, MSG_DONTWAIT | MSG_TRUNC);
                        pr_debug("Discarded rx packet: len %zd\n", sock_len);
                        continue;
@@ -592,7 +591,7 @@ static void handle_rx(struct vhost_net *net)
                         */
                        iov_iter_advance(&msg.msg_iter, vhost_hlen);
                }
-               err = sock->ops->recvmsg(NULL, sock, &msg,
+               err = sock->ops->recvmsg(sock, &msg,
                                         sock_len, MSG_DONTWAIT | MSG_TRUNC);
                /* Userspace might have consumed the packet meanwhile:
                 * it's not supposed to do this usually, but might be hard