DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
To: "Loftus, Ciara" <ciara.loftus@intel.com>,
	Rich Lane <rich.lane@bigswitch.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: Tetsuya Mukawa <mukawa@igel.co.jp>,
	Yuanhan Liu <yuanhan.liu@linux.intel.com>
Subject: Re: [dpdk-dev] [PATCH] vhost: call rte_vhost_enable_guest_notification only on enabled queues
Date: Fri, 8 Apr 2016 00:13:23 +0800	[thread overview]
Message-ID: <57068723.1000007@intel.com> (raw)
In-Reply-To: <74F120C019F4A64C9B78E802F6AD4CC24F863996@IRSMSX106.ger.corp.intel.com>



On 4/7/2016 11:29 PM, Loftus, Ciara wrote:
>> On 4/7/2016 8:29 AM, Rich Lane wrote:
>>> If the vhost PMD were configured with more queues than the guest, the
>> old
>>> code would segfault in rte_vhost_enable_guest_notification due to a NULL
>>> virtqueue pointer.
>>>
>>> Fixes: ee584e9710b9 ("vhost: add driver on top of the library")
>>> Signed-off-by: Rich Lane <rich.lane@bigswitch.com>
>>> ---
>>>    drivers/net/vhost/rte_eth_vhost.c | 5 +++--
>>>    1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/net/vhost/rte_eth_vhost.c
>> b/drivers/net/vhost/rte_eth_vhost.c
>>> index b1eb082..310cbef 100644
>>> --- a/drivers/net/vhost/rte_eth_vhost.c
>>> +++ b/drivers/net/vhost/rte_eth_vhost.c
>>> @@ -265,7 +265,6 @@ new_device(struct virtio_net *dev)
>>>    		vq->device = dev;
>>>    		vq->internal = internal;
>>>    		vq->port = eth_dev->data->port_id;
>>> -		rte_vhost_enable_guest_notification(dev, vq-
>>> virtqueue_id, 0);
>>>    	}
>>>    	for (i = 0; i < eth_dev->data->nb_tx_queues; i++) {
>>>    		vq = eth_dev->data->tx_queues[i];
>>> @@ -274,9 +273,11 @@ new_device(struct virtio_net *dev)
>>>    		vq->device = dev;
>>>    		vq->internal = internal;
>>>    		vq->port = eth_dev->data->port_id;
>>> -		rte_vhost_enable_guest_notification(dev, vq-
>>> virtqueue_id, 0);
>>>    	}
>>>
>>> +	for (i = 0; i < dev->virt_qp_nb * VIRTIO_QNUM; i++)
>>> +		rte_vhost_enable_guest_notification(dev, i, 0);
>>> +
>>>    	dev->flags |= VIRTIO_DEV_RUNNING;
>>>    	dev->priv = eth_dev;
>>>    	eth_dev->data->dev_link.link_status = ETH_LINK_UP;
>> Just one question, when qemu starts a vm, usually, only one queue is
>> enabled, then only 1 tx and 1 rx are called
>> rte_vhost_enable_guest_notification; but after system is up, we use
>> "ethtool -K eth0 combined x" to enable multiqueues, there's no chance to
>> call rte_vhost_enable_guest_notification for other queues, right?
> As far as I know, virt_qp_nb will report the number of queues available, regardless of their state enabled/disabled. So for example if we have 4 queues, but only one enabled, virt_qp_nb should still = 4 and rte_vhost_enable_guest_notification() will be called for all of these queues.

Oh, yes. I failed to really get multiqueue configured right, which leads 
to the wrong conclusion. Sorry.

Thanks,
Jianfeng

>
> Thanks,
> Ciara
>
>> Thanks,
>> Jianfeng

  parent reply	other threads:[~2016-04-07 16:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07  0:29 Rich Lane
2016-04-07 10:40 ` Loftus, Ciara
2016-04-07 11:48 ` Tan, Jianfeng
2016-04-07 15:29   ` Loftus, Ciara
2016-04-07 15:42     ` Yuanhan Liu
2016-04-07 16:13     ` Tan, Jianfeng [this message]
2016-04-07 15:42 ` Yuanhan Liu
2016-04-07 17:20   ` Thomas Monjalon
2016-04-08  1:45     ` Tetsuya Mukawa
2016-04-08  6:14       ` Yuanhan Liu
2016-04-08  7:03         ` Tetsuya Mukawa

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=57068723.1000007@intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=ciara.loftus@intel.com \
    --cc=dev@dpdk.org \
    --cc=mukawa@igel.co.jp \
    --cc=rich.lane@bigswitch.com \
    --cc=yuanhan.liu@linux.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 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).