On Fri, Jun 02, 2023 at 02:52:11PM +0900, Shunsuke Mie wrote:It was missing an explanation. I will address that and review this patch.
Introduce a new memory accessor for vringh. It is able to use vringh to...
virtio rings located on io-memory region.
Signed-off-by: Shunsuke Mie <mie@xxxxxxxxxx>
+/**Hi Mie-san,
+ * vringh_iov_pull_iomem - copy bytes from vring_iov.
as it looks like there will be a v2,
please consider documenting the vrh parameter here.
I do the same.
+ * @riov: the riov as passed to vringh_getdesc_iomem() (updated as we consume)And here.
+ * @dst: the place to copy.
+ * @len: the maximum length to copy.
+ *
+ * Returns the bytes copied <= len or a negative errno.
+ */
+ssize_t vringh_iov_pull_iomem(struct vringh *vrh, struct vringh_kiov *riov,
+ void *dst, size_t len)
+{
+ return vringh_iov_xfer(vrh, riov, dst, len, xfer_from_iomem);
+}
+EXPORT_SYMBOL(vringh_iov_pull_iomem);
+
+/**
+ * vringh_iov_push_iomem - copy bytes into vring_iov.
+ * @wiov: the wiov as passed to vringh_getdesc_iomem() (updated as we consume)...
+ * @src: the place to copy from.
+ * @len: the maximum length to copy.
+ *
+ * Returns the bytes copied <= len or a negative errno.
+ */
+ssize_t vringh_iov_push_iomem(struct vringh *vrh, struct vringh_kiov *wiov,
+ const void *src, size_t len)
+{
+ return vringh_iov_xfer(vrh, wiov, (void *)src, len, xfer_to_iomem);
+}
+EXPORT_SYMBOL(vringh_iov_push_iomem);