[PATCH rdma-next 23/43] RDMA/cm: Convert REQ RNR retry timeout counter

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

 



From: Leon Romanovsky <leonro@xxxxxxxxxxxx>

Convert REQ RNR retry timeout counter to new scheme.

Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
---
 drivers/infiniband/core/cm.c      |  6 +++---
 drivers/infiniband/core/cm_msgs.h | 12 ------------
 2 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 442fb4dee55b..64b416e7f183 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -1296,7 +1296,7 @@ static void cm_format_req(struct cm_req_msg *req_msg,
 		CM_SET(REQ_RESPONDED_RESOURCES, req_msg,
 		       param->responder_resources);
 		CM_SET(REQ_RETRY_COUNT, req_msg, param->retry_count);
-		cm_req_set_rnr_retry_count(req_msg, param->rnr_retry_count);
+		CM_SET(REQ_RNR_RETRY_COUNT, req_msg, param->rnr_retry_count);
 		cm_req_set_srq(req_msg, param->srq);
 	}
 
@@ -1703,7 +1703,7 @@ static void cm_format_req_event(struct cm_work *work,
 	param->remote_cm_response_timeout =
 		CM_GET(REQ_LOCAL_CM_RESPONSE_TIMEOUT, req_msg);
 	param->retry_count = CM_GET(REQ_RETRY_COUNT, req_msg);
-	param->rnr_retry_count = cm_req_get_rnr_retry_count(req_msg);
+	param->rnr_retry_count = CM_GET(REQ_RNR_RETRY_COUNT, req_msg);
 	param->srq = cm_req_get_srq(req_msg);
 	param->ppath_sgid_attr = cm_id_priv->av.ah_attr.grh.sgid_attr;
 	work->cm_event.private_data = &req_msg->private_data;
@@ -2036,7 +2036,7 @@ static int cm_req_handler(struct cm_work *work)
 	cm_id_priv->pkey = req_msg->pkey;
 	cm_id_priv->sq_psn = CM_GET(REQ_STARTING_PSN, req_msg);
 	cm_id_priv->retry_count = CM_GET(REQ_RETRY_COUNT, req_msg);
-	cm_id_priv->rnr_retry_count = cm_req_get_rnr_retry_count(req_msg);
+	cm_id_priv->rnr_retry_count = CM_GET(REQ_RNR_RETRY_COUNT, req_msg);
 	cm_id_priv->qp_type = cm_req_get_qp_type(req_msg);
 
 	cm_format_req_event(work, cm_id_priv, &listen_cm_id_priv->id);
diff --git a/drivers/infiniband/core/cm_msgs.h b/drivers/infiniband/core/cm_msgs.h
index 485bfc523c64..37e9bf512940 100644
--- a/drivers/infiniband/core/cm_msgs.h
+++ b/drivers/infiniband/core/cm_msgs.h
@@ -400,18 +400,6 @@ struct cm_req_msg {
 
 } __packed;
 
-static inline u8 cm_req_get_rnr_retry_count(struct cm_req_msg *req_msg)
-{
-	return req_msg->offset50 & 0x7;
-}
-
-static inline void cm_req_set_rnr_retry_count(struct cm_req_msg *req_msg,
-					      u8 rnr_retry_count)
-{
-	req_msg->offset50 = (u8) ((req_msg->offset50 & 0xF8) |
-				  (rnr_retry_count & 0x7));
-}
-
 static inline u8 cm_req_get_max_cm_retries(struct cm_req_msg *req_msg)
 {
 	return req_msg->offset51 >> 4;
-- 
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