From: Benoît Canet Date: Fri, 27 Feb 2015 10:22:45 +0000 (+0100) Subject: vhost: add hint on how to add or remove device to a data core X-Git-Tag: spdx-start~9431 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=45db8927a832fc3ad717b81387ac765f22d43996;p=dpdk.git vhost: add hint on how to add or remove device to a data core Let's make sure people will not forget to set and unset VIRTIO_DEV_RUNNING. Signed-off-by: Benoît Canet Acked-by: Huawei Xie --- diff --git a/doc/guides/prog_guide/vhost_lib.rst b/doc/guides/prog_guide/vhost_lib.rst index 0b6eda7836..ba6065da0c 100644 --- a/doc/guides/prog_guide/vhost_lib.rst +++ b/doc/guides/prog_guide/vhost_lib.rst @@ -58,7 +58,8 @@ Vhost API Overview register two callbacks, new_destory and destroy_device. When virtio device is activated or deactivated by guest virtual machine, the callback will be called, then vSwitch could put the device onto data - core or remove the device from data core. + core or remove the device from data core by setting or unsetting + VIRTIO_DEV_RUNNING on the device flags. * Read/write packets from/to guest virtual machine diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h index 2fc1c448f2..b79bd0b76b 100644 --- a/lib/librte_vhost/rte_virtio_net.h +++ b/lib/librte_vhost/rte_virtio_net.h @@ -130,6 +130,10 @@ struct virtio_memory { /** * Device operations to add/remove device. + * + * Make sure to set VIRTIO_DEV_RUNNING to the device flags in new_device and + * remove it in destroy_device. + * */ struct virtio_net_device_ops { int (*new_device)(struct virtio_net *); /**< Add device. */