doc: update virtio related functions doc comments

Update some virtio, VBS-K, vhost APIs documents.

Tracked-On: #1595
Signed-off-by: Shuo Liu <shuo.a.liu@intel.com>
This commit is contained in:
Shuo Liu
2018-10-29 15:07:58 +08:00
committed by David Kinder
parent ea801a1672
commit d261b4bce2
13 changed files with 647 additions and 89 deletions

View File

@@ -581,6 +581,22 @@ vhost_set_mem_table(struct vhost_dev *vdev)
return 0;
}
/**
* @brief vhost_dev initialization.
*
* This interface is called to initialize the vhost_dev. It must be called
* before the actual feature negotiation with the guest OS starts.
*
* @param vdev Pointer to struct vhost_dev.
* @param base Pointer to struct virtio_base.
* @param fd fd of the vhost chardev.
* @param vq_idx The first virtqueue which would be used by this vhost dev.
* @param vhost_features Subset of vhost features which would be enabled.
* @param vhost_ext_features Specific vhost internal features to be enabled.
* @param busyloop_timeout Busy loop timeout in us.
*
* @return 0 on success and -1 on failure.
*/
int
vhost_dev_init(struct vhost_dev *vdev,
struct virtio_base *base,
@@ -645,6 +661,15 @@ fail:
return -1;
}
/**
* @brief vhost_dev cleanup.
*
* This interface is called to cleanup the vhost_dev.
*
* @param vdev Pointer to struct vhost_dev.
*
* @return 0 on success and -1 on failure.
*/
int
vhost_dev_deinit(struct vhost_dev *vdev)
{
@@ -661,6 +686,15 @@ vhost_dev_deinit(struct vhost_dev *vdev)
return 0;
}
/**
* @brief start vhost data plane.
*
* This interface is called to start the data plane in vhost.
*
* @param vdev Pointer to struct vhost_dev.
*
* @return 0 on success and -1 on failure.
*/
int
vhost_dev_start(struct vhost_dev *vdev)
{
@@ -736,6 +770,15 @@ fail:
return -1;
}
/**
* @brief stop vhost data plane.
*
* This interface is called to stop the data plane in vhost.
*
* @param vdev Pointer to struct vhost_dev.
*
* @return 0 on success and -1 on failure.
*/
int
vhost_dev_stop(struct vhost_dev *vdev)
{
@@ -758,6 +801,17 @@ vhost_dev_stop(struct vhost_dev *vdev)
return rc;
}
/**
* @brief set backend fd of vhost net.
*
* This interface is called to set the backend fd (for example tap fd)
* to vhost.
*
* @param vdev Pointer to struct vhost_dev.
* @param backend_fd fd of backend (for example tap fd).
*
* @return 0 on success and -1 on failure.
*/
int
vhost_net_set_backend(struct vhost_dev *vdev, int backend_fd)
{