#define MEMIF_NAME_SZ 32
/*
- * S2M: direction slave -> master
- * M2S: direction master -> slave
+ * C2S: direction client -> server
+ * S2C: direction server -> client
*/
/*
} memif_msg_type_t;
typedef enum {
- MEMIF_RING_S2M, /**< buffer ring in direction slave -> master */
- MEMIF_RING_M2S, /**< buffer ring in direction master -> slave */
+ MEMIF_RING_C2S, /**< buffer ring in direction client -> server */
+ MEMIF_RING_S2C, /**< buffer ring in direction server -> client */
} memif_ring_type_t;
typedef enum {
*/
/**
- * M2S
- * Contains master interfaces configuration.
+ * S2C
+ * Contains server interfaces configuration.
*/
typedef struct __rte_packed {
uint8_t name[MEMIF_NAME_SZ]; /**< Client app name. In this case DPDK version */
memif_version_t min_version; /**< lowest supported memif version */
memif_version_t max_version; /**< highest supported memif version */
memif_region_index_t max_region; /**< maximum num of regions */
- memif_ring_index_t max_m2s_ring; /**< maximum num of M2S ring */
- memif_ring_index_t max_s2m_ring; /**< maximum num of S2M rings */
+ memif_ring_index_t max_s2c_ring; /**< maximum num of S2C ring */
+ memif_ring_index_t max_c2s_ring; /**< maximum num of C2S rings */
memif_log2_ring_size_t max_log2_ring_size; /**< maximum ring size (as log2) */
} memif_msg_hello_t;
/**
- * S2M
+ * C2S
* Contains information required to identify interface
- * to which the slave wants to connect.
+ * to which the client wants to connect.
*/
typedef struct __rte_packed {
memif_version_t version; /**< memif version */
} memif_msg_init_t;
/**
- * S2M
- * Request master to add new shared memory region to master interface.
+ * C2S
+ * Request server to add new shared memory region to server interface.
* Shared files file descriptor is passed in cmsghdr.
*/
typedef struct __rte_packed {
} memif_msg_add_region_t;
/**
- * S2M
- * Request master to add new ring to master interface.
+ * C2S
+ * Request server to add new ring to server interface.
*/
typedef struct __rte_packed {
uint16_t flags; /**< flags */
-#define MEMIF_MSG_ADD_RING_FLAG_S2M 1 /**< ring is in S2M direction */
+#define MEMIF_MSG_ADD_RING_FLAG_C2S 1 /**< ring is in C2S direction */
memif_ring_index_t index; /**< ring index */
memif_region_index_t region; /**< region index on which this ring is located */
memif_region_offset_t offset; /**< buffer start offset */
} memif_msg_add_ring_t;
/**
- * S2M
+ * C2S
* Finalize connection establishment.
*/
typedef struct __rte_packed {
- uint8_t if_name[MEMIF_NAME_SZ]; /**< slave interface name */
+ uint8_t if_name[MEMIF_NAME_SZ]; /**< client interface name */
} memif_msg_connect_t;
/**
- * M2S
+ * S2C
* Finalize connection establishment.
*/
typedef struct __rte_packed {
- uint8_t if_name[MEMIF_NAME_SZ]; /**< master interface name */
+ uint8_t if_name[MEMIF_NAME_SZ]; /**< server interface name */
} memif_msg_connected_t;
/**
- * S2M & M2S
+ * C2S & S2C
* Disconnect interfaces.
*/
typedef struct __rte_packed {
} memif_desc_t;
#define MEMIF_CACHELINE_ALIGN_MARK(mark) \
- uint8_t mark[0] __rte_aligned(RTE_CACHE_LINE_SIZE)
+ RTE_MARKER mark __rte_cache_aligned;
typedef struct {
MEMIF_CACHELINE_ALIGN_MARK(cacheline0);
uint32_t cookie; /**< MEMIF_COOKIE */
uint16_t flags; /**< flags */
#define MEMIF_RING_FLAG_MASK_INT 1 /**< disable interrupt mode */
- volatile uint16_t head; /**< pointer to ring buffer head */
+ uint16_t head; /**< pointer to ring buffer head */
MEMIF_CACHELINE_ALIGN_MARK(cacheline1);
- volatile uint16_t tail; /**< pointer to ring buffer tail */
+ uint16_t tail; /**< pointer to ring buffer tail */
MEMIF_CACHELINE_ALIGN_MARK(cacheline2);
memif_desc_t desc[0]; /**< buffer descriptors */
} memif_ring_t;