DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: "Tan, Jianfeng" <jianfeng.tan@intel.com>,
	"Chen, Junjie J" <junjie.j.chen@intel.com>,
	"mtetsuyah@gmail.com" <mtetsuyah@gmail.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/vhost: fix segfault when creating vdev dynamically
Date: Thu, 29 Mar 2018 14:35:33 +0200	[thread overview]
Message-ID: <154a606b-a225-7926-f6c0-a29e4701d36e@redhat.com> (raw)
In-Reply-To: <45023f15-9ddd-ec64-8e06-bef74c2ca533@intel.com>



On 03/27/2018 04:01 PM, Tan, Jianfeng wrote:
> 
> 
> On 3/27/2018 7:28 PM, Maxime Coquelin wrote:
>>
>>
>> On 03/27/2018 11:42 AM, Tan, Jianfeng wrote:
>>>
>>>
>>> On 3/27/2018 5:24 PM, Chen, Junjie J wrote:
>>>>>>> On 3/28/2018 12:05 AM, Junjie Chen wrote:
>>>>>>>> when creating vdev dynamically, vhost pmd driver start directly
>>>>>>>> without checking TX/RX queues ready or not, and thus cause
>>>>>>>> segmentation fault when vhost library accessing queues. This patch
>>>>>>>> add flag to check whether queues setup or not, and add driver start
>>>>>>>> call into dev_start to allow user start it after setting up queue.
>>>>>>> The issue is clear now. But this patch just puts the situation 
>>>>>>> before below
>>>>> fix:
>>>>>>> "it doesn't create the actual datagram socket until you call 
>>>>>>> .dev_start()."
>>>>>> No, if the queue exist, the datagram socket still get created in 
>>>>>> vhost_create
>>>>> API, since the vhost_driver_register still exist in vhost_create.
>>>>>
>>>>> The queue can never be created, as it's still not probed.
>>>> I think we need to separate this into two cases:
>>>>     Statically create vdev, the datagram recreate logical is still 
>>>> there since queues are exist already, this patch doesn't change 
>>>> anything.
>>>>     Dynamic create vdev, as you pointed out, queue can never be 
>>>> created, while this should be not valid since In normal process of 
>>>> creating vdev dynamically, we always need to config queues. Correct 
>>>> me if I'm wrong.
>>>
>>> My point is, either vdev is created statically or dynamically, when 
>>> probe(), queues are not setup yet definitely, then *the unix socket 
>>> will not be created* until we set up the queues and do dev_start(). 
>>> If the unix socket is not created, then VM cannot connect to it.
>>
>> FYI, I think I reproduced such an issue with the vdev statically created
>> in the past, while doing some experiments. I didn't went further into 
>> the analysis at that time, but it looks like the issue Junjie is trying
>> to address with this patch for dynamically created vdev.
> 
> Yes, I have noticed that this issue mostly happens at dynamic case. Just 
> try to suggest a proper way to fix. Please check if my suggestion in 
> another email makes sense.

Yes, it makes sense, that's the right thing to do I think.

Thanks,
Maxime
> 
> Thanks,
> Jianfeng
> 
>>
>> Cheers,
>> Maxime
> 

  reply	other threads:[~2018-03-29 12:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27 16:05 Junjie Chen
2018-03-27  8:56 ` Tan, Jianfeng
2018-03-27  9:02   ` Chen, Junjie J
2018-03-27  9:10     ` Tan, Jianfeng
2018-03-27  9:24       ` Chen, Junjie J
2018-03-27  9:42         ` Tan, Jianfeng
2018-03-27 10:18           ` Chen, Junjie J
2018-03-27 13:54             ` Tan, Jianfeng
2018-03-27 11:28           ` Maxime Coquelin
2018-03-27 14:01             ` Tan, Jianfeng
2018-03-29 12:35               ` Maxime Coquelin [this message]
2018-03-29 15:35 ` [dpdk-dev] [PATCH v2] " Junjie Chen
2018-03-29 13:16   ` Maxime Coquelin
2018-03-30  6:58   ` [dpdk-dev] [PATCH v3] " Junjie Chen
2018-03-30  7:32     ` Yang, Zhiyong
2018-03-30  7:36       ` Maxime Coquelin
2018-03-30  7:35     ` Maxime Coquelin
2018-03-30  7:43     ` Maxime Coquelin
2018-04-09 12:37     ` Jens Freimann
2018-04-10  8:11       ` Chen, Junjie J

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=154a606b-a225-7926-f6c0-a29e4701d36e@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=junjie.j.chen@intel.com \
    --cc=mtetsuyah@gmail.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).