vhost: add API to set protocol features flags
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Tue, 19 Mar 2019 10:54:16 +0000 (11:54 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 20 Mar 2019 17:15:42 +0000 (18:15 +0100)
commit9401b80327a288719802e526e76f947b5d8b2e3f
tree2ca95e59cad208466c1ba4be09f1174a428c4517
parentabefc0abc8e770a983c48887ddfcb1a21bb345aa
vhost: add API to set protocol features flags

rte_vhost_driver_set_protocol_features API is to be used
by external backends to advertise vhost-user protocol
features it supports.

It has to be called after rte_vhost_driver_register() and
before rte_vhost_driver_start().

Example of usage to advertize VHOST_USER_PROTOCOL_F_FOOBAR
protocol feature:

const char *path = "/tmp/vhost-user";
uint64_t protocol_features;
rte_vhost_driver_register(path, 0);
rte_vhost_driver_get_protocol_features(path, &protocol_features);
protocol_features |= VHOST_USER_PROTOCOL_F_FOOBAR;
rte_vhost_driver_set_protocol_features(path, protocol_features);
rte_vhost_driver_start(path);

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
lib/librte_vhost/rte_vhost.h
lib/librte_vhost/rte_vhost_version.map
lib/librte_vhost/socket.c