[PATCH rdma-next 07/43] RDMA/cm: Request For Communication Release (DREQ) definitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Leon Romanovsky <leonro@xxxxxxxxxxxx>

Add DREQ 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 | 11 ++++++++++-
 include/rdma/ib_cm.h              |  1 -
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 41cf2a0de051..7f3cc66372eb 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -2449,7 +2449,7 @@ int ib_send_cm_dreq(struct ib_cm_id *cm_id,
 	unsigned long flags;
 	int ret;
 
-	if (private_data && private_data_len > IB_CM_DREQ_PRIVATE_DATA_SIZE)
+	if (private_data && private_data_len > CM_DREQ_PRIVATE_DATA_SIZE)
 		return -EINVAL;
 
 	cm_id_priv = container_of(cm_id, struct cm_id_private, id);
@@ -2600,7 +2600,7 @@ static int cm_dreq_handler(struct cm_work *work)
 	}
 
 	work->cm_event.private_data = &dreq_msg->private_data;
-	work->cm_event.private_data_len = IB_CM_DREQ_PRIVATE_DATA_SIZE;
+	work->cm_event.private_data_len = CM_DREQ_PRIVATE_DATA_SIZE;
 
 	spin_lock_irq(&cm_id_priv->lock);
 	if (cm_id_priv->local_qpn != cm_dreq_get_remote_qpn(dreq_msg))
diff --git a/drivers/infiniband/core/cm_msgs.h b/drivers/infiniband/core/cm_msgs.h
index 6917e007c573..dded0bd59479 100644
--- a/drivers/infiniband/core/cm_msgs.h
+++ b/drivers/infiniband/core/cm_msgs.h
@@ -251,6 +251,15 @@
 #define CM_RTU_PRIVATE_DATA_OFFSET 8
 #define CM_RTU_PRIVATE_DATA_SIZE 224
 
+#define CM_DREQ_LOCAL_COMM_ID_OFFSET 0
+#define CM_DREQ_LOCAL_COMM_ID_MASK GENMASK(31, 0)
+#define CM_DREQ_REMOTE_COMM_ID_OFFSET 4
+#define CM_DREQ_REMOTE_COMM_ID__MASK GENMASK(31, 0)
+#define CM_DREQ_REMOTE_QPN_EECN_OFFSET 8
+#define CM_DREQ_REMOTE_QPN_EECN_MASK GENMASK(23, 0)
+#define CM_DREQ_PRIVATE_DATA_OFFSET 12
+#define CM_DREQ_PRIVATE_DATA_SIZE 220
+
 struct cm_req_msg {
 	struct ib_mad_hdr hdr;
 
@@ -831,7 +840,7 @@ struct cm_dreq_msg {
 	/* remote QPN/EECN:24, rsvd:8 */
 	__be32 offset8;
 
-	u8 private_data[IB_CM_DREQ_PRIVATE_DATA_SIZE];
+	u8 private_data[CM_DREQ_PRIVATE_DATA_SIZE];
 
 } __packed;
 
diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h
index 34dc12b30399..77f4818aaf10 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_DREQ_PRIVATE_DATA_SIZE	 = 220,
 	IB_CM_DREP_PRIVATE_DATA_SIZE	 = 224,
 	IB_CM_LAP_PRIVATE_DATA_SIZE	 = 168,
 	IB_CM_APR_PRIVATE_DATA_SIZE	 = 148,
-- 
2.20.1




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux