Displaying 20 results from an estimated 25 matches for "get_queue_max".
2019 Sep 27
5
[PATCH] vhost: introduce mdev based hardware backend
..._dev_ops(mdev);
> > + struct vhost_mdev *m;
> > + int nvqs, r;
> > +
> > + m = kzalloc(sizeof(*m), GFP_KERNEL | __GFP_RETRY_MAYFAIL);
> > + if (!m)
> > + return -ENOMEM;
> > +
> > + mutex_init(&m->mutex);
> > +
> > + nvqs = ops->get_queue_max(mdev);
> > + m->nvqs = nvqs;
>
>
> The name could be confusing, get_queue_max() is to get the maximum number of
> entries for a virtqueue supported by this device.
OK. It might be better to rename it to something like:
get_vq_num_max()
which is more consistent with the se...
2019 Sep 27
5
[PATCH] vhost: introduce mdev based hardware backend
..._dev_ops(mdev);
> > + struct vhost_mdev *m;
> > + int nvqs, r;
> > +
> > + m = kzalloc(sizeof(*m), GFP_KERNEL | __GFP_RETRY_MAYFAIL);
> > + if (!m)
> > + return -ENOMEM;
> > +
> > + mutex_init(&m->mutex);
> > +
> > + nvqs = ops->get_queue_max(mdev);
> > + m->nvqs = nvqs;
>
>
> The name could be confusing, get_queue_max() is to get the maximum number of
> entries for a virtqueue supported by this device.
OK. It might be better to rename it to something like:
get_vq_num_max()
which is more consistent with the se...
2019 Sep 27
1
[PATCH] vhost: introduce mdev based hardware backend
...> > > +
> > > > + m = kzalloc(sizeof(*m), GFP_KERNEL | __GFP_RETRY_MAYFAIL);
> > > > + if (!m)
> > > > + return -ENOMEM;
> > > > +
> > > > + mutex_init(&m->mutex);
> > > > +
> > > > + nvqs = ops->get_queue_max(mdev);
> > > > + m->nvqs = nvqs;
> > > The name could be confusing, get_queue_max() is to get the maximum number of
> > > entries for a virtqueue supported by this device.
> > OK. It might be better to rename it to something like:
> >
> > get_vq_...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
...struct vhost_mdev *m;
>>> + int nvqs, r;
>>> +
>>> + m = kzalloc(sizeof(*m), GFP_KERNEL | __GFP_RETRY_MAYFAIL);
>>> + if (!m)
>>> + return -ENOMEM;
>>> +
>>> + mutex_init(&m->mutex);
>>> +
>>> + nvqs = ops->get_queue_max(mdev);
>>> + m->nvqs = nvqs;
>> The name could be confusing, get_queue_max() is to get the maximum number of
>> entries for a virtqueue supported by this device.
> OK. It might be better to rename it to something like:
>
> get_vq_num_max()
>
> which is more c...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...struct mdev_device *mdev = mdev_from_dev(dev);
+ const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev);
+ struct vhost_mdev *m;
+ int nvqs, r;
+
+ m = kzalloc(sizeof(*m), GFP_KERNEL | __GFP_RETRY_MAYFAIL);
+ if (!m)
+ return -ENOMEM;
+
+ mutex_init(&m->mutex);
+
+ nvqs = ops->get_queue_max(mdev);
+ m->nvqs = nvqs;
+
+ m->vqs = kmalloc_array(nvqs, sizeof(struct vhost_virtqueue),
+ GFP_KERNEL);
+ if (!m->vqs) {
+ r = -ENOMEM;
+ goto err;
+ }
+
+ r = vfio_add_group_dev(dev, &vfio_vhost_mdev_dev_ops, m);
+ if (r)
+ goto err;
+
+ m->features = ops->get_featu...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...struct mdev_device *mdev = mdev_from_dev(dev);
+ const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev);
+ struct vhost_mdev *m;
+ int nvqs, r;
+
+ m = kzalloc(sizeof(*m), GFP_KERNEL | __GFP_RETRY_MAYFAIL);
+ if (!m)
+ return -ENOMEM;
+
+ mutex_init(&m->mutex);
+
+ nvqs = ops->get_queue_max(mdev);
+ m->nvqs = nvqs;
+
+ m->vqs = kmalloc_array(nvqs, sizeof(struct vhost_virtqueue),
+ GFP_KERNEL);
+ if (!m->vqs) {
+ r = -ENOMEM;
+ goto err;
+ }
+
+ r = vfio_add_group_dev(dev, &vfio_vhost_mdev_dev_ops, m);
+ if (r)
+ goto err;
+
+ m->features = ops->get_featu...
2019 Sep 25
3
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...ops */
> + u16 (*get_vq_align)(struct mdev_device *mdev);
> + u64 (*get_features)(struct mdev_device *mdev);
> + int (*set_features)(struct mdev_device *mdev, u64 features);
> + void (*set_config_cb)(struct mdev_device *mdev,
> + struct virtio_mdev_callback *cb);
> + u16 (*get_queue_max)(struct mdev_device *mdev);
> + u32 (*get_device_id)(struct mdev_device *mdev);
> + u32 (*get_vendor_id)(struct mdev_device *mdev);
> + u8 (*get_status)(struct mdev_device *mdev);
> + void (*set_status)(struct mdev_device *mdev, u8 status);
> + void (*get_config)(struct mdev_device *...
2019 Sep 25
3
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...ops */
> + u16 (*get_vq_align)(struct mdev_device *mdev);
> + u64 (*get_features)(struct mdev_device *mdev);
> + int (*set_features)(struct mdev_device *mdev, u64 features);
> + void (*set_config_cb)(struct mdev_device *mdev,
> + struct virtio_mdev_callback *cb);
> + u16 (*get_queue_max)(struct mdev_device *mdev);
> + u32 (*get_device_id)(struct mdev_device *mdev);
> + u32 (*get_vendor_id)(struct mdev_device *mdev);
> + u8 (*get_status)(struct mdev_device *mdev);
> + void (*set_status)(struct mdev_device *mdev, u8 status);
> + void (*get_config)(struct mdev_device *...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
...onst struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev);
> + struct vhost_mdev *m;
> + int nvqs, r;
> +
> + m = kzalloc(sizeof(*m), GFP_KERNEL | __GFP_RETRY_MAYFAIL);
> + if (!m)
> + return -ENOMEM;
> +
> + mutex_init(&m->mutex);
> +
> + nvqs = ops->get_queue_max(mdev);
> + m->nvqs = nvqs;
The name could be confusing, get_queue_max() is to get the maximum
number of entries for a virtqueue supported by this device.
It looks to me that we need another API to query the maximum number of
virtqueues supported by the device.
Thanks
> +
> + m-&...
2019 Sep 25
2
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...ce *mdev);
> > > + u64 (*get_features)(struct mdev_device *mdev);
> > > + int (*set_features)(struct mdev_device *mdev, u64 features);
> > > + void (*set_config_cb)(struct mdev_device *mdev,
> > > + struct virtio_mdev_callback *cb);
> > > + u16 (*get_queue_max)(struct mdev_device *mdev);
> > > + u32 (*get_device_id)(struct mdev_device *mdev);
> > > + u32 (*get_vendor_id)(struct mdev_device *mdev);
> > > + u8 (*get_status)(struct mdev_device *mdev);
> > > + void (*set_status)(struct mdev_device *mdev, u8 status);
> &...
2019 Sep 25
2
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...ce *mdev);
> > > + u64 (*get_features)(struct mdev_device *mdev);
> > > + int (*set_features)(struct mdev_device *mdev, u64 features);
> > > + void (*set_config_cb)(struct mdev_device *mdev,
> > > + struct virtio_mdev_callback *cb);
> > > + u16 (*get_queue_max)(struct mdev_device *mdev);
> > > + u32 (*get_device_id)(struct mdev_device *mdev);
> > > + u32 (*get_vendor_id)(struct mdev_device *mdev);
> > > + u8 (*get_status)(struct mdev_device *mdev);
> > > + void (*set_status)(struct mdev_device *mdev, u8 status);
> &...
2019 Sep 24
3
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...ops */
> + u16 (*get_vq_align)(struct mdev_device *mdev);
> + u64 (*get_features)(struct mdev_device *mdev);
> + int (*set_features)(struct mdev_device *mdev, u64 features);
> + void (*set_config_cb)(struct mdev_device *mdev,
> + struct virtio_mdev_callback *cb);
> + u16 (*get_queue_max)(struct mdev_device *mdev);
> + u32 (*get_device_id)(struct mdev_device *mdev);
> + u32 (*get_vendor_id)(struct mdev_device *mdev);
> + u8 (*get_status)(struct mdev_device *mdev);
> + void (*set_status)(struct mdev_device *mdev, u8 status);
> + void (*get_config)(struct mdev_device *...
2019 Sep 24
0
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...mdev, u16 idx);
+
+ /* Device ops */
+ u16 (*get_vq_align)(struct mdev_device *mdev);
+ u64 (*get_features)(struct mdev_device *mdev);
+ int (*set_features)(struct mdev_device *mdev, u64 features);
+ void (*set_config_cb)(struct mdev_device *mdev,
+ struct virtio_mdev_callback *cb);
+ u16 (*get_queue_max)(struct mdev_device *mdev);
+ u32 (*get_device_id)(struct mdev_device *mdev);
+ u32 (*get_vendor_id)(struct mdev_device *mdev);
+ u8 (*get_status)(struct mdev_device *mdev);
+ void (*set_status)(struct mdev_device *mdev, u8 status);
+ void (*get_config)(struct mdev_device *mdev, unsigned int offset...
2019 Sep 26
0
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...>>>> + u64 (*get_features)(struct mdev_device *mdev);
>>>> + int (*set_features)(struct mdev_device *mdev, u64 features);
>>>> + void (*set_config_cb)(struct mdev_device *mdev,
>>>> + struct virtio_mdev_callback *cb);
>>>> + u16 (*get_queue_max)(struct mdev_device *mdev);
>>>> + u32 (*get_device_id)(struct mdev_device *mdev);
>>>> + u32 (*get_vendor_id)(struct mdev_device *mdev);
>>>> + u8 (*get_status)(struct mdev_device *mdev);
>>>> + void (*set_status)(struct mdev_device *mdev, u8 status)...
2019 Sep 25
0
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...get_vq_align)(struct mdev_device *mdev);
>> + u64 (*get_features)(struct mdev_device *mdev);
>> + int (*set_features)(struct mdev_device *mdev, u64 features);
>> + void (*set_config_cb)(struct mdev_device *mdev,
>> + struct virtio_mdev_callback *cb);
>> + u16 (*get_queue_max)(struct mdev_device *mdev);
>> + u32 (*get_device_id)(struct mdev_device *mdev);
>> + u32 (*get_vendor_id)(struct mdev_device *mdev);
>> + u8 (*get_status)(struct mdev_device *mdev);
>> + void (*set_status)(struct mdev_device *mdev, u8 status);
>> + void (*get_config)(...
2019 Sep 26
1
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
..._device *mdev);
> >> + u64 (*get_features)(struct mdev_device *mdev);
> >> + int (*set_features)(struct mdev_device *mdev, u64 features);
> >> + void (*set_config_cb)(struct mdev_device *mdev,
> >> + struct virtio_mdev_callback *cb);
> >> + u16 (*get_queue_max)(struct mdev_device *mdev);
> >> + u32 (*get_device_id)(struct mdev_device *mdev);
> >> + u32 (*get_vendor_id)(struct mdev_device *mdev);
> >> + u8 (*get_status)(struct mdev_device *mdev);
> >> + void (*set_status)(struct mdev_device *mdev, u8 status);
> >&...
2019 Sep 26
0
[PATCH] vhost: introduce mdev based hardware backend
...onst struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(mdev);
> + struct vhost_mdev *m;
> + int nvqs, r;
> +
> + m = kzalloc(sizeof(*m), GFP_KERNEL | __GFP_RETRY_MAYFAIL);
> + if (!m)
> + return -ENOMEM;
> +
> + mutex_init(&m->mutex);
> +
> + nvqs = ops->get_queue_max(mdev);
> + m->nvqs = nvqs;
> +
> + m->vqs = kmalloc_array(nvqs, sizeof(struct vhost_virtqueue),
> + GFP_KERNEL);
> + if (!m->vqs) {
> + r = -ENOMEM;
> + goto err;
> + }
> +
> + r = vfio_add_group_dev(dev, &vfio_vhost_mdev_dev_ops, m);
> + if...
2019 Oct 21
0
[RFC 2/2] vhost: IFC VF vdpa layer
...>>> +??????? return;
>>> +??? }
>>> +
>>> +??? if (status & VIRTIO_CONFIG_S_DRIVER_OK) {
>>> +??????? ifcvf_start_datapath(adapter);
>>> +??????? return;
>>> +??? }
>>> +}
>>> +
>>> +static u16 ifcvf_mdev_get_queue_max(struct mdev_device *mdev)
>>> +{
>>> +??? return IFCVF_MAX_QUEUES;
>>
>>
>> The name is confusing, it was used to return the maximum queue size.
>> In new version of virtio-mdev, the callback was renamed as
>> get_vq_num_max().
> will change that...
2019 Oct 16
0
[RFC 2/2] vhost: IFC VF vdpa layer
...> +
> + if (status == 0) {
> + ifcvf_stop_datapath(adapter);
> + ifcvf_reset_vring(adapter);
> + return;
> + }
> +
> + if (status & VIRTIO_CONFIG_S_DRIVER_OK) {
> + ifcvf_start_datapath(adapter);
> + return;
> + }
> +}
> +
> +static u16 ifcvf_mdev_get_queue_max(struct mdev_device *mdev)
> +{
> + return IFCVF_MAX_QUEUES;
The name is confusing, it was used to return the maximum queue size. In
new version of virtio-mdev, the callback was renamed as get_vq_num_max().
> +}
> +
> +static struct virtio_mdev_device_ops ifc_mdev_ops = {
> +...
2019 Sep 24
0
[PATCH 4/6] virtio: introduce a mdev based transport
...>
>> + /* Allocate and fill out our active queue description */
>> + info = kmalloc(sizeof(*info), GFP_KERNEL);
>> + if (!info) {
>> + err = -ENOMEM;
>> + goto error_kmalloc;
>> + }
>> +
> Similar to above one.
Ok.
>
>> + num = ops->get_queue_max(mdev);
>> + if (num == 0) {
>> + err = -ENOENT;
>> + goto error_new_virtqueue;
>> + }
>> +
>> + /* Create the vring */
>> + align = ops->get_vq_align(mdev);
>> + vq = vring_create_virtqueue(index, num, align, vdev,
>> + true, true, c...