1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2016 IGEL Co., Ltd. 3 * Copyright(c) 2016-2018 Intel Corporation 4 */ 5 #ifndef _RTE_ETH_VHOST_H_ 6 #define _RTE_ETH_VHOST_H_ 7 8 #ifdef __cplusplus 9 extern "C" { 10 #endif 11 12 #include <stdint.h> 13 #include <stdbool.h> 14 15 #include <rte_vhost.h> 16 17 /* 18 * Event description. 19 */ 20 struct rte_eth_vhost_queue_event { 21 uint16_t queue_id; 22 bool rx; 23 bool enable; 24 }; 25 26 /** 27 * Get queue events from specified port. 28 * If a callback for below event is registered by 29 * rte_eth_dev_callback_register(), this function will describe what was 30 * changed. 31 * - RTE_ETH_EVENT_QUEUE_STATE 32 * Multiple events may cause only one callback kicking, so call this function 33 * while returning 0. 34 * 35 * @param port_id 36 * Port id. 37 * @param event 38 * Pointer to a rte_eth_vhost_queue_event structure. 39 * @return 40 * - On success, zero. 41 * - On failure, a negative value. 42 */ 43 int rte_eth_vhost_get_queue_event(uint16_t port_id, 44 struct rte_eth_vhost_queue_event *event); 45 46 /** 47 * Get the 'vid' value associated with the specified port. 48 * 49 * @return 50 * - On success, the 'vid' associated with 'port_id'. 51 * - On failure, a negative value. 52 */ 53 int rte_eth_vhost_get_vid_from_port_id(uint16_t port_id); 54 55 #ifdef __cplusplus 56 } 57 #endif 58 59 #endif 60