From: Jason Wang <jasowang@redhat.com> To: Stefano Garzarella <sgarzare@redhat.com>, virtualization@lists.linux-foundation.org Cc: Xie Yongji <xieyongji@bytedance.com>, kvm@vger.kernel.org, Laurent Vivier <lvivier@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Max Gurtovoy <mgurtovoy@nvidia.com>, linux-kernel@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com> Subject: Re: [PATCH v3 04/13] vringh: explain more about cleaning riov and wiov Date: Fri, 5 Feb 2021 11:18:36 +0800 [thread overview] Message-ID: <4a4bf8ad-5853-c054-4d04-450f1966c9a2@redhat.com> (raw) In-Reply-To: <20210204172230.85853-5-sgarzare@redhat.com> On 2021/2/5 上午1:22, Stefano Garzarella wrote: > riov and wiov can be reused with subsequent calls of vringh_getdesc_*(). > > Let's add a paragraph in the documentation of these functions to better > explain when riov and wiov need to be cleaned up. > > Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> > --- > drivers/vhost/vringh.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) Acked-by: Jason Wang <jasowang@redhat.com> > > diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c > index bee63d68201a..2a88e087afd8 100644 > --- a/drivers/vhost/vringh.c > +++ b/drivers/vhost/vringh.c > @@ -662,7 +662,10 @@ EXPORT_SYMBOL(vringh_init_user); > * *head will be vrh->vring.num. You may be able to ignore an invalid > * descriptor, but there's not much you can do with an invalid ring. > * > - * Note that you may need to clean up riov and wiov, even on error! > + * Note that you can reuse riov and wiov with subsequent calls. Content is > + * overwritten and memory reallocated if more space is needed. > + * When you don't have to use riov and wiov anymore, you should clean up them > + * calling vringh_iov_cleanup() to release the memory, even on error! > */ > int vringh_getdesc_user(struct vringh *vrh, > struct vringh_iov *riov, > @@ -932,7 +935,10 @@ EXPORT_SYMBOL(vringh_init_kern); > * *head will be vrh->vring.num. You may be able to ignore an invalid > * descriptor, but there's not much you can do with an invalid ring. > * > - * Note that you may need to clean up riov and wiov, even on error! > + * Note that you can reuse riov and wiov with subsequent calls. Content is > + * overwritten and memory reallocated if more space is needed. > + * When you don't have to use riov and wiov anymore, you should clean up them > + * calling vringh_kiov_cleanup() to release the memory, even on error! > */ > int vringh_getdesc_kern(struct vringh *vrh, > struct vringh_kiov *riov, > @@ -1292,7 +1298,10 @@ EXPORT_SYMBOL(vringh_set_iotlb); > * *head will be vrh->vring.num. You may be able to ignore an invalid > * descriptor, but there's not much you can do with an invalid ring. > * > - * Note that you may need to clean up riov and wiov, even on error! > + * Note that you can reuse riov and wiov with subsequent calls. Content is > + * overwritten and memory reallocated if more space is needed. > + * When you don't have to use riov and wiov anymore, you should clean up them > + * calling vringh_kiov_cleanup() to release the memory, even on error! > */ > int vringh_getdesc_iotlb(struct vringh *vrh, > struct vringh_kiov *riov,
WARNING: multiple messages have this Message-ID (diff)
From: Jason Wang <jasowang@redhat.com> To: Stefano Garzarella <sgarzare@redhat.com>, virtualization@lists.linux-foundation.org Cc: Laurent Vivier <lvivier@redhat.com>, Max Gurtovoy <mgurtovoy@nvidia.com>, kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>, linux-kernel@vger.kernel.org, Xie Yongji <xieyongji@bytedance.com>, Stefan Hajnoczi <stefanha@redhat.com> Subject: Re: [PATCH v3 04/13] vringh: explain more about cleaning riov and wiov Date: Fri, 5 Feb 2021 11:18:36 +0800 [thread overview] Message-ID: <4a4bf8ad-5853-c054-4d04-450f1966c9a2@redhat.com> (raw) In-Reply-To: <20210204172230.85853-5-sgarzare@redhat.com> On 2021/2/5 上午1:22, Stefano Garzarella wrote: > riov and wiov can be reused with subsequent calls of vringh_getdesc_*(). > > Let's add a paragraph in the documentation of these functions to better > explain when riov and wiov need to be cleaned up. > > Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> > --- > drivers/vhost/vringh.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) Acked-by: Jason Wang <jasowang@redhat.com> > > diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c > index bee63d68201a..2a88e087afd8 100644 > --- a/drivers/vhost/vringh.c > +++ b/drivers/vhost/vringh.c > @@ -662,7 +662,10 @@ EXPORT_SYMBOL(vringh_init_user); > * *head will be vrh->vring.num. You may be able to ignore an invalid > * descriptor, but there's not much you can do with an invalid ring. > * > - * Note that you may need to clean up riov and wiov, even on error! > + * Note that you can reuse riov and wiov with subsequent calls. Content is > + * overwritten and memory reallocated if more space is needed. > + * When you don't have to use riov and wiov anymore, you should clean up them > + * calling vringh_iov_cleanup() to release the memory, even on error! > */ > int vringh_getdesc_user(struct vringh *vrh, > struct vringh_iov *riov, > @@ -932,7 +935,10 @@ EXPORT_SYMBOL(vringh_init_kern); > * *head will be vrh->vring.num. You may be able to ignore an invalid > * descriptor, but there's not much you can do with an invalid ring. > * > - * Note that you may need to clean up riov and wiov, even on error! > + * Note that you can reuse riov and wiov with subsequent calls. Content is > + * overwritten and memory reallocated if more space is needed. > + * When you don't have to use riov and wiov anymore, you should clean up them > + * calling vringh_kiov_cleanup() to release the memory, even on error! > */ > int vringh_getdesc_kern(struct vringh *vrh, > struct vringh_kiov *riov, > @@ -1292,7 +1298,10 @@ EXPORT_SYMBOL(vringh_set_iotlb); > * *head will be vrh->vring.num. You may be able to ignore an invalid > * descriptor, but there's not much you can do with an invalid ring. > * > - * Note that you may need to clean up riov and wiov, even on error! > + * Note that you can reuse riov and wiov with subsequent calls. Content is > + * overwritten and memory reallocated if more space is needed. > + * When you don't have to use riov and wiov anymore, you should clean up them > + * calling vringh_kiov_cleanup() to release the memory, even on error! > */ > int vringh_getdesc_iotlb(struct vringh *vrh, > struct vringh_kiov *riov, _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2021-02-05 3:20 UTC|newest] Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-02-04 17:22 [PATCH v3 00/13] vdpa: add vdpa simulator for block device Stefano Garzarella 2021-02-04 17:22 ` Stefano Garzarella 2021-02-04 17:22 ` [PATCH v3 01/13] vdpa_sim: use iova module to allocate IOVA addresses Stefano Garzarella 2021-02-04 17:22 ` Stefano Garzarella 2021-02-04 17:22 ` [PATCH v3 02/13] vringh: add 'iotlb_lock' to synchronize iotlb accesses Stefano Garzarella 2021-02-04 17:22 ` Stefano Garzarella 2021-02-04 17:22 ` [PATCH v3 03/13] vringh: reset kiov 'consumed' field in __vringh_iov() Stefano Garzarella 2021-02-04 17:22 ` Stefano Garzarella 2021-02-05 3:18 ` Jason Wang 2021-02-05 3:18 ` Jason Wang 2021-02-04 17:22 ` [PATCH v3 04/13] vringh: explain more about cleaning riov and wiov Stefano Garzarella 2021-02-04 17:22 ` Stefano Garzarella 2021-02-05 3:18 ` Jason Wang [this message] 2021-02-05 3:18 ` Jason Wang 2021-02-04 17:22 ` [PATCH v3 05/13] vringh: implement vringh_kiov_advance() Stefano Garzarella 2021-02-04 17:22 ` Stefano Garzarella 2021-02-04 17:22 ` [PATCH v3 06/13] vringh: add vringh_kiov_length() helper Stefano Garzarella 2021-02-04 17:22 ` Stefano Garzarella 2021-02-04 17:22 ` [PATCH v3 07/13] vdpa_sim: cleanup kiovs in vdpasim_free() Stefano Garzarella 2021-02-04 17:22 ` Stefano Garzarella 2021-02-04 17:22 ` [PATCH v3 08/13] vdpa: add return value to get_config/set_config callbacks Stefano Garzarella 2021-02-04 17:22 ` Stefano Garzarella 2021-02-04 22:31 ` kernel test robot 2021-02-04 22:31 ` kernel test robot 2021-02-04 22:31 ` kernel test robot 2021-02-04 22:39 ` Stefano Garzarella 2021-02-04 22:39 ` Stefano Garzarella 2021-02-04 22:39 ` Stefano Garzarella 2021-02-05 3:20 ` Jason Wang 2021-02-05 3:20 ` Jason Wang 2021-02-05 8:48 ` Stefano Garzarella 2021-02-05 8:48 ` Stefano Garzarella 2021-02-05 14:11 ` Michael S. Tsirkin 2021-02-05 14:11 ` Michael S. Tsirkin 2021-02-05 14:17 ` Stefano Garzarella 2021-02-05 14:17 ` Stefano Garzarella 2021-02-04 17:22 ` [PATCH v3 09/13] vhost/vdpa: remove vhost_vdpa_config_validate() Stefano Garzarella 2021-02-04 17:22 ` Stefano Garzarella 2021-02-05 3:27 ` Jason Wang 2021-02-05 3:27 ` Jason Wang 2021-02-05 9:16 ` Stefano Garzarella 2021-02-05 9:16 ` Stefano Garzarella 2021-02-05 13:32 ` Michael S. Tsirkin 2021-02-05 13:32 ` Michael S. Tsirkin 2021-02-05 14:17 ` Stefano Garzarella 2021-02-05 14:17 ` Stefano Garzarella 2021-02-08 4:13 ` Jason Wang 2021-02-08 4:13 ` Jason Wang 2021-02-04 17:22 ` [PATCH v3 10/13] vhost/vdpa: Remove the restriction that only supports virtio-net devices Stefano Garzarella 2021-02-04 17:22 ` Stefano Garzarella 2021-02-04 17:22 ` [PATCH v3 11/13] vdpa: add vdpa simulator for block device Stefano Garzarella 2021-02-04 17:22 ` Stefano Garzarella 2021-02-04 17:22 ` [PATCH v3 12/13] vdpa_sim_blk: implement ramdisk behaviour Stefano Garzarella 2021-02-04 17:22 ` Stefano Garzarella 2021-02-04 17:22 ` [PATCH v3 13/13] vdpa_sim_blk: handle VIRTIO_BLK_T_GET_ID Stefano Garzarella 2021-02-04 17:22 ` Stefano Garzarella
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=4a4bf8ad-5853-c054-4d04-450f1966c9a2@redhat.com \ --to=jasowang@redhat.com \ --cc=kvm@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=lvivier@redhat.com \ --cc=mgurtovoy@nvidia.com \ --cc=mst@redhat.com \ --cc=sgarzare@redhat.com \ --cc=stefanha@redhat.com \ --cc=virtualization@lists.linux-foundation.org \ --cc=xieyongji@bytedance.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.