From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <jianfeng.tan@intel.com>
Received: from mga01.intel.com (mga01.intel.com [192.55.52.88])
 by dpdk.org (Postfix) with ESMTP id 19589326C
 for <dev@dpdk.org>; Fri,  7 Apr 2017 08:33:34 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
 d=intel.com; i=@intel.com; q=dns/txt; s=intel;
 t=1491546815; x=1523082815;
 h=subject:to:cc:references:from:message-id:date:
 mime-version:in-reply-to:content-transfer-encoding;
 bh=mAmlJZ6xoKnxh+PEan/5nThULmFYJkvxT/x2lzc1OB8=;
 b=ZkKjd/ruDIKRXaHPVKEBmg+7a3ZBO2jRuf1Xc5SawXU9ZccrV2SEHgQO
 HshLOn0iqOHp1lRAaIljkBgGzHK/7Q==;
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
 by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 06 Apr 2017 23:33:33 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.37,163,1488873600"; d="scan'208";a="1152670146"
Received: from shwdeisgchi083.ccr.corp.intel.com (HELO [10.239.67.173])
 ([10.239.67.173])
 by fmsmga002.fm.intel.com with ESMTP; 06 Apr 2017 23:33:26 -0700
To: Thomas Monjalon <thomas.monjalon@6wind.com>, Ami Sabo <amis@radware.com>, 
 yuanhan.liu@linux.intel.com
Cc: dev@dpdk.org
References: <1488102926-24158-2-git-send-email-amis@radware.com>
 <1488445242-8824-1-git-send-email-amis@radware.com>
 <1655428.Al161abRzh@xps13> <4691348.WVCvaACybL@xps13>
From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
Message-ID: <16e3ade1-41b6-0901-f715-b07f9a2ba416@intel.com>
Date: Fri, 7 Apr 2017 14:33:25 +0800
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101
 Thunderbird/52.0
MIME-Version: 1.0
In-Reply-To: <4691348.WVCvaACybL@xps13>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Language: en-US
Subject: Re: [dpdk-dev] [PATCH 0/2] Fix virtio-user multi-process crash.
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 07 Apr 2017 06:33:35 -0000

Hi Thomas,


On 4/7/2017 4:14 AM, Thomas Monjalon wrote:
> Ping
>
> 2017-03-08 12:40, Thomas Monjalon:
>> 2017-03-02 11:00, Ami Sabo:
>>> The patchset fixes secondary process crash issue when it tries
>>> to access virtio-user pmd (e.g. via rte_eth_rx_burst).
>>>
>>> The crash happens because in virtio_user probing,
>>> eth_dev_attach_secondary is not being called, as it does from
>>> rte_eth_dev_pci_probe. Therefore, the device is not properly
>>> initialized.
>>>
>>> The patchset contains 2 patches:
>>> 1. Export rte_eth_dev_attach_secondary, so non-pci drivers will be
>>> allowed to call it.
>>> 2. Fix the actual bug by calling the function during virtio_user probe.
>> I do not understand why nobody complains for other virtual devices.
>> We should have the same issue with pcap, tap, ring, af_packet, etc.

Yes, none of vdev except ring supports primary/secondary mode.

>> Probably that other drivers are broken in secondary processes.
>> Or should we make a fix to handle every secondary vdev in
>> rte_eth_dev_allocate() ?

Agreed. We can change the rte_eth_dev_allocate() like this:
if (primary)
     allocate();
else
     lookup(name);

Besides, we need each vdev to handle its private. For example, pcap 
should share the selectable unix fd with secondary process; virtio-user 
should share callfds and kickfds; tap should share the fd pointing to 
/dev/tun.

Thanks,
Jianfeng