Thread (196 messages) 196 messages, 20 authors, 2016-06-24

Re: [PATCH 4/4] virtio/vdev: add a new vdev named eth_cvio

From: Qiu, Michael <hidden>
Date: 2016-01-27 03:11:08

On 1/11/2016 2:43 AM, Tan, Jianfeng 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, only allowed to be
				   1 for now.
    - tx (optional, 1 by default): number of tx, only allowed to be
				   1 for now.
From APP side, virtio is something HW, in your implementation rx/tx is
max queue numbers virtio supported. Does it make sense?

Why need user tell HW, how much queues it support? We'd better make it
un-configurable, only let users query it like the real HW, and then
decide how much queues it need to enable.

    - cq (optional, 0 by default): if ctrl queue is enabled, not
				   supported for now.
    - mac (optional): mac address, random value will be given if not
		      specified.
    - queue_num (optional, 256 by default): size of virtqueue.
Better change it to queue_size.

Thanks,
Michael
    - path (madatory): path of vhost, depends on the file type:
		       vhost-user is used if the given path points to
	               a unix socket; vhost-net is used if the given
		       path points to a char device.

The major difference with original virtio for vm is that, here we
use virtual address instead of physical address 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.

Examples:
a. Use vhost-net as a backend
sudo numactl -N 1 -m 1 ./examples/l2fwd/build/l2fwd -c 0x100000 -n 4 \
    -m 1024 --no-pci --single-file --file-prefix=l2fwd \
    --vdev=eth_cvio0,mac=00:01:02:03:04:05,path=/dev/vhost-net \
    -- -p 0x1

b. Use vhost-user as a backend
numactl -N 1 -m 1 ./examples/l2fwd/build/l2fwd -c 0x100000 -n 4 -m 1024 \
    --no-pci --single-file --file-prefix=l2fwd \
    --vdev=eth_cvio0,mac=00:01:02:03:04:05,path=<path_to_vhost_user> \
    -- -p 0x1

Signed-off-by: Huawei Xie <redacted>
Signed-off-by: Jianfeng Tan <redacted>
---
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help