Add cross-channel support
cover Add cross-channel support
From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>
This patchset adds libmlx5 part of cross-channel support [1].
These patches were added on top of "Completion timestamping" [2].
[1] http://comments.gmane.org/gmane.linux.drivers.rdma/31715
[2] http://www.spinics.net/lists/linux-rdma/msg30940.html
Changes from v0:
* Enrich cover message and commit messages.
* Add mlx5_post_send() implementation related to cross-channel work request opcodes.
Leon Romanovsky (2):
Add CQ ignore overrun creation flag
Add cross-channel work request opcodes
src/mlx5-abi.h | 14 ++++++++ src/mlx5.h | 9 ++++++ src/qp.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- src/verbs.c | 71 +++++++++++++++++++++++++++++++--------- src/wqe.h | 5 +++ 5 files changed, 178 insertions(+), 21 deletions(-)
Signature · 6 lines
1.7.12.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1452959758-29611-1-git-send-email-leon-2ukJVAZIZ/[email protected]
PATCH 1/2 Add CQ ignore overrun creation flag
From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>
In cross-channel mode, the send/receive queues will forward their completions to managing QP. It can cause to overrun errors in managed send/receive queues.
This patch adds ability to provide CQ flags for ibv_create_cq_ex calls and new flag to disable CQ overrun checks.
--- src/mlx5-abi.h | 14 ++++++++++++++ src/verbs.c | 57 ++++++++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 56 insertions(+), 15 deletions(-)
src/mlx5-abi.h +14 -0
@@ -91,6 +91,20 @@ struct mlx5_create_cq_resp {__u32 cqn; }; +struct mlx5_create_cq_ex { +struct ibv_create_cq_ex ibv_cmd; +__u64 buf_addr; +__u64 db_addr; +__u32 cqe_size; +__u32 comp_mask; +}; + +struct mlx5_create_cq_resp_ex { +struct ibv_create_cq_resp_ex ibv_resp; +__u32 cqn; +__u32 comp_mask; +}; +struct mlx5_create_srq {struct ibv_create_srq ibv_cmd;__u64 buf_addr;
src/verbs.c +42 -15
101 lines not on this page · raw message
Signature · 6 lines
1.7.12.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/2 Add cross-channel work request opcodes
In reply to a message not in the archiveFrom: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>
The cross-channel feature relies on special primitives to send and receive work requests.
* WAIT on CQ WR - This work request holds execution of subsequent requests on that queue until this number of completions of a CQ is met.
• SEND_EN WR - This work request specifies value of producer index on the controlled send queue. It enables the execution of all WQEs up to the work request which is marked by IBV_SEND_WAIT_EN_LAST flag.
• RECEIVE_EN WR - Same as SEND_EN but related to a receive queue.
--- src/mlx5.h | 9 ++++++ src/qp.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- src/verbs.c | 14 +++++++++ src/wqe.h | 5 +++ 4 files changed, 122 insertions(+), 6 deletions(-)
src/mlx5.h +9 -0
@@ -208,6 +208,10 @@ enum {MLX5_OPCODE_LOCAL_INVAL =0x1b ,MLX5_OPCODE_CONFIG_CMD =0x1f , +MLX5_OPCODE_SEND_ENABLE =0x17 , +MLX5_OPCODE_RECV_ENABLE =0x16 , +MLX5_OPCODE_CQE_WAIT =0x0f , +MLX5_RECV_OPCODE_RDMA_WRITE_IMM =0x00 ,MLX5_RECV_OPCODE_SEND =0x01 , MLX5_RECV_OPCODE_SEND_IMM = 0x02,
@@ -368,6 +372,8 @@ struct mlx5_cq {uint64_t stall_last_count;int stall_adaptive_enable;int stall_cycles; +uint32_t wait_index; +uint32_t wait_count; };struct mlx5_srq {
@@ -405,6 +411,8 @@ struct mlx5_wq {int wqe_shift;int offset;void *qend; +uint32_t head_en_index; +uint32_t head_en_count; };struct mlx5_bf {
@@ -437,6 +445,7 @@ struct mlx5_qp {uint32_t *db;struct mlx5_wq rq;int wq_sig; +uint32_t create_flags; };struct mlx5_av {
src/qp.c +94 -6
155 lines not on this page · raw message
src/verbs.c +14 -0
@@ -309,6 +309,9 @@ static struct ibv_cq *create_cq(struct ibv_context *context, } cq->cons_index =0 ; +/* Cross-channel wait index should start from value below 0 */ + cq->wait_index = (uint32_t )(-1 ); + cq->wait_count =0 ;if (mlx5_spinlock_init (&cq->lock)) goto err;
@@ -975,6 +978,17 @@ static int init_attr_v2(struct ibv_context *context, struct mlx5_qp *qp,struct mlx5_create_qp_resp_ex resp;int err; + qp->create_flags = (attr->create_flags & (IBV_QP_CREATE_IGNORE_SQ_OVERFLOW | +IBV_QP_CREATE_IGNORE_RQ_OVERFLOW | +IBV_QP_CREATE_CROSS_CHANNEL | +IBV_QP_CREATE_MANAGED_SEND | +IBV_QP_CREATE_MANAGED_RECV )); +/* +* These QP flags are virtual and don't need to +* be forwarded to the bottom layer. +*/ + attr->create_flags &= ~(IBV_QP_CREATE_IGNORE_SQ_OVERFLOW |IBV_QP_CREATE_IGNORE_RQ_OVERFLOW ); +memset (&cmd,0 ,sizeof (cmd));memset (&resp,0 ,sizeof (resp));if (qp->wq_sig)
src/wqe.h +5 -0
@@ -187,5 +187,10 @@ struct mlx5_wqe_inline_seg { uint32_t byte_count; }; +struct mlx5_wqe_wait_en_seg { +uint8_t rsvd0[8 ]; +uint32_t pi; +uint32_t obj_num; +};#endif /* WQE_H */
Signature · 6 lines
1.7.12.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html