aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/memif/private.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-11-02 17:07:59 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2018-03-22 15:54:43 +0000
commit5c37ce3e0264c0bec75610837c5819ff4407bd5c (patch)
tree445c8d5f9fa2ee7bdb1f8fb6e1228c1bcbf633d9 /src/plugins/memif/private.h
parent32f4e18c59f368e9c43f4483de12353280c2149b (diff)
memif: version 2
In version 1 of the protocol sender was always ring producer and receiver was consumer. In version 2 slave is always producer, and in case of master-to-slave rings, slave is responsible for populating ring with empty buffers. As this is major change, we need to bump version number. In addition, descriptor size is reduced to 16 bytes. This change allows zero-copy-slave operation (to be privided in the separate patch). Change-Id: I02115d232f455ffc05c0bd247f7d03f47252cfaf Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Diffstat (limited to 'src/plugins/memif/private.h')
-rw-r--r--src/plugins/memif/private.h33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/plugins/memif/private.h b/src/plugins/memif/private.h
index b7c18c93e2a..f4ace4cee5d 100644
--- a/src/plugins/memif/private.h
+++ b/src/plugins/memif/private.h
@@ -176,6 +176,35 @@ typedef struct
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_per_thread_data_t;
+
+typedef struct
+{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
/** API message ID base */
@@ -188,8 +217,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;