From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <jianfeng.tan@intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 36EDC137D
 for <dev@dpdk.org>; Fri, 22 Apr 2016 07:15:33 +0200 (CEST)
Received: from orsmga003.jf.intel.com ([10.7.209.27])
 by fmsmga102.fm.intel.com with ESMTP; 21 Apr 2016 22:15:32 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.24,516,1455004800"; d="scan'208";a="789903924"
Received: from shwdeisgchi083.ccr.corp.intel.com (HELO [10.239.67.193])
 ([10.239.67.193])
 by orsmga003.jf.intel.com with ESMTP; 21 Apr 2016 22:15:29 -0700
To: David Marchand <david.marchand@6wind.com>
References: <1446748276-132087-1-git-send-email-jianfeng.tan@intel.com>
 <1461207396-42742-1-git-send-email-jianfeng.tan@intel.com>
 <1461207396-42742-3-git-send-email-jianfeng.tan@intel.com>
 <CALwxeUvta29PCiX2aPL-oFaRbZmNS=L1K-nCEHBNyKOqURr8fQ@mail.gmail.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Huawei Xie <huawei.xie@intel.com>,
 rich.lane@bigswitch.com, Yuanhan Liu <yuanhan.liu@linux.intel.com>,
 "Michael S. Tsirkin" <mst@redhat.com>, nakajima.yoshihiro@lab.ntt.co.jp,
 p.fedin@samsung.com, "Qiu, Michael" <michael.qiu@intel.com>,
 ann.zhuangyanying@huawei.com, Tetsuya Mukawa <mukawa@igel.co.jp>,
 nhorman@tuxdrver.com
From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
Message-ID: <5719B370.8070107@intel.com>
Date: Fri, 22 Apr 2016 13:15:28 +0800
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101
 Thunderbird/38.7.2
MIME-Version: 1.0
In-Reply-To: <CALwxeUvta29PCiX2aPL-oFaRbZmNS=L1K-nCEHBNyKOqURr8fQ@mail.gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Subject: Re: [dpdk-dev] [PATCH v3 2/2] virtio/vdev: add a new vdev named
 eth_cvio
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <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, 22 Apr 2016 05:15:33 -0000

Hi,

On 4/21/2016 4:51 PM, David Marchand wrote:
> Hello,
>
> On Thu, Apr 21, 2016 at 4:56 AM, Jianfeng Tan <jianfeng.tan@intel.com> wrote:
>> Add a new virtual device named eth_cvio, it can be used just like
>> eth_ring, eth_null, etc.
>>
>> Configured parameters include:
>>    - rx (optional, 1 by default), number of rx, not used for now.
>>    - tx (optional, 1 by default), number of tx, not used for now.
>>    - cq (optional, 0 by default), not supported for now.
>>    - mac (optional), random value will be given if not specified.
>>    - queue_size (optional, 256 by default), size of virtqueue.
>>    - path (madatory), path of vhost, depends on the file type, vhost
>>      user if the given path points to a unix socket; vhost-net if the
>>      given path points to a char device.
>>    - ifname (optional), specify the name of backend tap device; only
>>      valid when backend is vhost-net.
>>
>> The major difference with original virtio for vm is that, here we use
>> virtual addr instead of physical addr for vhost to calculate relative
>> address.
>>
>> When enable CONFIG_RTE_VIRTIO_VDEV (enabled by default), the compiled
>> library can be used in both VM and container environment.
> This implementation heavily relies on dev_type to keep as much code
> shared between pci / vdev path as possible.

Yes, I still have no method to make it more clear.

>
> virtio code relies on drv_flags (even updating it while this should be
> per-device).
> So first, virtio should rely on dev_flags.

Mainly drv_flags's RTE_PCI_DRV_INTR_LSC, and RTE_PCI_DRV_DETACHABLE bit 
is used. I understand the issue, pointed out by you here, that if two 
virtio devices are used in a VM, one with feature VIRTIO_NET_F_STATUS, 
and the other without feature VIRTIO_NET_F_STATUS (under the case that 
two vhost backends are used). Then it leads to uncertainty of the behavior.

Since the flags has been copied into dev_flags after features 
negotiated, I believe we should use dev_flags instead of drv_flags. A 
patch to fix this will be sent.


>
> The rest needs to be astracted in some virtio ops ?

So with that fix goes, we may make it more clear now. Do you mean this?

Thanks,
Jianfeng

>
>
> Thanks.
>