diff options
author | Damjan Marion <damarion@cisco.com> | 2017-04-28 12:29:15 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2017-05-02 16:34:32 +0000 |
commit | 4403690cda44134af3b9ea78d33a5cbf78a5acc9 (patch) | |
tree | 14d79f4342d1ec0ee993db2bacdd0eb9abcc2c63 /src/vnet/devices/devices.h | |
parent | c12311b86fb27114cdd3fa4ad9a5897a98448184 (diff) |
Add interface rx mode commands, unify rx mode and placement CLI
Change-Id: Ib506c3e9d66170f29e3266ad6dc4d32b829befba
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/devices/devices.h')
-rw-r--r-- | src/vnet/devices/devices.h | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/src/vnet/devices/devices.h b/src/vnet/devices/devices.h index baf03b7cd2a..f1f7e778460 100644 --- a/src/vnet/devices/devices.h +++ b/src/vnet/devices/devices.h @@ -55,19 +55,12 @@ typedef struct uword next_worker_thread_index; } vnet_device_main_t; -typedef enum -{ - VNET_DEVICE_INPUT_MODE_POLLING = 0, - VNET_DEVICE_INPUT_MODE_INTERRUPT, - VNET_DEVICE_INPUT_N_MODES, -} vnet_device_input_mode_t; - typedef struct { u32 hw_if_index; u32 dev_instance; u16 queue_id; - vnet_device_input_mode_t mode; + vnet_hw_interface_rx_mode mode; uword interrupt_pending; } vnet_device_and_queue_t; @@ -82,22 +75,23 @@ extern vlib_node_registration_t device_input_node; extern const u32 device_input_next_node_advance[]; static inline void -vnet_set_device_input_node (vnet_main_t * vnm, u32 hw_if_index, - u32 node_index) +vnet_hw_interface_set_input_node (vnet_main_t * vnm, u32 hw_if_index, + u32 node_index) { vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index); hw->input_node_index = node_index; } -void vnet_device_input_assign_thread (vnet_main_t * vnm, u32 hw_if_index, - u16 queue_id, uword thread_index); -int vnet_device_input_unassign_thread (vnet_main_t * vnm, u32 hw_if_index, - u16 queue_id, uword thread_index); -int vnet_device_input_set_mode (vnet_main_t * vnm, u32 hw_if_index, - u16 queue_id, vnet_device_input_mode_t mode); -int vnet_device_input_get_mode (vnet_main_t * vnm, u32 hw_if_index, - u16 queue_id, - vnet_device_input_mode_t * mode); +void vnet_hw_interface_assign_rx_thread (vnet_main_t * vnm, u32 hw_if_index, + u16 queue_id, uword thread_index); +int vnet_hw_interface_unassign_rx_thread (vnet_main_t * vnm, u32 hw_if_index, + u16 queue_id); +int vnet_hw_interface_set_rx_mode (vnet_main_t * vnm, u32 hw_if_index, + u16 queue_id, + vnet_hw_interface_rx_mode mode); +int vnet_hw_interface_get_rx_mode (vnet_main_t * vnm, u32 hw_if_index, + u16 queue_id, + vnet_hw_interface_rx_mode * mode); static inline u64 vnet_get_aggregate_rx_packets (void) @@ -161,7 +155,7 @@ vnet_device_input_set_interrupt_pending (vnet_main_t * vnm, u32 hw_if_index, #define foreach_device_and_queue(var,vec) \ for (var = (vec); var < vec_end (vec); var++) \ if (clib_smp_swap (&((var)->interrupt_pending), 0) || \ - var->mode == VNET_DEVICE_INPUT_MODE_POLLING) + var->mode == VNET_HW_INTERFACE_RX_MODE_POLLING) #endif /* included_vnet_vnet_device_h */ |