DPDK patches and discussions
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>,
	dev@dpdk.org, yliu@fridaylinux.org, tiwei.bie@intel.com,
	jianfeng.tan@intel.com, lprosek@redhat.com, lersek@redhat.com
Subject: Re: [dpdk-dev] [PATCH v5 0/4] Vhost: fix mq=on but VIRTIO_NET_F_MQ not negotiated
Date: Wed, 13 Dec 2017 10:15:22 +0100	[thread overview]
Message-ID: <b82c26c4-9863-62cf-d741-11162362fcef@redhat.com> (raw)
In-Reply-To: <20171213085109.9891-1-maxime.coquelin@redhat.com>

On 13/12/2017 09:51, Maxime Coquelin wrote:
> This series fixes this by destroying all but first queue pair in
> the backend if VIRTIO_NET_F_MQ isn't negotiated. First patches
> makes sure that VHOST_USER_SET_FEATURES request doesn't change
> Virtio features while the device is running, which should never
> happen as per the Virtio spec. This helps to make sure vitqueues
> aren't destroyed while being processed, but also protect from
> other illegal features changes (e.g. VIRTIO_NET_F_MRG_RXBUF).

Hi Maxime,

I think this series is wrong from the virtio spec's point of view.  If
the driver requests VIRTIO_NET_F_MQ, that does not mean "the driver
knows about multiqueue", it only means that "the driver wants to read
max_virtqueue_pairs" from configuration space.

Just like it's perfectly fine for a device to propose VIRTIO_NET_F_MQ
and set max_virtqueue_pairs=1, a driver can negotiate VIRTIO_NET_F_MQ
and then skip initialization of some virtqueues.

In fact, for virtio-net there is an explicit way to say how many
virtqueue pairs are available; the virtio spec's section 5.1.5 (Network
device, Device Initialization) mentions that

	Even with VIRTIO_NET_F_MQ, only receiveq1, transmitq1 and
	controlq are used by default. The driver would send the
	VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET command specifying the number of
	the transmit and receive queues to use.

Thanks,

Paolo

  parent reply	other threads:[~2017-12-13  9:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13  8:51 Maxime Coquelin
2017-12-13  8:51 ` [dpdk-dev] [PATCH v5 1/4] vhost: prevent features to be changed while device is running Maxime Coquelin
2017-12-13  8:51 ` [dpdk-dev] [PATCH v5 2/4] vhost: propagate VHOST_USER_SET_FEATURES handling error Maxime Coquelin
2017-12-13  8:51 ` [dpdk-dev] [PATCH v5 3/4] vhost: extract virtqueue cleaning and freeing functions Maxime Coquelin
2017-12-13  8:51 ` [dpdk-dev] [PATCH v5 4/4] vhost: destroy unused virtqueues when multiqueue not negotiated Maxime Coquelin
2017-12-13  9:15 ` Paolo Bonzini [this message]
2017-12-13 10:11   ` [dpdk-dev] [PATCH v5 0/4] Vhost: fix mq=on but VIRTIO_NET_F_MQ " Maxime Coquelin
2017-12-13 10:24     ` Paolo Bonzini
2017-12-13 11:23       ` Laszlo Ersek
2018-01-08 14:36 ` Yuanhan Liu

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=b82c26c4-9863-62cf-d741-11162362fcef@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=lersek@redhat.com \
    --cc=lprosek@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=tiwei.bie@intel.com \
    --cc=yliu@fridaylinux.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: 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 NNTP newsgroup(s).