Displaying 6 results from an estimated 6 matches for "err_cdev_add".
2020 Feb 19
1
[PATCH] vhost: introduce vDPA based backend
...-vdpa");
> > > + if (r)
> > > + goto err_alloc_chrdev;
> > > +
> > > + cdev_init(&vhost_vdpa.cdev, &vhost_vdpa_fops);
> > > + r = cdev_add(&vhost_vdpa.cdev, vhost_vdpa.devt, MINORMASK + 1);
> > > + if (r)
> > > + goto err_cdev_add;
> >
> > It is very strange, is the intention to create a single global char
> > dev?
>
> No. It's to create a per-vdpa char dev named
> vhost-vdpa/$vdpa_device_index in dev.
>
> I followed the code in VFIO which creates char dev
> vfio/$GROUP dynamically,...
2020 Feb 18
2
[PATCH] vhost: introduce vDPA based backend
...v_region(&vhost_vdpa.devt, 0, MINORMASK + 1,
> + "vhost-vdpa");
> + if (r)
> + goto err_alloc_chrdev;
> +
> + cdev_init(&vhost_vdpa.cdev, &vhost_vdpa_fops);
> + r = cdev_add(&vhost_vdpa.cdev, vhost_vdpa.devt, MINORMASK + 1);
> + if (r)
> + goto err_cdev_add;
It is very strange, is the intention to create a single global char
dev?
If so, why is there this:
+static int vhost_vdpa_open(struct inode *inode, struct file *filep)
+{
+ struct vhost_vdpa *v;
+ struct vhost_dev *dev;
+ struct vhost_virtqueue **vqs;
+ int nvqs, i, r, opened;
+
+ v = vhost_vdp...
2020 Feb 18
2
[PATCH] vhost: introduce vDPA based backend
...v_region(&vhost_vdpa.devt, 0, MINORMASK + 1,
> + "vhost-vdpa");
> + if (r)
> + goto err_alloc_chrdev;
> +
> + cdev_init(&vhost_vdpa.cdev, &vhost_vdpa_fops);
> + r = cdev_add(&vhost_vdpa.cdev, vhost_vdpa.devt, MINORMASK + 1);
> + if (r)
> + goto err_cdev_add;
It is very strange, is the intention to create a single global char
dev?
If so, why is there this:
+static int vhost_vdpa_open(struct inode *inode, struct file *filep)
+{
+ struct vhost_vdpa *v;
+ struct vhost_dev *dev;
+ struct vhost_virtqueue **vqs;
+ int nvqs, i, r, opened;
+
+ v = vhost_vdp...
2020 Feb 19
0
[PATCH] vhost: introduce vDPA based backend
...ASK + 1,
> > + "vhost-vdpa");
> > + if (r)
> > + goto err_alloc_chrdev;
> > +
> > + cdev_init(&vhost_vdpa.cdev, &vhost_vdpa_fops);
> > + r = cdev_add(&vhost_vdpa.cdev, vhost_vdpa.devt, MINORMASK + 1);
> > + if (r)
> > + goto err_cdev_add;
>
> It is very strange, is the intention to create a single global char
> dev?
No. It's to create a per-vdpa char dev named
vhost-vdpa/$vdpa_device_index in dev.
I followed the code in VFIO which creates char dev
vfio/$GROUP dynamically, e.g.:
https://github.com/torvalds/linux/blo...
2020 Feb 04
10
[PATCH] vhost: introduce vDPA based backend
...v_region(&vhost_vdpa.devt, 0, MINORMASK + 1,
> + "vhost-vdpa");
> + if (r)
> + goto err_alloc_chrdev;
> +
> + cdev_init(&vhost_vdpa.cdev, &vhost_vdpa_fops);
> + r = cdev_add(&vhost_vdpa.cdev, vhost_vdpa.devt, MINORMASK + 1);
> + if (r)
> + goto err_cdev_add;
> +
> + r = register_vdpa_driver(&vhost_vdpa_driver);
> + if (r)
> + goto err_register_vdpa_driver;
> +
> + return 0;
> +
> +err_register_vdpa_driver:
> + cdev_del(&vhost_vdpa.cdev);
> +err_cdev_add:
> + unregister_chrdev_region(vhost_vdpa.devt, MINORMASK...
2020 Feb 04
10
[PATCH] vhost: introduce vDPA based backend
...v_region(&vhost_vdpa.devt, 0, MINORMASK + 1,
> + "vhost-vdpa");
> + if (r)
> + goto err_alloc_chrdev;
> +
> + cdev_init(&vhost_vdpa.cdev, &vhost_vdpa_fops);
> + r = cdev_add(&vhost_vdpa.cdev, vhost_vdpa.devt, MINORMASK + 1);
> + if (r)
> + goto err_cdev_add;
> +
> + r = register_vdpa_driver(&vhost_vdpa_driver);
> + if (r)
> + goto err_register_vdpa_driver;
> +
> + return 0;
> +
> +err_register_vdpa_driver:
> + cdev_del(&vhost_vdpa.cdev);
> +err_cdev_add:
> + unregister_chrdev_region(vhost_vdpa.devt, MINORMASK...