From: Leon Romanovsky <leonro@xxxxxxxxxxxx> Convert REQ path MTU field to use CM_GET/CM_SET macros. Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> --- drivers/infiniband/core/cm.c | 8 ++++---- drivers/infiniband/core/cm_msgs.h | 10 ---------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index ea3540cf9deb..442fb4dee55b 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -1289,7 +1289,7 @@ static void cm_format_req(struct cm_req_msg *req_msg, CM_SET(REQ_LOCAL_CM_RESPONSE_TIMEOUT, req_msg, param->local_cm_response_timeout); req_msg->pkey = param->primary_path->pkey; - cm_req_set_path_mtu(req_msg, param->primary_path->mtu); + CM_SET(REQ_PATH_PACKET_PAYLOAD_MTU, req_msg, param->primary_path->mtu); cm_req_set_max_cm_retries(req_msg, param->max_cm_retries); if (param->qp_type != IB_QPT_XRC_INI) { @@ -1576,7 +1576,7 @@ static void cm_format_paths_from_req(struct cm_req_msg *req_msg, primary_path->pkey = req_msg->pkey; primary_path->sl = cm_req_get_primary_sl(req_msg); primary_path->mtu_selector = IB_SA_EQ; - primary_path->mtu = cm_req_get_path_mtu(req_msg); + primary_path->mtu = CM_GET(REQ_PATH_PACKET_PAYLOAD_MTU, req_msg); primary_path->rate_selector = IB_SA_EQ; primary_path->rate = cm_req_get_primary_packet_rate(req_msg); primary_path->packet_life_time_selector = IB_SA_EQ; @@ -1597,7 +1597,7 @@ static void cm_format_paths_from_req(struct cm_req_msg *req_msg, alt_path->pkey = req_msg->pkey; alt_path->sl = cm_req_get_alt_sl(req_msg); alt_path->mtu_selector = IB_SA_EQ; - alt_path->mtu = cm_req_get_path_mtu(req_msg); + alt_path->mtu = CM_GET(REQ_PATH_PACKET_PAYLOAD_MTU, req_msg); alt_path->rate_selector = IB_SA_EQ; alt_path->rate = cm_req_get_alt_packet_rate(req_msg); alt_path->packet_life_time_selector = IB_SA_EQ; @@ -2032,7 +2032,7 @@ static int cm_req_handler(struct cm_work *work) cm_id_priv->remote_qpn = CM_GET(REQ_LOCAL_QPN, req_msg); cm_id_priv->initiator_depth = CM_GET(REQ_RESPONDED_RESOURCES, req_msg); cm_id_priv->responder_resources = CM_GET(REQ_INITIATOR_DEPTH, req_msg); - cm_id_priv->path_mtu = cm_req_get_path_mtu(req_msg); + cm_id_priv->path_mtu = CM_GET(REQ_PATH_PACKET_PAYLOAD_MTU, req_msg); 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); diff --git a/drivers/infiniband/core/cm_msgs.h b/drivers/infiniband/core/cm_msgs.h index ff7d4e9da833..485bfc523c64 100644 --- a/drivers/infiniband/core/cm_msgs.h +++ b/drivers/infiniband/core/cm_msgs.h @@ -400,16 +400,6 @@ struct cm_req_msg { } __packed; -static inline u8 cm_req_get_path_mtu(struct cm_req_msg *req_msg) -{ - return req_msg->offset50 >> 4; -} - -static inline void cm_req_set_path_mtu(struct cm_req_msg *req_msg, u8 path_mtu) -{ - req_msg->offset50 = (u8) ((req_msg->offset50 & 0xF) | (path_mtu << 4)); -} - static inline u8 cm_req_get_rnr_retry_count(struct cm_req_msg *req_msg) { return req_msg->offset50 & 0x7; -- 2.20.1