From: Leon Romanovsky <leonro@xxxxxxxxxxxx> Convert REP target ack delay field. Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> --- drivers/infiniband/core/cm.c | 8 ++++---- drivers/infiniband/core/cm_msgs.h | 12 ------------ 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index af32d1e68b11..596be796f7bc 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -2067,8 +2067,8 @@ static void cm_format_rep(struct cm_rep_msg *rep_msg, rep_msg->remote_comm_id = cm_id_priv->id.remote_id; CM_SET(REP_STARTING_PSN, rep_msg, param->starting_psn); rep_msg->resp_resources = param->responder_resources; - cm_rep_set_target_ack_delay(rep_msg, - cm_id_priv->av.port->cm_dev->ack_delay); + CM_SET(REP_TARGET_ACK_DELAY, rep_msg, + cm_id_priv->av.port->cm_dev->ack_delay); cm_rep_set_failover(rep_msg, param->failover_accepted); cm_rep_set_rnr_retry_count(rep_msg, param->rnr_retry_count); rep_msg->local_ca_guid = cm_id_priv->id.device->node_guid; @@ -2222,7 +2222,7 @@ static void cm_format_rep_event(struct cm_work *work, enum ib_qp_type qp_type) param->starting_psn = CM_GET(REP_STARTING_PSN, rep_msg); param->responder_resources = rep_msg->initiator_depth; param->initiator_depth = rep_msg->resp_resources; - param->target_ack_delay = cm_rep_get_target_ack_delay(rep_msg); + param->target_ack_delay = CM_GET(REP_TARGET_ACK_DELAY, rep_msg); param->failover_accepted = cm_rep_get_failover(rep_msg); param->flow_control = cm_rep_get_flow_ctrl(rep_msg); param->rnr_retry_count = cm_rep_get_rnr_retry_count(rep_msg); @@ -2368,7 +2368,7 @@ static int cm_rep_handler(struct cm_work *work) cm_id_priv->responder_resources = rep_msg->initiator_depth; cm_id_priv->sq_psn = CM_GET(REP_STARTING_PSN, rep_msg); cm_id_priv->rnr_retry_count = cm_rep_get_rnr_retry_count(rep_msg); - cm_id_priv->target_ack_delay = cm_rep_get_target_ack_delay(rep_msg); + cm_id_priv->target_ack_delay = CM_GET(REP_TARGET_ACK_DELAY, rep_msg); cm_id_priv->av.timeout = cm_ack_timeout(cm_id_priv->target_ack_delay, cm_id_priv->av.timeout - 1); diff --git a/drivers/infiniband/core/cm_msgs.h b/drivers/infiniband/core/cm_msgs.h index 6dc1a1086820..a3207f984c32 100644 --- a/drivers/infiniband/core/cm_msgs.h +++ b/drivers/infiniband/core/cm_msgs.h @@ -462,18 +462,6 @@ struct cm_rep_msg { } __packed; -static inline u8 cm_rep_get_target_ack_delay(struct cm_rep_msg *rep_msg) -{ - return (u8) (rep_msg->offset26 >> 3); -} - -static inline void cm_rep_set_target_ack_delay(struct cm_rep_msg *rep_msg, - u8 target_ack_delay) -{ - rep_msg->offset26 = (u8) ((rep_msg->offset26 & 0x07) | - (target_ack_delay << 3)); -} - static inline u8 cm_rep_get_failover(struct cm_rep_msg *rep_msg) { return (u8) ((rep_msg->offset26 & 0x06) >> 1); -- 2.20.1