ip: Router ID included in flow hash
[vpp.git] / src / vnet / interface.h
index 5c04c5d..e9e7462 100644 (file)
@@ -179,6 +179,8 @@ static __clib_unused void * __clib_unused_##f = f;
   _VNET_INTERFACE_FUNCTION_DECL(f,sw_interface_mtu_change)
 #define VNET_SW_INTERFACE_ADD_DEL_FUNCTION(f)                  \
   _VNET_INTERFACE_FUNCTION_DECL(f,sw_interface_add_del)
+#define VNET_SW_INTERFACE_ADD_DEL_FUNCTION_PRIO(f,p)           \
+  _VNET_INTERFACE_FUNCTION_DECL_PRIO(f,sw_interface_add_del,p)
 #define VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(f)            \
   _VNET_INTERFACE_FUNCTION_DECL(f,sw_interface_admin_up_down)
 #define VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION_PRIO(f,p)             \
@@ -324,6 +326,7 @@ CLIB_MARCH_SFX (devclass##_tx_fn_multiarch_register) (void)         \
   vlib_node_fn_registration_t *r;                                      \
   r = &CLIB_MARCH_SFX (devclass##_tx_fn_registration);                 \
   r->priority = CLIB_MARCH_FN_PRIORITY();                              \
+  r->name = CLIB_MARCH_VARIANT_STR;                                    \
   r->next_registration = devclass.tx_fn_registrations;                 \
   devclass.tx_fn_registrations = r;                                    \
 }                                                                      \
@@ -523,6 +526,29 @@ typedef enum vnet_hw_interface_flags_t_
   (VNET_HW_INTERFACE_FLAG_HALF_DUPLEX |                \
    VNET_HW_INTERFACE_FLAG_FULL_DUPLEX)
 
+typedef struct
+{
+  /* hw interface index */
+  u32 hw_if_index;
+
+  /* device instance */
+  u32 dev_instance;
+
+  /* index of thread pollling this queue */
+  u32 thread_index;
+
+  /* file index of queue interrupt line */
+  u32 file_index;
+
+  /* hardware queue identifier */
+  u32 queue_id;
+
+  /* mode */
+  vnet_hw_if_rx_mode mode : 8;
+#define VNET_HW_IF_RXQ_THREAD_ANY      ~0
+#define VNET_HW_IF_RXQ_NO_RX_INTERRUPT ~0
+} vnet_hw_if_rx_queue_t;
+
 /* Hardware-interface.  This corresponds to a physical wire
    that packets flow over. */
 typedef struct vnet_hw_interface_t
@@ -600,12 +626,10 @@ typedef struct vnet_hw_interface_t
   /* input node cpu index by queue */
   u32 *input_node_thread_index_by_queue;
 
-  /* vnet_hw_if_rx_mode by queue */
-  u8 *rx_mode_by_queue;
   vnet_hw_if_rx_mode default_rx_mode;
 
-  /* device input device_and_queue runtime index */
-  uword *dq_runtime_index_by_queue;
+  /* rx queues */
+  u32 *rx_queue_indices;
 
   /* numa node that hardware device connects to */
   u8 numa_node;
@@ -619,6 +643,18 @@ typedef struct vnet_hw_interface_t
   u32 trace_classify_table_index;
 } vnet_hw_interface_t;
 
+typedef struct
+{
+  u32 dev_instance;
+  u32 queue_id;
+} vnet_hw_if_rxq_poll_vector_t;
+
+typedef struct
+{
+  vnet_hw_if_rxq_poll_vector_t *rxq_poll_vector;
+  void *rxq_interrupts;
+} vnet_hw_if_rx_node_runtime_t;
+
 extern vnet_device_class_t vnet_local_interface_device_class;
 
 typedef enum
@@ -855,6 +891,10 @@ typedef struct
   /* Hardware interfaces. */
   vnet_hw_interface_t *hw_interfaces;
 
+  /* Hardware interface RX queues */
+  vnet_hw_if_rx_queue_t *hw_if_rx_queues;
+  uword *rxq_index_by_hw_if_index_and_queue_id;
+
   /* Hash table mapping HW interface name to index. */
   uword *hw_interface_by_name;
 
@@ -916,9 +956,7 @@ void vnet_pcap_drop_trace_filter_add_del (u32 error_index, int is_add);
 
 int vnet_interface_name_renumber (u32 sw_if_index, u32 new_show_dev_instance);
 
-uword vnet_interface_output_node (vlib_main_t * vm,
-                                 vlib_node_runtime_t * node,
-                                 vlib_frame_t * frame);
+vlib_node_function_t *vnet_interface_output_node_get (vlib_main_t * vm);
 
 void vnet_register_format_buffer_opaque_helper
   (vnet_buffer_opquae_formatter_t fn);