From: Leon Romanovsky <leonro@xxxxxxxxxxxx> Add Message Receipt Acknowledgment (MRA) definitions as it is written in IBTA release 1.3 volume 1. Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> --- drivers/infiniband/core/cm.c | 4 ++-- drivers/infiniband/core/cm_msgs.h | 13 ++++++++++++- include/rdma/ib_cm.h | 1 - 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 7163a5782bea..c477629f5106 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -2894,7 +2894,7 @@ int ib_send_cm_mra(struct ib_cm_id *cm_id, unsigned long flags; int ret; - if (private_data && private_data_len > IB_CM_MRA_PRIVATE_DATA_SIZE) + if (private_data && private_data_len > CM_MRA_PRIVATE_DATA_SIZE) return -EINVAL; data = cm_copy_private_data(private_data, private_data_len); @@ -2988,7 +2988,7 @@ static int cm_mra_handler(struct cm_work *work) return -EINVAL; work->cm_event.private_data = &mra_msg->private_data; - work->cm_event.private_data_len = IB_CM_MRA_PRIVATE_DATA_SIZE; + work->cm_event.private_data_len = CM_MRA_PRIVATE_DATA_SIZE; work->cm_event.param.mra_rcvd.service_timeout = cm_mra_get_service_timeout(mra_msg); timeout = cm_convert_to_ms(cm_mra_get_service_timeout(mra_msg)) + diff --git a/drivers/infiniband/core/cm_msgs.h b/drivers/infiniband/core/cm_msgs.h index a9112af2b325..20784b0fa4af 100644 --- a/drivers/infiniband/core/cm_msgs.h +++ b/drivers/infiniband/core/cm_msgs.h @@ -186,6 +186,17 @@ #define CM_REQ_PRIVATE_DATA_OFFSET 140 #define CM_REQ_PRIVATE_DATA_SIZE 92 +#define CM_MRA_LOCAL_COMM_ID_OFFSET 0 +#define CM_MRA_LOCAL_COMM_ID_MASK GENMASK(31, 0) +#define CM_MRA_REMOTE_COMM_ID_OFFSET 4 +#define CM_MRA_REMOTE_COMM_ID_MASK GENMASK(31, 0) +#define CM_MRA_MESSAGE_MRAED_OFFSET 8 +#define CM_MRA_MESSAGE_MRAED_MASK GENMASK(1, 0) +#define CM_MRA_SERVICE_TIMEOUT_OFFSET 9 +#define CM_MRA_SERVICE_TIMEOUT_MASK GENMASK(4, 0) +#define CM_MRA_PRIVATE_DATA_OFFSET 10 +#define CM_MRA_PRIVATE_DATA_SIZE 222 + struct cm_req_msg { struct ib_mad_hdr hdr; @@ -563,7 +574,7 @@ enum cm_msg_response { /* service timeout:5, rsvd:3 */ u8 offset9; - u8 private_data[IB_CM_MRA_PRIVATE_DATA_SIZE]; + u8 private_data[CM_MRA_PRIVATE_DATA_SIZE]; } __packed; diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h index 956256b2fc5d..6d73316be651 100644 --- a/include/rdma/ib_cm.h +++ b/include/rdma/ib_cm.h @@ -65,7 +65,6 @@ enum ib_cm_event_type { }; enum ib_cm_data_size { - IB_CM_MRA_PRIVATE_DATA_SIZE = 222, IB_CM_REJ_PRIVATE_DATA_SIZE = 148, IB_CM_REP_PRIVATE_DATA_SIZE = 196, IB_CM_RTU_PRIVATE_DATA_SIZE = 224, -- 2.20.1