aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/dev/dev.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/dev/dev.h')
-rw-r--r--src/vnet/dev/dev.h124
1 files changed, 92 insertions, 32 deletions
diff --git a/src/vnet/dev/dev.h b/src/vnet/dev/dev.h
index 76ff4f55b71..f3f7563317e 100644
--- a/src/vnet/dev/dev.h
+++ b/src/vnet/dev/dev.h
@@ -29,7 +29,8 @@ typedef enum
_ (interrupt_mode) \
_ (rss) \
_ (change_max_rx_frame_size) \
- _ (mac_filter)
+ _ (mac_filter) \
+ _ (secondary_interfaces)
#define foreach_vnet_dev_port_rx_offloads _ (ip4_cksum)
@@ -253,6 +254,8 @@ typedef struct
vnet_dev_port_op_no_rv_t *deinit;
vnet_dev_port_op_no_rv_t *free;
vnet_dev_port_op_no_rv_t *clear_counters;
+ vnet_dev_port_op_with_ptr_t *add_sec_if;
+ vnet_dev_port_op_with_ptr_t *del_sec_if;
format_function_t *format_status;
format_function_t *format_flow;
} vnet_dev_port_ops_t;
@@ -269,30 +272,41 @@ typedef union
u8 as_number;
} vnet_dev_rx_queue_rt_req_t;
+typedef struct
+{
+ vlib_buffer_template_t buffer_template;
+ u32 sw_if_index;
+ u16 next_index;
+ u16 sec_if_index;
+} vnet_dev_rx_queue_if_rt_data_t;
+
typedef struct vnet_dev_rx_queue
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
vnet_dev_port_t *port;
u16 rx_thread_index;
u16 index;
- vnet_dev_counter_main_t *counter_main;
- CLIB_CACHE_LINE_ALIGN_MARK (runtime0);
- vnet_dev_rx_queue_t *next_on_thread;
+ u16 size;
u8 interrupt_mode : 1;
u8 enabled : 1;
u8 started : 1;
u8 suspended : 1;
- vnet_dev_queue_id_t queue_id;
- u16 size;
- u16 next_index;
vnet_dev_rx_queue_rt_req_t runtime_request;
+ vnet_dev_counter_main_t *counter_main;
+ vnet_dev_rx_queue_t *next_on_thread;
+ vnet_dev_queue_id_t queue_id;
+ vnet_dev_rx_queue_if_rt_data_t **sec_if_rt_data;
CLIB_CACHE_LINE_ALIGN_MARK (runtime1);
- vlib_buffer_template_t buffer_template;
+ vnet_dev_rx_queue_if_rt_data_t if_rt_data;
CLIB_CACHE_LINE_ALIGN_MARK (driver_data);
u8 data[];
} vnet_dev_rx_queue_t;
+#if CLIB_CACHE_LINE_BYTES > 64
+STATIC_ASSERT_SIZEOF (vnet_dev_rx_queue_t, 2 * CLIB_CACHE_LINE_BYTES);
+#else
STATIC_ASSERT_SIZEOF (vnet_dev_rx_queue_t, 3 * CLIB_CACHE_LINE_BYTES);
+#endif
typedef struct vnet_dev_tx_queue
{
@@ -314,6 +328,38 @@ typedef struct vnet_dev_tx_queue
STATIC_ASSERT_SIZEOF (vnet_dev_tx_queue_t, 2 * CLIB_CACHE_LINE_BYTES);
+typedef struct
+{
+ vnet_dev_if_name_t name;
+ u8 interface_created : 1;
+ u8 feature_arc : 1;
+ u8 redirect_to_node : 1;
+ u8 feature_arc_index;
+ u16 rx_next_index;
+ u32 index;
+ u32 sw_if_index;
+ u32 hw_if_index;
+ u32 dev_instance;
+ u32 tx_node_index;
+ u32 next_index;
+ u32 current_config_index;
+ u16 redirect_to_node_next_index;
+ u32 user_data;
+ vnet_dev_arg_t *args;
+} vnet_dev_port_interface_t;
+
+typedef struct
+{
+ u32 rx_node_index;
+ u8 default_is_intr_mode : 1;
+ u16 num_rx_queues;
+ u16 num_tx_queues;
+ u16 txq_sz;
+ u16 rxq_sz;
+ vnet_dev_port_interface_t primary_interface;
+ vnet_dev_port_interface_t **secondary_interfaces;
+} vnet_dev_port_interfaces_t;
+
typedef struct vnet_dev_port
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
@@ -324,7 +370,6 @@ typedef struct vnet_dev_port
u8 started : 1;
u8 link_up : 1;
u8 promisc : 1;
- u8 interface_created : 1;
u8 rx_node_assigned : 1;
vnet_dev_counter_main_t *counter_main;
vnet_dev_queue_config_t rx_queue_config;
@@ -339,32 +384,12 @@ typedef struct vnet_dev_port
vnet_dev_tx_queue_t **tx_queues;
vnet_dev_port_ops_t port_ops;
vnet_dev_arg_t *args;
+ vnet_dev_arg_t *sec_if_args;
vnet_dev_rx_queue_ops_t rx_queue_ops;
vnet_dev_tx_queue_ops_t tx_queue_ops;
vnet_dev_node_t rx_node;
vnet_dev_node_t tx_node;
-
- struct
- {
- vnet_dev_if_name_t name;
- u32 dev_instance;
- u32 rx_node_index;
- u32 current_config_index;
- u16 rx_next_index;
- u16 redirect_to_node_next_index;
- u8 feature_arc_index;
- u8 feature_arc : 1;
- u8 redirect_to_node : 1;
- u8 default_is_intr_mode : 1;
- u8 consistent_qp : 1;
- u32 tx_node_index;
- u32 hw_if_index;
- u32 sw_if_index;
- u16 num_rx_queues;
- u16 num_tx_queues;
- u16 txq_sz;
- u16 rxq_sz;
- } intf;
+ vnet_dev_port_interfaces_t *interfaces;
CLIB_CACHE_LINE_ALIGN_MARK (data0);
u8 data[];
@@ -463,6 +488,8 @@ typedef struct
typedef struct
{
vnet_dev_port_t *port;
+ u32 sec_if_index;
+ u8 is_primary_if : 1;
} vnet_dev_instance_t;
typedef struct
@@ -493,6 +520,7 @@ typedef struct
vnet_dev_port_attr_t attr;
vnet_dev_port_ops_t ops;
vnet_dev_arg_t *args;
+ vnet_dev_arg_t *sec_if_args;
u16 data_size;
void *initial_data;
} port;
@@ -578,12 +606,44 @@ void vnet_dev_clear_hw_interface_counters (u32);
void vnet_dev_set_interface_next_node (vnet_main_t *, u32, u32);
/* port.c */
+
+typedef struct
+{
+ vnet_dev_if_name_t name;
+ u16 num_rx_queues;
+ u16 num_tx_queues;
+ u16 rxq_sz;
+ u16 txq_sz;
+ u8 default_is_intr_mode : 1;
+ u8 consistent_qp : 1;
+
+ /* return */
+ u32 sw_if_index;
+} vnet_dev_port_if_create_args_t;
+
+typedef struct
+{
+ vnet_dev_if_name_t name;
+ u8 *args;
+
+ /* return */
+ u32 sw_if_index;
+} vnet_dev_port_sec_if_create_args_t;
+
+typedef struct
+{
+ u32 sw_if_index;
+} vnet_dev_port_del_sec_if_args_t;
+
vnet_dev_port_op_t vnet_dev_port_start;
vnet_dev_port_op_t vnet_dev_port_start_all_rx_queues;
vnet_dev_port_op_t vnet_dev_port_start_all_tx_queues;
vnet_dev_port_op_no_rv_t vnet_dev_port_stop;
vnet_dev_port_op_no_rv_t vnet_dev_port_deinit;
vnet_dev_port_op_no_rv_t vnet_dev_port_free;
+vnet_dev_port_op_with_ptr_t vnet_dev_port_add_sec_if;
+vnet_dev_port_op_with_ptr_t vnet_dev_port_del_sec_if;
+
void vnet_dev_port_add_counters (vlib_main_t *, vnet_dev_port_t *,
vnet_dev_counter_t *, u16);
vnet_dev_port_op_no_rv_t vnet_dev_port_free_counters;
@@ -596,7 +656,7 @@ vnet_dev_port_cfg_change_req_validate (vlib_main_t *, vnet_dev_port_t *,
vnet_dev_port_cfg_change_req_t *);
vnet_dev_rv_t vnet_dev_port_cfg_change (vlib_main_t *, vnet_dev_port_t *,
vnet_dev_port_cfg_change_req_t *);
-vnet_dev_port_op_t vnet_dev_port_if_create;
+vnet_dev_port_op_with_ptr_t vnet_dev_port_if_create;
vnet_dev_port_op_t vnet_dev_port_if_remove;
/* queue.c */