diff options
Diffstat (limited to 'drivers/vhost/net.c')
| -rw-r--r-- | drivers/vhost/net.c | 28 | 
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index e992decfec53..531a00d703cd 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -73,7 +73,7 @@ enum {  	VHOST_NET_FEATURES = VHOST_FEATURES |  			 (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) |  			 (1ULL << VIRTIO_NET_F_MRG_RXBUF) | -			 (1ULL << VIRTIO_F_IOMMU_PLATFORM) +			 (1ULL << VIRTIO_F_ACCESS_PLATFORM)  };  enum { @@ -862,7 +862,7 @@ static void handle_tx_zerocopy(struct vhost_net *net, struct socket *sock)  	struct tun_msg_ctl ctl;  	size_t len, total_len = 0;  	int err; -	struct vhost_net_ubuf_ref *uninitialized_var(ubufs); +	struct vhost_net_ubuf_ref *ubufs;  	bool zcopy_used;  	int sent_pkts = 0; @@ -1042,7 +1042,7 @@ static int get_rx_bufs(struct vhost_virtqueue *vq,  	/* len is always initialized before use since we are always called with  	 * datalen > 0.  	 */ -	u32 uninitialized_var(len); +	u32 len;  	while (datalen > 0 && headcount < quota) {  		if (unlikely(seg >= UIO_MAXIOV)) { @@ -1099,7 +1099,7 @@ static void handle_rx(struct vhost_net *net)  {  	struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_RX];  	struct vhost_virtqueue *vq = &nvq->vq; -	unsigned uninitialized_var(in), log; +	unsigned in, log;  	struct vhost_log *vq_log;  	struct msghdr msg = {  		.msg_name = NULL, @@ -1615,21 +1615,6 @@ done:  	return err;  } -static int vhost_net_set_backend_features(struct vhost_net *n, u64 features) -{ -	int i; - -	mutex_lock(&n->dev.mutex); -	for (i = 0; i < VHOST_NET_VQ_MAX; ++i) { -		mutex_lock(&n->vqs[i].vq.mutex); -		n->vqs[i].vq.acked_backend_features = features; -		mutex_unlock(&n->vqs[i].vq.mutex); -	} -	mutex_unlock(&n->dev.mutex); - -	return 0; -} -  static int vhost_net_set_features(struct vhost_net *n, u64 features)  {  	size_t vhost_hlen, sock_hlen, hdr_len; @@ -1653,7 +1638,7 @@ static int vhost_net_set_features(struct vhost_net *n, u64 features)  	    !vhost_log_access_ok(&n->dev))  		goto out_unlock; -	if ((features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) { +	if ((features & (1ULL << VIRTIO_F_ACCESS_PLATFORM))) {  		if (vhost_init_device_iotlb(&n->dev, true))  			goto out_unlock;  	} @@ -1730,7 +1715,8 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl,  			return -EFAULT;  		if (features & ~VHOST_NET_BACKEND_FEATURES)  			return -EOPNOTSUPP; -		return vhost_net_set_backend_features(n, features); +		vhost_set_backend_features(&n->dev, features); +		return 0;  	case VHOST_RESET_OWNER:  		return vhost_net_reset_owner(n);  	case VHOST_SET_OWNER:  |