/**
* Device and vring operations.
*/
-struct vhost_device_ops {
+struct rte_vhost_device_ops {
int (*new_device)(int vid); /**< Add device. */
void (*destroy_device)(int vid); /**< Remove device. */
void *reserved[1]; /**< Reserved for future extension */
};
+/**
+ * Power monitor condition.
+ */
+struct rte_vhost_power_monitor_cond {
+ /**< Address to monitor for changes */
+ volatile void *addr;
+ /**< If the `mask` is non-zero, location pointed
+ * to by `addr` will be read and masked, then
+ * compared with this value.
+ */
+ uint64_t val;
+ /**< 64-bit mask to extract value read from `addr` */
+ uint64_t mask;
+ /**< Data size (in bytes) that will be read from the
+ * monitored memory location (`addr`).
+ */
+ uint8_t size;
+ /**< If 1, and masked value that read from 'addr' equals
+ * 'val', the driver should skip core sleep. If 0, and
+ * masked value that read from 'addr' does not equal 'val',
+ * the driver should skip core sleep.
+ */
+ uint8_t match;
+};
+
/**
* Convert guest physical address to host virtual address
*
* @return
* the host virtual address on success, 0 on failure
*/
-__rte_experimental
static __rte_always_inline uint64_t
rte_vhost_va_from_guest_pa(struct rte_vhost_memory *mem,
uint64_t gpa, uint64_t *len)
* @return
* 0 on success, -1 on failure
*/
-__rte_experimental
int
rte_vhost_driver_set_protocol_features(const char *path,
uint64_t protocol_features);
* @return
* 0 on success, -1 on failure
*/
-__rte_experimental
int
rte_vhost_driver_get_protocol_features(const char *path,
uint64_t *protocol_features);
* @return
* 0 on success, -1 on failure
*/
-__rte_experimental
int
rte_vhost_driver_get_queue_num(const char *path, uint32_t *queue_num);
/* Register callbacks. */
int rte_vhost_driver_callback_register(const char *path,
- struct vhost_device_ops const * const ops);
+ struct rte_vhost_device_ops const * const ops);
/**
*
* @return
* 0 on success, -1 on failure
*/
-__rte_experimental
int
rte_vhost_get_vhost_ring_inflight(int vid, uint16_t vring_idx,
struct rte_vhost_ring_inflight *vring);
* @return
* 0 on success, -1 on failure
*/
-__rte_experimental
int
rte_vhost_set_inflight_desc_split(int vid, uint16_t vring_idx,
uint16_t idx);
* @return
* 0 on success, -1 on failure
*/
-__rte_experimental
int
rte_vhost_set_inflight_desc_packed(int vid, uint16_t vring_idx,
uint16_t head, uint16_t last, uint16_t *inflight_entry);
* @return
* 0 on success, -1 on failure
*/
-__rte_experimental
int
rte_vhost_set_last_inflight_io_split(int vid,
uint16_t vring_idx, uint16_t idx);
* @return
* 0 on success, -1 on failure
*/
-__rte_experimental
int
rte_vhost_set_last_inflight_io_packed(int vid,
uint16_t vring_idx, uint16_t head);
* @return
* 0 on success, -1 on failure
*/
-__rte_experimental
int
rte_vhost_clr_inflight_desc_split(int vid, uint16_t vring_idx,
uint16_t last_used_idx, uint16_t idx);
* @return
* 0 on success, -1 on failure
*/
-__rte_experimental
int
rte_vhost_clr_inflight_desc_packed(int vid, uint16_t vring_idx,
uint16_t head);
*/
uint32_t rte_vhost_rx_queue_count(int vid, uint16_t qid);
+/**
+ * Get power monitor address of the vhost device
+ *
+ * @param vid
+ * vhost device ID
+ * @param queue_id
+ * vhost queue ID
+ * @param pmc
+ * power monitor condition
+ * @return
+ * 0 on success, -1 on failure
+ */
+__rte_experimental
+int
+rte_vhost_get_monitor_addr(int vid, uint16_t queue_id,
+ struct rte_vhost_power_monitor_cond *pmc);
+
/**
* Get log base and log size of the vhost device
*
* @return
* 0 on success, -1 on failure
*/
-__rte_experimental
int
rte_vhost_get_vring_base_from_inflight(int vid,
uint16_t queue_id, uint16_t *last_avail_idx, uint16_t *last_used_idx);
* @return
* 0 on success, -1 on failure
*/
-__rte_experimental
int
rte_vhost_extern_callback_register(int vid,
struct rte_vhost_user_extern_ops const * const ops, void *ctx);