X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fplugins%2Fmemif%2Fmemif.h;h=8539c9847320def3196ae544bbf9d5373539c295;hb=933fcf489;hp=11918eabcdec91be3fc1d221baa2d6798ee855d6;hpb=793fe2179c2403af330409f7e7d34bb0f7910b99;p=vpp.git diff --git a/src/plugins/memif/memif.h b/src/plugins/memif/memif.h index 11918eabcde..8539c984732 100644 --- a/src/plugins/memif/memif.h +++ b/src/plugins/memif/memif.h @@ -22,11 +22,13 @@ #define MEMIF_CACHELINE_SIZE 64 #endif -#define MEMIF_COOKIE 0x3E31F10 -#define MEMIF_VERSION_MAJOR 1 +#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 */ @@ -58,7 +60,7 @@ typedef enum } memif_interface_mode_t; typedef uint16_t memif_region_index_t; -typedef uint64_t memif_region_offset_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; @@ -85,7 +87,7 @@ typedef struct __attribute__ ((packed)) 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; @@ -103,6 +105,7 @@ typedef struct __attribute__ ((packed)) memif_region_index_t region; 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)) @@ -148,15 +151,13 @@ typedef struct __attribute__ ((packed)) uint16_t flags; #define MEMIF_DESC_FLAG_NEXT (1 << 0) memif_region_index_t region; - uint32_t buffer_length; uint32_t length; - uint8_t reserved[4]; memif_region_offset_t offset; - uint64_t metadata; + uint32_t metadata; } 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)))