* Interface to vhost-user
*/
+#include <stdbool.h>
#include <stdint.h>
#include <sys/eventfd.h>
#define VHOST_USER_PROTOCOL_F_PAGEFAULT 8
#endif
+#ifndef VHOST_USER_PROTOCOL_F_CONFIG
+#define VHOST_USER_PROTOCOL_F_CONFIG 9
+#endif
+
#ifndef VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD
#define VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD 10
#endif
#define VHOST_USER_F_PROTOCOL_FEATURES 30
#endif
+struct rte_vdpa_device;
+
/**
* Information relating to memory regions including offsets to
* addresses in QEMUs memory file.
/**
* This callback gets called each time a guest gets notified
- * about waiting packets. This is the interrupt handling trough
+ * about waiting packets. This is the interrupt handling through
* the eventfd_write(callfd), which can be used for counting these
* "slow" syscalls.
*/
*
* @param path
* The vhost-user socket file path
- * @param did
- * Device id
+ * @param dev
+ * vDPA device pointer
* @return
* 0 on success, -1 on failure
*/
__rte_experimental
int
-rte_vhost_driver_attach_vdpa_device(const char *path, int did);
+rte_vhost_driver_attach_vdpa_device(const char *path,
+ struct rte_vdpa_device *dev);
/**
* Unset the vdpa device id
* @param path
* The vhost-user socket file path
* @return
- * Device id, -1 on failure
+ * vDPA device pointer, NULL on failure
*/
__rte_experimental
-int
-rte_vhost_driver_get_vdpa_device_id(const char *path);
+struct rte_vdpa_device *
+rte_vhost_driver_get_vdpa_device(const char *path);
/**
* Set the feature bits the vhost-user driver supports.
* @param vid
* vhost device id
* @return
- * device id
+ * vDPA device pointer on success, NULL on failure
+ */
+__rte_experimental
+struct rte_vdpa_device *
+rte_vhost_get_vdpa_device(int vid);
+
+/**
+ * Notify the guest that should get virtio configuration space from backend.
+ *
+ * @param vid
+ * vhost device ID
+ * @param need_reply
+ * wait for the master response the status of this operation
+ * @return
+ * 0 on success, < 0 on failure
*/
__rte_experimental
int
-rte_vhost_get_vdpa_device_id(int vid);
+rte_vhost_slave_config_change(int vid, bool need_reply);
#ifdef __cplusplus
}