From: Leon Romanovsky <leonro@xxxxxxxxxxxx> Add RTU message 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 | 9 ++++++++- include/rdma/ib_cm.h | 1 - 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 85836f8e5c67..41cf2a0de051 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -2132,7 +2132,7 @@ int ib_send_cm_rtu(struct ib_cm_id *cm_id, void *data; int ret; - if (private_data && private_data_len > IB_CM_RTU_PRIVATE_DATA_SIZE) + if (private_data && private_data_len > CM_RTU_PRIVATE_DATA_SIZE) return -EINVAL; data = cm_copy_private_data(private_data, private_data_len); @@ -2397,7 +2397,7 @@ static int cm_rtu_handler(struct cm_work *work) return -EINVAL; work->cm_event.private_data = &rtu_msg->private_data; - work->cm_event.private_data_len = IB_CM_RTU_PRIVATE_DATA_SIZE; + work->cm_event.private_data_len = CM_RTU_PRIVATE_DATA_SIZE; spin_lock_irq(&cm_id_priv->lock); if (cm_id_priv->id.state != IB_CM_REP_SENT && diff --git a/drivers/infiniband/core/cm_msgs.h b/drivers/infiniband/core/cm_msgs.h index 39fcd1231378..6917e007c573 100644 --- a/drivers/infiniband/core/cm_msgs.h +++ b/drivers/infiniband/core/cm_msgs.h @@ -244,6 +244,13 @@ #define CM_REP_PRIVATE_DATA_OFFSET 36 #define CM_REP_PRIVATE_DATA_SIZE 196 +#define CM_RTU_LOCAL_COMM_ID_OFFSET 0 +#define CM_RTU_LOCAL_COMM_ID_MASK GENMASK(31, 0) +#define CM_RTU_REMOTE_COMM_ID_OFFSET 4 +#define CM_RTU_REMOTE_COMM_ID_MASK GENMASK(31, 0) +#define CM_RTU_PRIVATE_DATA_OFFSET 8 +#define CM_RTU_PRIVATE_DATA_SIZE 224 + struct cm_req_msg { struct ib_mad_hdr hdr; @@ -812,7 +819,7 @@ struct cm_rtu_msg { __be32 local_comm_id; __be32 remote_comm_id; - u8 private_data[IB_CM_RTU_PRIVATE_DATA_SIZE]; + u8 private_data[CM_RTU_PRIVATE_DATA_SIZE]; } __packed; diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h index ebfbf63388de..34dc12b30399 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_RTU_PRIVATE_DATA_SIZE = 224, IB_CM_DREQ_PRIVATE_DATA_SIZE = 220, IB_CM_DREP_PRIVATE_DATA_SIZE = 224, IB_CM_LAP_PRIVATE_DATA_SIZE = 168, -- 2.20.1