Xuan Zhuo
2022-Mar-08 12:35 UTC
[PATCH v7 21/26] virtio: add helper virtio_find_vqs_ctx_size()
Introduce helper virtio_find_vqs_ctx_size() to call find_vqs and specify
the maximum size of each vq ring.
Signed-off-by: Xuan Zhuo <xuanzhuo at linux.alibaba.com>
---
include/linux/virtio_config.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index 5157524d8036..921d8610db0c 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -233,6 +233,18 @@ int virtio_find_vqs_ctx(struct virtio_device *vdev,
unsigned nvqs,
desc, NULL);
}
+static inline
+int virtio_find_vqs_ctx_size(struct virtio_device *vdev, u32 nvqs,
+ struct virtqueue *vqs[],
+ vq_callback_t *callbacks[],
+ const char * const names[],
+ const bool *ctx, struct irq_affinity *desc,
+ u32 sizes[])
+{
+ return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, ctx,
+ desc, sizes);
+}
+
/**
* virtio_reset_vq - reset a queue individually
* @vq: the virtqueue
--
2.31.0
Jason Wang
2022-Mar-09 09:04 UTC
[PATCH v7 21/26] virtio: add helper virtio_find_vqs_ctx_size()
? 2022/3/8 ??8:35, Xuan Zhuo ??:> Introduce helper virtio_find_vqs_ctx_size() to call find_vqs and specify > the maximum size of each vq ring. > > Signed-off-by: Xuan Zhuo <xuanzhuo at linux.alibaba.com> > --- > include/linux/virtio_config.h | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h > index 5157524d8036..921d8610db0c 100644 > --- a/include/linux/virtio_config.h > +++ b/include/linux/virtio_config.h > @@ -233,6 +233,18 @@ int virtio_find_vqs_ctx(struct virtio_device *vdev, unsigned nvqs, > desc, NULL); > } > > +static inline > +int virtio_find_vqs_ctx_size(struct virtio_device *vdev, u32 nvqs, > + struct virtqueue *vqs[], > + vq_callback_t *callbacks[], > + const char * const names[], > + const bool *ctx, struct irq_affinity *desc, > + u32 sizes[]) > +{ > + return vdev->config->find_vqs(vdev, nvqs, vqs, callbacks, names, ctx, > + desc, sizes); > +}Do we need to convert all the open coded direct call to find_vqs() other than net? Thanks> + > /** > * virtio_reset_vq - reset a queue individually > * @vq: the virtqueue