acl-plugin: VPP-1241: fix the "show acl-plugin tables applied" output
[vpp.git] / src / plugins / memif / private.h
index 5904fc0..ad6295e 100644 (file)
@@ -83,6 +83,7 @@ typedef struct
   void *shm;
   memif_region_size_t region_size;
   int fd;
+  u8 is_external;
 } memif_region_t;
 
 typedef struct
@@ -101,11 +102,15 @@ typedef struct
 
   u16 last_head;
   u16 last_tail;
+  u32 *buffers;
 
   /* interrupts */
   int int_fd;
   uword int_clib_file_index;
   u64 int_count;
+
+  /* queue type */
+  memif_ring_type_t type;
 } memif_queue_t;
 
 #define foreach_memif_if_flag \
@@ -113,7 +118,9 @@ typedef struct
   _(1, IS_SLAVE, "slave")              \
   _(2, CONNECTING, "connecting")       \
   _(3, CONNECTED, "connected")         \
-  _(4, DELETING, "deleting")
+  _(4, DELETING, "deleting")           \
+  _(5, ZERO_COPY, "zero-copy")         \
+  _(6, ERROR, "error")
 
 typedef enum
 {
@@ -171,6 +178,36 @@ typedef struct
   u8 *remote_disc_string;
 } memif_if_t;
 
+typedef struct
+{
+  u32 packet_len;
+  u16 first_buffer_vec_index;
+} memif_packet_op_t;
+
+typedef struct
+{
+  void *data;
+  u32 data_len;
+  i16 buffer_offset;
+  u16 buffer_vec_index;
+} memif_copy_op_t;
+
+#define MEMIF_RX_VECTOR_SZ VLIB_FRAME_SIZE
+
+typedef struct
+{
+  CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
+
+  /* copy vector */
+  memif_packet_op_t packet_ops[MEMIF_RX_VECTOR_SZ];
+  memif_copy_op_t *copy_ops;
+  u32 *buffers;
+
+  /* buffer template */
+  vlib_buffer_t buffer_template;
+  memif_desc_t desc_template;
+} memif_per_thread_data_t;
+
 typedef struct
 {
   CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
@@ -185,8 +222,8 @@ typedef struct
   memif_socket_file_t *socket_files;
   uword *socket_file_index_by_sock_id; /* map user socket id to pool idx */
 
-  /* rx buffer cache */
-  u32 **rx_buffers;
+  /* per thread data */
+  memif_per_thread_data_t *per_thread_data;
 
 } memif_main_t;
 
@@ -206,6 +243,7 @@ typedef struct
   u32 socket_id;
   u8 *secret;
   u8 is_master;
+  u8 is_zero_copy;
   memif_interface_mode_t mode:8;
   memif_log2_ring_size_t log2_ring_size;
   u16 buffer_size;