diff options
author | Mohammed Hawari <mohammed@hawari.fr> | 2020-10-21 14:48:38 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-10-24 09:25:19 +0000 |
commit | 4df9f737a24be94c2988f18337a4ad845b1b0186 (patch) | |
tree | 292a032012d443205db2988667946bb77aeb3008 /src/plugins/rdma/rdma_mlx5dv.h | |
parent | 91603958d1d4fc3114739f9b264808940942e5c8 (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_mlx5dv.h')
-rw-r--r-- | src/plugins/rdma/rdma_mlx5dv.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/plugins/rdma/rdma_mlx5dv.h b/src/plugins/rdma/rdma_mlx5dv.h index 43d9002d050..efcefe7fbf7 100644 --- a/src/plugins/rdma/rdma_mlx5dv.h +++ b/src/plugins/rdma/rdma_mlx5dv.h @@ -21,7 +21,8 @@ #undef always_inline #include <infiniband/mlx5dv.h> #define always_inline static_always_inline - +#include <vppinfra/types.h> +#include <vppinfra/error.h> /* CQE flags - bits 16-31 of qword at offset 0x1c */ #define CQE_FLAG_L4_OK 10 #define CQE_FLAG_L3_OK 9 @@ -35,6 +36,11 @@ #define CQE_FLAG_L3_HDR_TYPE_IP6 2 #define CQE_FLAG_IP_EXT_OPTS 1 +/* CQE byte count (Striding RQ) */ +#define CQE_BC_FILLER_MASK (1 << 31) +#define CQE_BC_CONSUMED_STRIDES_SHIFT (16) +#define CQE_BC_CONSUMED_STRIDES_MASK (0x3fff << CQE_BC_CONSUMED_STRIDES_SHIFT) +#define CQE_BC_BYTE_COUNT_MASK (0xffff) typedef struct { struct @@ -47,7 +53,9 @@ typedef struct u32 byte_cnt; u32 mini_cqe_num; }; - u8 pad3[15]; + u8 pad3[12]; + u16 wqe_counter; + u8 signature; u8 opcode_cqefmt_se_owner; }; } mlx5dv_cqe_t; @@ -68,7 +76,15 @@ typedef struct { u64 dsz_and_lkey; u64 addr; -} mlx5dv_rwq_t; +} mlx5dv_wqe_ds_t; /* a WQE data segment */ + +typedef struct +{ + u8 rsvd0[2]; + u16 next_wqe_index; + u8 signature; + u8 rsvd1[11]; +} mlx5dv_wqe_srq_next_t; #define foreach_cqe_rx_field \ _(0x1c, 26, 26, l4_ok) \ |