[dpdk-dev] [PATCH v3 2/2] virtio/vdev: add a new vdev named eth_cvio

Tan, Jianfeng jianfeng.tan at intel.com
Fri Apr 22 07:15:28 CEST 2016


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 at 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.
>



More information about the dev mailing list