X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fvhost%2Frte_vhost.h;h=2acb31df2d8ea551412c2c8e76b82b14533dc069;hb=6e858b4d9244cf53505589673755ab18ac2a4a83;hp=fd372d52594bb99e5cd04f332165a79e345e6b65;hpb=945ef8a04098bab74377cdca836824229870dd89;p=dpdk.git diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h index fd372d5259..2acb31df2d 100644 --- a/lib/vhost/rte_vhost.h +++ b/lib/vhost/rte_vhost.h @@ -21,10 +21,12 @@ extern "C" { #endif +#ifndef __cplusplus /* These are not C++-aware. */ #include #include #include +#endif #define RTE_VHOST_USER_CLIENT (1ULL << 0) #define RTE_VHOST_USER_NO_RECONNECT (1ULL << 1) @@ -264,7 +266,7 @@ struct rte_vhost_user_extern_ops { /** * 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. */ @@ -292,6 +294,31 @@ struct vhost_device_ops { 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 * @@ -581,7 +608,7 @@ rte_vhost_get_negotiated_protocol_features(int vid, /* 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); /** * @@ -771,7 +798,7 @@ rte_vhost_get_vhost_ring_inflight(int vid, uint16_t vring_idx, /** * Set split inflight descriptor. * - * This function save descriptors that has been comsumed in available + * This function save descriptors that has been consumed in available * ring * * @param vid @@ -790,7 +817,7 @@ rte_vhost_set_inflight_desc_split(int vid, uint16_t vring_idx, /** * Set packed inflight descriptor and get corresponding inflight entry * - * This function save descriptors that has been comsumed + * This function save descriptors that has been consumed * * @param vid * vhost device ID @@ -903,6 +930,23 @@ int rte_vhost_vring_call(int vid, uint16_t vring_idx); */ 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 *