vhost: get negotiated protocol features
Add rte_vhost_get_negotiated_protocol_features, which returns a set of enabled protocol features. Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
This commit is contained in:
parent
af4844503e
commit
790b1c3171
@ -567,6 +567,21 @@ rte_vhost_driver_get_queue_num(const char *path, uint32_t *queue_num);
|
|||||||
*/
|
*/
|
||||||
int rte_vhost_get_negotiated_features(int vid, uint64_t *features);
|
int rte_vhost_get_negotiated_features(int vid, uint64_t *features);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the protocol feature bits after negotiation
|
||||||
|
*
|
||||||
|
* @param vid
|
||||||
|
* Vhost device ID
|
||||||
|
* @param protocol_features
|
||||||
|
* A pointer to store the queried protocol feature bits
|
||||||
|
* @return
|
||||||
|
* 0 on success, -1 on failure
|
||||||
|
*/
|
||||||
|
__rte_experimental
|
||||||
|
int
|
||||||
|
rte_vhost_get_negotiated_protocol_features(int vid,
|
||||||
|
uint64_t *protocol_features);
|
||||||
|
|
||||||
/* Register callbacks. */
|
/* Register callbacks. */
|
||||||
int rte_vhost_driver_callback_register(const char *path,
|
int rte_vhost_driver_callback_register(const char *path,
|
||||||
struct vhost_device_ops const * const ops);
|
struct vhost_device_ops const * const ops);
|
||||||
|
@ -76,4 +76,7 @@ EXPERIMENTAL {
|
|||||||
rte_vhost_async_channel_unregister;
|
rte_vhost_async_channel_unregister;
|
||||||
rte_vhost_submit_enqueue_burst;
|
rte_vhost_submit_enqueue_burst;
|
||||||
rte_vhost_poll_enqueue_completed;
|
rte_vhost_poll_enqueue_completed;
|
||||||
|
|
||||||
|
# added in 21.05
|
||||||
|
rte_vhost_get_negotiated_protocol_features;
|
||||||
};
|
};
|
||||||
|
@ -885,6 +885,20 @@ rte_vhost_get_negotiated_features(int vid, uint64_t *features)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
rte_vhost_get_negotiated_protocol_features(int vid,
|
||||||
|
uint64_t *protocol_features)
|
||||||
|
{
|
||||||
|
struct virtio_net *dev;
|
||||||
|
|
||||||
|
dev = get_device(vid);
|
||||||
|
if (dev == NULL || protocol_features == NULL)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
*protocol_features = dev->protocol_features;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
rte_vhost_get_mem_table(int vid, struct rte_vhost_memory **mem)
|
rte_vhost_get_mem_table(int vid, struct rte_vhost_memory **mem)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user