diff options
author | Damjan Marion <damarion@cisco.com> | 2017-11-02 17:07:59 +0100 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2018-03-22 15:54:43 +0000 |
commit | 5c37ce3e0264c0bec75610837c5819ff4407bd5c (patch) | |
tree | 445c8d5f9fa2ee7bdb1f8fb6e1228c1bcbf633d9 /src/plugins/memif/memif.h | |
parent | 32f4e18c59f368e9c43f4483de12353280c2149b (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/memif.h')
-rw-r--r-- | src/plugins/memif/memif.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/plugins/memif/memif.h b/src/plugins/memif/memif.h index 11918eabcde..38b54029e46 100644 --- a/src/plugins/memif/memif.h +++ b/src/plugins/memif/memif.h @@ -22,8 +22,8 @@ #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) @@ -58,7 +58,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; @@ -148,15 +148,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))) |