linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: Jason Wang <jasowang@redhat.com>
Cc: virtualization@lists.linux.dev,
	"Richard Weinberger" <richard@nod.at>,
	"Anton Ivanov" <anton.ivanov@cambridgegreys.com>,
	"Johannes Berg" <johannes@sipsolutions.net>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Vadim Pasternak" <vadimp@nvidia.com>,
	"Bjorn Andersson" <andersson@kernel.org>,
	"Mathieu Poirier" <mathieu.poirier@linaro.org>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"Halil Pasic" <pasic@linux.ibm.com>,
	"Eric Farman" <farman@linux.ibm.com>,
	"Heiko Carstens" <hca@linux.ibm.com>,
	"Vasily Gorbik" <gor@linux.ibm.com>,
	"Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Sven Schnelle" <svens@linux.ibm.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"David Hildenbrand" <david@redhat.com>,
	linux-um@lists.infradead.org,
	platform-driver-x86@vger.kernel.org,
	linux-remoteproc@vger.kernel.org, linux-s390@vger.kernel.org,
	kvm@vger.kernel.org
Subject: Re: [PATCH vhost v5 2/6] virtio: remove support for names array entries being null.
Date: Tue, 26 Mar 2024 15:42:36 +0800	[thread overview]
Message-ID: <1711438956.7547545-3-xuanzhuo@linux.alibaba.com> (raw)
In-Reply-To: <CACGkMEuuNrDkEUnnES-APDVag2=4wjyZi3aEg0+8vY+Bho=BRg@mail.gmail.com>

On Tue, 26 Mar 2024 12:28:34 +0800, Jason Wang <jasowang@redhat.com> wrote:
> On Mon, Mar 25, 2024 at 5:04 PM Xuan Zhuo <xuanzhuo@linux.alibaba.com> wrote:
> >
> > commit 6457f126c888 ("virtio: support reserved vqs") introduced this
> > support. Multiqueue virtio-net use 2N as ctrl vq finally, so the logic
> > doesn't apply. And not one uses this.
> >
> > On the other side, that makes some trouble for us to refactor the
> > find_vqs() params.
> >
> > So I remove this support.
> >
> > Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> > ---
> >  arch/um/drivers/virtio_uml.c             | 5 -----
> >  drivers/platform/mellanox/mlxbf-tmfifo.c | 4 ----
> >  drivers/remoteproc/remoteproc_virtio.c   | 5 -----
> >  drivers/s390/virtio/virtio_ccw.c         | 5 -----
> >  drivers/virtio/virtio_mmio.c             | 5 -----
> >  drivers/virtio/virtio_pci_common.c       | 9 ---------
> >  drivers/virtio/virtio_vdpa.c             | 5 -----
> >  include/linux/virtio_config.h            | 1 -
> >  8 files changed, 39 deletions(-)
> >
> > diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c
> > index 8adca2000e51..1d1e8654b7fc 100644
> > --- a/arch/um/drivers/virtio_uml.c
> > +++ b/arch/um/drivers/virtio_uml.c
> > @@ -1031,11 +1031,6 @@ static int vu_find_vqs(struct virtio_device *vdev, unsigned nvqs,
> >                 return rc;
> >
> >         for (i = 0; i < nvqs; ++i) {
> > -               if (!names[i]) {
> > -                       vqs[i] = NULL;
> > -                       continue;
> > -               }
>
> Does this mean names[i] must not be NULL? If yes, should we fail or
> not? If not, do we need to change the doc?

I think we should make sure that the names[i] must not be NULL.
We should return fail.

>
> [...]
>
> > --- a/include/linux/virtio_config.h
> > +++ b/include/linux/virtio_config.h
> > @@ -56,7 +56,6 @@ typedef void vq_callback_t(struct virtqueue *);
> >   *     callbacks: array of callbacks, for each virtqueue
> >   *             include a NULL entry for vqs that do not need a callback
> >   *     names: array of virtqueue names (mainly for debugging)
> > - *             include a NULL entry for vqs unused by driver
> >   *     Returns 0 on success or error status
> >   * @del_vqs: free virtqueues found by find_vqs().
> >   * @synchronize_cbs: synchronize with the virtqueue callbacks (optional)
>
>
> Since we had other check for names[i] like:
>
>         if (per_vq_vectors) {
>                 /* Best option: one for change interrupt, one per vq. */
>                 nvectors = 1;
>                 for (i = 0; i < nvqs; ++i)
>                         if (names[i] && callbacks[i])
>                                 ++nvectors;
>
> in vp_find_vqs_msix() and maybe other places.

names[i] should always be true. I will check this.

Thanks


>
> > --
> > 2.32.0.3.g01195cf9f
> >
>


  reply	other threads:[~2024-03-26  7:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25  9:04 [PATCH vhost v5 0/6] refactor the params of find_vqs() Xuan Zhuo
2024-03-25  9:04 ` [PATCH vhost v5 1/6] virtio_balloon: remove the dependence where names[] is null Xuan Zhuo
2024-03-25  9:12   ` David Hildenbrand
2024-03-26  7:19     ` Xuan Zhuo
2024-03-26  4:14   ` Jason Wang
2024-03-26  7:18     ` Xuan Zhuo
2024-03-25  9:04 ` [PATCH vhost v5 2/6] virtio: remove support for names array entries being null Xuan Zhuo
2024-03-26  4:28   ` Jason Wang
2024-03-26  7:42     ` Xuan Zhuo [this message]
2024-03-25  9:04 ` [PATCH vhost v5 3/6] virtio: find_vqs: pass struct instead of multi parameters Xuan Zhuo
2024-03-25  9:04 ` [PATCH vhost v5 4/6] virtio: vring_create_virtqueue: " Xuan Zhuo
2024-03-25  9:04 ` [PATCH vhost v5 5/6] virtio: vring_new_virtqueue(): " Xuan Zhuo
2024-03-25  9:04 ` [PATCH vhost v5 6/6] virtio_ring: simplify the parameters of the funcs related to vring_create/new_virtqueue() Xuan Zhuo

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=1711438956.7547545-3-xuanzhuo@linux.alibaba.com \
    --to=xuanzhuo@linux.alibaba.com \
    --cc=agordeev@linux.ibm.com \
    --cc=andersson@kernel.org \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jasowang@redhat.com \
    --cc=johannes@sipsolutions.net \
    --cc=kvm@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mst@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=svens@linux.ibm.com \
    --cc=vadimp@nvidia.com \
    --cc=virtualization@lists.linux.dev \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).