Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
ip: Replace Sematics for Interface IP addresses
[vpp.git]
/
src
/
plugins
/
memif
/
memif.h
diff --git
a/src/plugins/memif/memif.h
b/src/plugins/memif/memif.h
index
30a27dc
..
8539c98
100644
(file)
--- a/
src/plugins/memif/memif.h
+++ b/
src/plugins/memif/memif.h
@@
-22,6
+22,13
@@
#define MEMIF_CACHELINE_SIZE 64
#endif
#define MEMIF_CACHELINE_SIZE 64
#endif
+#define MEMIF_COOKIE 0x3E31F20
+#define MEMIF_VERSION_MAJOR 2
+#define MEMIF_VERSION_MINOR 0
+#define MEMIF_VERSION ((MEMIF_VERSION_MAJOR << 8) | MEMIF_VERSION_MINOR)
+
+#define MEMIF_SECRET_SIZE 24
+
/*
* Type definitions
*/
/*
* Type definitions
*/
@@
-53,9
+60,12
@@
typedef enum
} memif_interface_mode_t;
typedef uint16_t memif_region_index_t;
} memif_interface_mode_t;
typedef uint16_t memif_region_index_t;
+typedef uint32_t memif_region_offset_t;
+typedef uint64_t memif_region_size_t;
typedef uint16_t memif_ring_index_t;
typedef uint32_t memif_interface_id_t;
typedef uint16_t memif_version_t;
typedef uint16_t memif_ring_index_t;
typedef uint32_t memif_interface_id_t;
typedef uint16_t memif_version_t;
+typedef uint8_t memif_log2_ring_size_t;
/*
* Socket messages
/*
* Socket messages
@@
-69,7
+79,7
@@
typedef struct __attribute__ ((packed))
memif_region_index_t max_region;
memif_ring_index_t max_m2s_ring;
memif_ring_index_t max_s2m_ring;
memif_region_index_t max_region;
memif_ring_index_t max_m2s_ring;
memif_ring_index_t max_s2m_ring;
-
uint8
_t max_log2_ring_size;
+
memif_log2_ring_size
_t max_log2_ring_size;
} memif_msg_hello_t;
typedef struct __attribute__ ((packed))
} memif_msg_hello_t;
typedef struct __attribute__ ((packed))
@@
-77,14
+87,14
@@
typedef struct __attribute__ ((packed))
memif_version_t version;
memif_interface_id_t id;
memif_interface_mode_t mode:8;
memif_version_t version;
memif_interface_id_t id;
memif_interface_mode_t mode:8;
- uint8_t secret[
24
];
+ uint8_t secret[
MEMIF_SECRET_SIZE
];
uint8_t name[32];
} memif_msg_init_t;
typedef struct __attribute__ ((packed))
{
memif_region_index_t index;
uint8_t name[32];
} memif_msg_init_t;
typedef struct __attribute__ ((packed))
{
memif_region_index_t index;
-
uint32
_t size;
+
memif_region_size
_t size;
} memif_msg_add_region_t;
typedef struct __attribute__ ((packed))
} memif_msg_add_region_t;
typedef struct __attribute__ ((packed))
@@
-93,8
+103,9
@@
typedef struct __attribute__ ((packed))
#define MEMIF_MSG_ADD_RING_FLAG_S2M (1 << 0)
memif_ring_index_t index;
memif_region_index_t region;
#define MEMIF_MSG_ADD_RING_FLAG_S2M (1 << 0)
memif_ring_index_t index;
memif_region_index_t region;
- uint32_t offset;
- uint8_t log2_ring_size;
+ memif_region_offset_t offset;
+ memif_log2_ring_size_t log2_ring_size;
+ uint16_t private_hdr_size; /* used for private metadata */
} memif_msg_add_ring_t;
typedef struct __attribute__ ((packed))
} memif_msg_add_ring_t;
typedef struct __attribute__ ((packed))
@@
-140,15
+151,13
@@
typedef struct __attribute__ ((packed))
uint16_t flags;
#define MEMIF_DESC_FLAG_NEXT (1 << 0)
memif_region_index_t region;
uint16_t flags;
#define MEMIF_DESC_FLAG_NEXT (1 << 0)
memif_region_index_t region;
- uint32_t buffer_length;
uint32_t length;
uint32_t length;
- uint8_t reserved[4];
- uint64_t offset;
- uint64_t metadata;
+ memif_region_offset_t offset;
+ uint32_t metadata;
} memif_desc_t;
} memif_desc_t;
-_Static_assert (sizeof (memif_desc_t) ==
32
,
- "Size of memif_dsct_t must be
32
");
+_Static_assert (sizeof (memif_desc_t) ==
16
,
+ "Size of memif_dsct_t must be
16 bytes
");
#define MEMIF_CACHELINE_ALIGN_MARK(mark) \
uint8_t mark[0] __attribute__((aligned(MEMIF_CACHELINE_SIZE)))
#define MEMIF_CACHELINE_ALIGN_MARK(mark) \
uint8_t mark[0] __attribute__((aligned(MEMIF_CACHELINE_SIZE)))