From: Marcel Apfelbaum <marcel@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: snabb-devel@googlegroups.com, thibaut.collet@6wind.com,
qemu-devel@nongnu.org, n.nikolaev@virtualopensystems.com,
luke@snabb.co, thomas.long@intel.com,
Ouyang Changchun <changchun.ouyang@intel.com>
Subject: Re: [Qemu-devel] [PATCH v6 1/2] vhost-user: add multi queue support
Date: Mon, 7 Sep 2015 16:08:41 +0300 [thread overview]
Message-ID: <55ED8C59.40601@redhat.com> (raw)
In-Reply-To: <20150907152644-mutt-send-email-mst@redhat.com>
On 09/07/2015 03:26 PM, Michael S. Tsirkin wrote:
> On Mon, Sep 07, 2015 at 02:07:38PM +0300, Marcel Apfelbaum wrote:
>> On 08/13/2015 12:18 PM, Michael S. Tsirkin wrote:
>>> On Wed, Aug 12, 2015 at 02:25:41PM +0800, Ouyang Changchun wrote:
>>>> Based on patch by Nikolay Nikolaev:
>>>> Vhost-user will implement the multi queue support in a similar way
>>>> to what vhost already has - a separate thread for each queue.
>>>> To enable the multi queue functionality - a new command line parameter
>>>> "queues" is introduced for the vhost-user netdev.
>>>>
>>>> The RESET_OWNER change is based on commit:
>>>> 294ce717e0f212ed0763307f3eab72b4a1bdf4d0
>>>> If it is reverted, the patch need update for it accordingly.
>>>>
>>>> Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
>>>> Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
>>>> ---
>>>> Changes since v5:
>>>> - fix the message descption for VHOST_RESET_OWNER in vhost-user txt
>>>>
>>>> Changes since v4:
>>>> - remove the unnecessary trailing '\n'
>>>>
>>>> Changes since v3:
>>>> - fix one typo and wrap one long line
>>>>
>>>> Changes since v2:
>>>> - fix vq index issue for set_vring_call
>>>> When it is the case of VHOST_SET_VRING_CALL, The vq_index is not initialized before it is used,
>>>> thus it could be a random value. The random value leads to crash in vhost after passing down
>>>> to vhost, as vhost use this random value to index an array index.
>>>> - fix the typo in the doc and description
>>>> - address vq index for reset_owner
>>>>
>>>> Changes since v1:
>>>> - use s->nc.info_str when bringing up/down the backend
>>>>
>>>> docs/specs/vhost-user.txt | 7 ++++++-
>>>> hw/net/vhost_net.c | 3 ++-
>>>> hw/virtio/vhost-user.c | 11 ++++++++++-
>>>> net/vhost-user.c | 37 ++++++++++++++++++++++++-------------
>>>> qapi-schema.json | 6 +++++-
>>>> qemu-options.hx | 5 +++--
>>>> 6 files changed, 50 insertions(+), 19 deletions(-)
>>>>
>>
>> [...]
>>
>>>
>>>
>>> There are two problems here:
>>>
>>> 1. we don't really know that the backend
>>> is able to support the requested number of queues.
>>> If not, everything will fail, silently.
>>> A new message to query the # of queues could help, though
>>> I'm not sure what can be done on failure. Fail connection?
>>>
>>> 2. each message (e.g. set memory table) is sent multiple times,
>>> on the same socket.
>>
>> Hi,
>>
>> Actually each queue has its own vhost_dev device which in turn has his own
>> memory mappings. Because of this VHOST_SET_MEM_TABLE should be sent for each queue.
>>
>> Should we change it to VHOST_SET_VRING_MEM_TABLE? Or maybe I got this wrong...
>>
>> Thanks,
>> Marcel
>>
>
> You got it wrong, the table is the same for all rings.
OK, thanks. So the backend, in this case DPDK, maps it different per each queue.
Here is an example for 2 queues:
VHOST_CONFIG: read message VHOST_USER_SET_MEM_TABLE
VHOST_CONFIG: mapped region 0 fd:165 to 0x2aac40000000 sz:0xa0000 off:0x0
VHOST_CONFIG: mapped region 1 fd:166 to 0x2aac80000000 sz:0x80000000 off:0xc0000
VHOST_CONFIG: read message VHOST_USER_SET_VRING_NUM
VHOST_CONFIG: read message VHOST_USER_SET_VRING_BASE
VHOST_CONFIG: read message VHOST_USER_SET_VRING_ADDR
VHOST_CONFIG: read message VHOST_USER_SET_VRING_KICK
VHOST_CONFIG: vring kick idx:0 file:167 VHOST_CONFIG: virtio isn't ready for processing.
VHOST_CONFIG: read message VHOST_USER_SET_VRING_NUM
VHOST_CONFIG: read message VHOST_USER_SET_VRING_BASE
VHOST_CONFIG: read message VHOST_USER_SET_VRING_ADDR
VHOST_CONFIG: read message VHOST_USER_SET_VRING_KICK
VHOST_CONFIG: vring kick idx:1 file:168
VHOST_CONFIG: virtio isn't ready for processing.
VHOST_CONFIG: read message VHOST_USER_SET_FEATURES
VHOST_CONFIG: read message VHOST_USER_SET_MEM_TABLE
VHOST_CONFIG: mapped region 0 fd:169 to 0x2aad00000000 sz:0xa0000 off:0x0
VHOST_CONFIG: mapped region 1 fd:170 to 0x2aad40000000 sz:0x80000000 off:0xc0000
VHOST_CONFIG: read message VHOST_USER_SET_VRING_NUM
VHOST_CONFIG: read message VHOST_USER_SET_VRING_BASE
VHOST_CONFIG: read message VHOST_USER_SET_VRING_ADDR
VHOST_CONFIG: read message VHOST_USER_SET_VRING_KICK
VHOST_CONFIG: vring kick idx:2 file:171
VHOST_CONFIG: virtio isn't ready for processing.
VHOST_CONFIG: read message VHOST_USER_SET_VRING_NUM
VHOST_CONFIG: read message VHOST_USER_SET_VRING_BASE
VHOST_CONFIG: read message VHOST_USER_SET_VRING_ADDR
VHOST_CONFIG: read message VHOST_USER_SET_VRING_KICK
VHOST_CONFIG: vring kick idx:3 file:172
VHOST_CONFIG: virtio is now ready for processing.
DPDK expects this message per queue and maps it to a different address.
Trying to send it only once will leave the second queue without the mapping.
I'll try to fix this on dpdk side.
Thanks,
Marcel
>
>>
>>
>>>
>>>
>>>
>>
>> [...]
next prev parent reply other threads:[~2015-09-07 13:08 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-28 1:23 [Qemu-devel] [PATCH v5] vhost-user: add multi queue support Ouyang Changchun
2015-07-08 14:29 ` Michael S. Tsirkin
2015-07-08 22:00 ` Maxime Leroy
2015-07-09 1:29 ` [Qemu-devel] [snabb-devel] " Ouyang, Changchun
2015-07-09 7:31 ` Michael S. Tsirkin
2015-07-09 7:06 ` [Qemu-devel] " Michael S. Tsirkin
2015-07-09 12:00 ` Martin Kletzander
2015-07-09 12:24 ` Maxime Leroy
2015-07-09 12:33 ` Martin Kletzander
2015-07-09 12:54 ` Michael S. Tsirkin
2015-08-12 6:25 ` [Qemu-devel] [PATCH v6 0/2] vhost-user " Ouyang Changchun
2015-08-12 6:25 ` [Qemu-devel] [PATCH v6 1/2] vhost-user: add " Ouyang Changchun
2015-08-13 9:18 ` Michael S. Tsirkin
2015-08-13 10:24 ` Maxime Leroy
2015-08-13 10:55 ` Michael S. Tsirkin
2015-08-25 3:25 ` [Qemu-devel] [snabb-devel] " Ouyang, Changchun
2015-08-27 13:05 ` Michael S. Tsirkin
2015-08-28 1:53 ` Ouyang, Changchun
2015-08-30 6:16 ` Michael S. Tsirkin
2015-08-31 8:29 ` Ouyang, Changchun
2015-08-31 11:30 ` Michael S. Tsirkin
2015-08-31 15:04 ` Eric Blake
2015-09-01 9:20 ` Yuanhan Liu
2015-09-01 9:41 ` Michael S. Tsirkin
2015-09-01 12:16 ` Yuanhan Liu
2015-09-01 9:13 ` [Qemu-devel] " Yuanhan Liu
2015-09-01 10:07 ` Michael S. Tsirkin
2015-09-01 12:15 ` Yuanhan Liu
2015-09-01 14:10 ` Michael S. Tsirkin
2015-09-02 5:45 ` Ouyang, Changchun
2015-09-02 12:10 ` Michael S. Tsirkin
2015-09-07 11:07 ` Marcel Apfelbaum
2015-09-07 12:26 ` Michael S. Tsirkin
2015-09-07 13:08 ` Marcel Apfelbaum [this message]
2015-08-12 6:25 ` [Qemu-devel] [PATCH v6 2/2] vhost-user: new protocol feature for multi queue Ouyang Changchun
2015-08-13 9:22 ` Michael S. Tsirkin
2015-08-24 1:50 ` [Qemu-devel] [snabb-devel] " Ouyang, Changchun
2015-09-01 9:16 ` [Qemu-devel] " Yuanhan Liu
2015-09-01 10:09 ` Michael S. Tsirkin
2015-09-01 11:42 ` Yuanhan Liu
2015-08-30 15:28 ` [Qemu-devel] [PATCH v5] vhost-user: add multi queue support Marcel Apfelbaum
2015-08-31 5:28 ` Ouyang, Changchun
2015-08-31 5:42 ` Xu, Qian Q
2015-08-31 8:55 ` Marcel Apfelbaum
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=55ED8C59.40601@redhat.com \
--to=marcel@redhat.com \
--cc=changchun.ouyang@intel.com \
--cc=luke@snabb.co \
--cc=mst@redhat.com \
--cc=n.nikolaev@virtualopensystems.com \
--cc=qemu-devel@nongnu.org \
--cc=snabb-devel@googlegroups.com \
--cc=thibaut.collet@6wind.com \
--cc=thomas.long@intel.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: link
Be 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.