From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> To: "Michael S. Tsirkin" <mst@redhat.com> Cc: kvm@vger.kernel.org, linux-remoteproc@vger.kernel.org, virtualization@lists.linux-foundation.org, sound-open-firmware@alsa-project.org, Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>, Liam Girdwood <liam.r.girdwood@linux.intel.com>, Jason Wang <jasowang@redhat.com>, Ohad Ben-Cohen <ohad@wizery.com>, Bjorn Andersson <bjorn.andersson@linaro.org>, Mathieu Poirier <mathieu.poirier@linaro.org>, Vincent Whitchurch <vincent.whitchurch@axis.com> Subject: Re: [PATCH v4 4/4] vhost: add an RPMsg API Date: Tue, 25 Aug 2020 15:41:10 +0200 [thread overview] Message-ID: <20200825134109.GA9822@ubuntu> (raw) In-Reply-To: <20200812123243.GA10218@ubuntu> Hi Michael, ...back from holidays and still unsure what your preferred solution for the message layout would be: On Wed, Aug 12, 2020 at 02:32:43PM +0200, Guennadi Liakhovetski wrote: > Hi Michael, > > Thanks for a review. > > On Mon, Aug 10, 2020 at 09:44:15AM -0400, Michael S. Tsirkin wrote: > > On Tue, Aug 04, 2020 at 05:19:17PM +0200, Guennadi Liakhovetski wrote: [snip] > > > > > +static int vhost_rpmsg_get_single(struct vhost_virtqueue *vq) > > > > > +{ > > > > > + struct vhost_rpmsg *vr = container_of(vq->dev, struct vhost_rpmsg, dev); > > > > > + unsigned int out, in; > > > > > + int head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), &out, &in, > > > > > + NULL, NULL); > > > > > + if (head < 0) { > > > > > + vq_err(vq, "%s(): error %d getting buffer\n", > > > > > + __func__, head); > > > > > + return head; > > > > > + } > > > > > + > > > > > + /* Nothing new? */ > > > > > + if (head == vq->num) > > > > > + return head; > > > > > + > > > > > + if (vq == &vr->vq[VIRTIO_RPMSG_RESPONSE] && (out || in != 1)) { > > > > > > > > This in != 1 looks like a dependency on a specific message layout. > > > > virtio spec says to avoid these. Using iov iters it's not too hard to do > > > > ... > > > > > > This is an RPMsg VirtIO implementation, and it has to match the virtio_rpmsg_bus.c > > > driver, and that one has specific VirtIO queue and message usage patterns. > > > > That could be fine for legacy virtio, but now you are claiming support > > for virtio 1, so need to fix these assumptions in the device. > > I can just deop these checks without changing anything else, that still would work. > I could also make this work with "any" layout - either ignoring any left-over > buffers or maybe even getting them one by one. But I wouldn't even be able to test > those modes without modifying / breaking the current virtio-rpmsg driver. What's > the preferred solution? Could you elaborate a bit please? Thanks Guennadi
WARNING: multiple messages have this Message-ID (diff)
From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> To: "Michael S. Tsirkin" <mst@redhat.com> Cc: Ohad Ben-Cohen <ohad@wizery.com>, Mathieu Poirier <mathieu.poirier@linaro.org>, kvm@vger.kernel.org, Vincent Whitchurch <vincent.whitchurch@axis.com>, linux-remoteproc@vger.kernel.org, Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>, virtualization@lists.linux-foundation.org, Liam Girdwood <liam.r.girdwood@linux.intel.com>, Bjorn Andersson <bjorn.andersson@linaro.org>, sound-open-firmware@alsa-project.org Subject: Re: [PATCH v4 4/4] vhost: add an RPMsg API Date: Tue, 25 Aug 2020 15:41:10 +0200 [thread overview] Message-ID: <20200825134109.GA9822@ubuntu> (raw) In-Reply-To: <20200812123243.GA10218@ubuntu> Hi Michael, ...back from holidays and still unsure what your preferred solution for the message layout would be: On Wed, Aug 12, 2020 at 02:32:43PM +0200, Guennadi Liakhovetski wrote: > Hi Michael, > > Thanks for a review. > > On Mon, Aug 10, 2020 at 09:44:15AM -0400, Michael S. Tsirkin wrote: > > On Tue, Aug 04, 2020 at 05:19:17PM +0200, Guennadi Liakhovetski wrote: [snip] > > > > > +static int vhost_rpmsg_get_single(struct vhost_virtqueue *vq) > > > > > +{ > > > > > + struct vhost_rpmsg *vr = container_of(vq->dev, struct vhost_rpmsg, dev); > > > > > + unsigned int out, in; > > > > > + int head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), &out, &in, > > > > > + NULL, NULL); > > > > > + if (head < 0) { > > > > > + vq_err(vq, "%s(): error %d getting buffer\n", > > > > > + __func__, head); > > > > > + return head; > > > > > + } > > > > > + > > > > > + /* Nothing new? */ > > > > > + if (head == vq->num) > > > > > + return head; > > > > > + > > > > > + if (vq == &vr->vq[VIRTIO_RPMSG_RESPONSE] && (out || in != 1)) { > > > > > > > > This in != 1 looks like a dependency on a specific message layout. > > > > virtio spec says to avoid these. Using iov iters it's not too hard to do > > > > ... > > > > > > This is an RPMsg VirtIO implementation, and it has to match the virtio_rpmsg_bus.c > > > driver, and that one has specific VirtIO queue and message usage patterns. > > > > That could be fine for legacy virtio, but now you are claiming support > > for virtio 1, so need to fix these assumptions in the device. > > I can just deop these checks without changing anything else, that still would work. > I could also make this work with "any" layout - either ignoring any left-over > buffers or maybe even getting them one by one. But I wouldn't even be able to test > those modes without modifying / breaking the current virtio-rpmsg driver. What's > the preferred solution? Could you elaborate a bit please? Thanks Guennadi _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2020-08-25 13:46 UTC|newest] Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-22 15:09 [PATCH v4 0/4] Add a vhost RPMsg API Guennadi Liakhovetski 2020-07-22 15:09 ` [PATCH v4 1/4] vhost: convert VHOST_VSOCK_SET_RUNNING to a generic ioctl Guennadi Liakhovetski 2020-07-23 8:34 ` Stefano Garzarella 2020-07-22 15:09 ` [PATCH v4 2/4] rpmsg: move common structures and defines to headers Guennadi Liakhovetski 2020-07-22 15:09 ` Guennadi Liakhovetski 2020-08-11 17:51 ` Mathieu Poirier 2020-07-22 15:09 ` [PATCH v4 3/4] rpmsg: update documentation Guennadi Liakhovetski 2020-07-22 15:09 ` [PATCH v4 4/4] vhost: add an RPMsg API Guennadi Liakhovetski 2020-08-04 14:27 ` Michael S. Tsirkin 2020-08-04 14:27 ` Michael S. Tsirkin 2020-08-04 15:19 ` Guennadi Liakhovetski 2020-08-04 15:19 ` Guennadi Liakhovetski 2020-08-10 13:44 ` Michael S. Tsirkin 2020-08-10 13:44 ` Michael S. Tsirkin 2020-08-12 12:32 ` Guennadi Liakhovetski 2020-08-12 12:32 ` Guennadi Liakhovetski 2020-08-25 13:41 ` Guennadi Liakhovetski [this message] 2020-08-25 13:41 ` Guennadi Liakhovetski 2020-08-25 13:53 ` Michael S. Tsirkin 2020-08-25 13:53 ` Michael S. Tsirkin 2020-07-30 16:08 ` [PATCH v4 0/4] Add a vhost " Michael S. Tsirkin 2020-07-30 16:08 ` Michael S. Tsirkin 2020-07-31 5:47 ` Guennadi Liakhovetski 2020-07-31 5:47 ` Guennadi Liakhovetski 2020-08-03 13:25 ` Mathieu Poirier 2020-08-03 20:46 ` Michael S. Tsirkin 2020-08-03 20:46 ` Michael S. Tsirkin 2020-08-04 13:37 ` Mathieu Poirier 2020-08-04 14:07 ` Michael S. Tsirkin 2020-08-04 14:07 ` Michael S. Tsirkin 2020-08-04 19:30 ` Mathieu Poirier 2020-08-05 11:34 ` Michael S. Tsirkin 2020-08-05 11:34 ` Michael S. Tsirkin 2020-08-04 12:26 ` Michael S. Tsirkin 2020-08-04 12:26 ` Michael S. Tsirkin 2020-08-04 13:19 ` Guennadi Liakhovetski 2020-08-04 13:19 ` Guennadi Liakhovetski 2020-08-04 14:10 ` Michael S. Tsirkin 2020-08-04 14:10 ` Michael S. Tsirkin 2020-08-04 14:46 ` Guennadi Liakhovetski 2020-08-04 14:46 ` Guennadi Liakhovetski
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=20200825134109.GA9822@ubuntu \ --to=guennadi.liakhovetski@linux.intel.com \ --cc=bjorn.andersson@linaro.org \ --cc=jasowang@redhat.com \ --cc=kvm@vger.kernel.org \ --cc=liam.r.girdwood@linux.intel.com \ --cc=linux-remoteproc@vger.kernel.org \ --cc=mathieu.poirier@linaro.org \ --cc=mst@redhat.com \ --cc=ohad@wizery.com \ --cc=pierre-louis.bossart@linux.intel.com \ --cc=sound-open-firmware@alsa-project.org \ --cc=vincent.whitchurch@axis.com \ --cc=virtualization@lists.linux-foundation.org \ /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.