summaryrefslogtreecommitdiffstats
path: root/src/plugins/rdma/rdma.h
diff options
context:
space:
mode:
authorMohammed Hawari <mohammed@hawari.fr>2020-10-21 14:48:38 +0200
committerDamjan Marion <dmarion@me.com>2020-10-24 09:25:19 +0000
commit4df9f737a24be94c2988f18337a4ad845b1b0186 (patch)
tree292a032012d443205db2988667946bb77aeb3008 /src/plugins/rdma/rdma.h
parent91603958d1d4fc3114739f9b264808940942e5c8 (diff)
rdma: implement striding rq for multiseg rx
This change leverages the striding RQ feature of ConnectX-5 adapters to support chained buffers on the RX path. In Striding RQ mode, WQE are SG lists of data segments, each mapped to a vlib_buffer. When a packet is received, it can consume one or multiple data segments belonging to the WQE, without wasting the whole WQE. Change-Id: I74eba5b2c2c66538e75e046335058ba011cb27fd Type: improvement Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Diffstat (limited to 'src/plugins/rdma/rdma.h')
-rw-r--r--src/plugins/rdma/rdma.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/plugins/rdma/rdma.h b/src/plugins/rdma/rdma.h
index 19bfb8b11e5..db8f740d946 100644
--- a/src/plugins/rdma/rdma.h
+++ b/src/plugins/rdma/rdma.h
@@ -30,7 +30,8 @@
_(1, ADMIN_UP, "admin-up") \
_(2, LINK_UP, "link-up") \
_(3, PROMISC, "promiscuous") \
- _(4, MLX5DV, "mlx5dv")
+ _(4, MLX5DV, "mlx5dv") \
+ _(5, STRIDING_RQ, "striding-rq")
enum
{
@@ -81,12 +82,17 @@ typedef struct
u16 n_mini_cqes_left;
u16 last_cqe_flags;
mlx5dv_cqe_t *cqes;
- mlx5dv_rwq_t *wqes;
+ mlx5dv_wqe_ds_t *wqes;
+ CLIB_CACHE_LINE_ALIGN_MARK (cacheline1);
volatile u32 *wq_db;
volatile u32 *cq_db;
u32 cqn;
u32 wqe_cnt;
u32 wq_stride;
+ u32 buf_sz;
+ u32 striding_wqe_tail;
+ u8 log_wqe_sz; /* log-size of a single WQE (in data segments) */
+ u8 log_stride_per_wqe; /* Striding RQ: number of strides in a single WQE */
} rdma_rxq_t;
typedef struct
@@ -146,7 +152,9 @@ STATIC_ASSERT_OFFSET_OF (rdma_txq_t, cacheline2, 128);
#define RDMA_TXQ_USED_SZ(head, tail) ((u16)((u16)(tail) - (u16)(head)))
#define RDMA_TXQ_AVAIL_SZ(txq, head, tail) ((u16)(RDMA_TXQ_BUF_SZ (txq) - RDMA_TXQ_USED_SZ (head, tail)))
-
+#define RDMA_RXQ_MAX_CHAIN_LOG_SZ 3 /* This should NOT be lower than 3! */
+#define RDMA_RXQ_MAX_CHAIN_SZ (1U << RDMA_RXQ_MAX_CHAIN_LOG_SZ)
+#define RDMA_RXQ_LEGACY_MODE_MAX_CHAIN_SZ 5
typedef struct
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
@@ -193,6 +201,8 @@ typedef struct
u16x16 cqe_flags16[VLIB_FRAME_SIZE / 16];
};
vlib_buffer_t buffer_template;
+ u32 current_segs[VLIB_FRAME_SIZE];
+ u32 to_free_buffers[VLIB_FRAME_SIZE];
} rdma_per_thread_data_t;
typedef struct