Commit bc69ed97 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull virtio updates from Michael Tsirkin:
 "Just a bunch of fixes and cleanups, mostly very simple. Several
  features were merged through net-next this time around"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  virtio_pci: drop kernel.h
  vhost: switch to arrays of feature bits
  vhost/test: add test specific macro for features
  virtio: clean up features qword/dword terms
  vduse: add WQ_PERCPU to alloc_workqueue users
  virtio_balloon: add WQ_PERCPU to alloc_workqueue users
  vdpa/pds: use %pe for ERR_PTR() in event handler registration
  vhost: Fix kthread worker cgroup failure handling
  virtio: vdpa: Fix reference count leak in octep_sriov_enable()
  vdpa/mlx5: Fix incorrect error code reporting in query_virtqueues
  virtio: fix map ops comment
  virtio: fix virtqueue_set_affinity() docs
  virtio: standardize Returns documentation style
  virtio: fix grammar in virtio_map_ops docs
  virtio: fix grammar in virtio_queue_info docs
  virtio: fix whitespace in virtio_config_ops
  virtio: fix typo in virtio_device_ready() comment
  virtio: fix kernel-doc for mapping/free_coherent functions
  virtio_vdpa: fix misleading return in void function
parents 55aa394a 205dd7a5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1256,7 +1256,7 @@ static int query_virtqueues(struct mlx5_vdpa_net *ndev,
		int vq_idx = start_vq + i;

		if (cmd->err) {
			mlx5_vdpa_err(mvdev, "query vq %d failed, err: %d\n", vq_idx, err);
			mlx5_vdpa_err(mvdev, "query vq %d failed, err: %d\n", vq_idx, cmd->err);
			if (!err)
				err = cmd->err;
			continue;
+1 −0
Original line number Diff line number Diff line
@@ -736,6 +736,7 @@ static int octep_sriov_enable(struct pci_dev *pdev, int num_vfs)
		octep_vdpa_assign_barspace(vf_pdev, pdev, index);
		if (++index == num_vfs) {
			done = true;
			pci_dev_put(vf_pdev);
			break;
		}
	}
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ static int pds_vdpa_register_event_handler(struct pds_vdpa_device *pdsv)
		err = pdsc_register_notify(nb);
		if (err) {
			nb->notifier_call = NULL;
			dev_err(dev, "failed to register pds event handler: %ps\n",
			dev_err(dev, "failed to register pds event handler: %pe\n",
				ERR_PTR(err));
			return -EINVAL;
		}
+2 −1
Original line number Diff line number Diff line
@@ -2173,7 +2173,8 @@ static int vduse_init(void)
	if (!vduse_irq_wq)
		goto err_wq;

	vduse_irq_bound_wq = alloc_workqueue("vduse-irq-bound", WQ_HIGHPRI, 0);
	vduse_irq_bound_wq = alloc_workqueue("vduse-irq-bound",
					     WQ_HIGHPRI | WQ_PERCPU, 0);
	if (!vduse_irq_bound_wq)
		goto err_bound_wq;

+15 −14
Original line number Diff line number Diff line
@@ -69,15 +69,15 @@ MODULE_PARM_DESC(experimental_zcopytx, "Enable Zero Copy TX;"

#define VHOST_DMA_IS_DONE(len) ((__force u32)(len) >= (__force u32)VHOST_DMA_DONE_LEN)

static const u64 vhost_net_features[VIRTIO_FEATURES_DWORDS] = {
	VHOST_FEATURES |
	(1ULL << VHOST_NET_F_VIRTIO_NET_HDR) |
	(1ULL << VIRTIO_NET_F_MRG_RXBUF) |
	(1ULL << VIRTIO_F_ACCESS_PLATFORM) |
	(1ULL << VIRTIO_F_RING_RESET) |
	(1ULL << VIRTIO_F_IN_ORDER),
	VIRTIO_BIT(VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO) |
	VIRTIO_BIT(VIRTIO_NET_F_HOST_UDP_TUNNEL_GSO),
static const int vhost_net_bits[] = {
	VHOST_FEATURES,
	VHOST_NET_F_VIRTIO_NET_HDR,
	VIRTIO_NET_F_MRG_RXBUF,
	VIRTIO_F_ACCESS_PLATFORM,
	VIRTIO_F_RING_RESET,
	VIRTIO_F_IN_ORDER,
	VIRTIO_NET_F_GUEST_UDP_TUNNEL_GSO,
	VIRTIO_NET_F_HOST_UDP_TUNNEL_GSO
};

enum {
@@ -1731,7 +1731,8 @@ static long vhost_net_set_owner(struct vhost_net *n)
static long vhost_net_ioctl(struct file *f, unsigned int ioctl,
			    unsigned long arg)
{
	u64 all_features[VIRTIO_FEATURES_DWORDS];
	const DEFINE_VHOST_FEATURES_ARRAY(vhost_net_features, vhost_net_bits);
	u64 all_features[VIRTIO_FEATURES_U64S];
	struct vhost_net *n = f->private_data;
	void __user *argp = (void __user *)arg;
	u64 __user *featurep = argp;
@@ -1763,7 +1764,7 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl,

		/* Copy the net features, up to the user-provided buffer size */
		argp += sizeof(u64);
		copied = min(count, VIRTIO_FEATURES_DWORDS);
		copied = min(count, (u64)VIRTIO_FEATURES_U64S);
		if (copy_to_user(argp, vhost_net_features,
				 copied * sizeof(u64)))
			return -EFAULT;
@@ -1778,13 +1779,13 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl,

		virtio_features_zero(all_features);
		argp += sizeof(u64);
		copied = min(count, VIRTIO_FEATURES_DWORDS);
		copied = min(count, (u64)VIRTIO_FEATURES_U64S);
		if (copy_from_user(all_features, argp, copied * sizeof(u64)))
			return -EFAULT;

		/*
		 * Any feature specified by user-space above
		 * VIRTIO_FEATURES_MAX is not supported by definition.
		 * VIRTIO_FEATURES_BITS is not supported by definition.
		 */
		for (i = copied; i < count; ++i) {
			if (copy_from_user(&features, featurep + 1 + i,
@@ -1794,7 +1795,7 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl,
				return -EOPNOTSUPP;
		}

		for (i = 0; i < VIRTIO_FEATURES_DWORDS; i++)
		for (i = 0; i < VIRTIO_FEATURES_U64S; i++)
			if (all_features[i] & ~vhost_net_features[i])
				return -EOPNOTSUPP;

Loading