Lines Matching refs:req_msg

1279 static void cm_format_req(struct cm_req_msg *req_msg,  in cm_format_req()  argument
1291 cm_format_mad_hdr(&req_msg->hdr, CM_REQ_ATTR_ID, in cm_format_req()
1294 req_msg->local_comm_id = cm_id_priv->id.local_id; in cm_format_req()
1295 req_msg->service_id = param->service_id; in cm_format_req()
1296 req_msg->local_ca_guid = cm_id_priv->id.device->node_guid; in cm_format_req()
1297 cm_req_set_local_qpn(req_msg, cpu_to_be32(param->qp_num)); in cm_format_req()
1298 cm_req_set_init_depth(req_msg, param->initiator_depth); in cm_format_req()
1299 cm_req_set_remote_resp_timeout(req_msg, in cm_format_req()
1301 cm_req_set_qp_type(req_msg, param->qp_type); in cm_format_req()
1302 cm_req_set_flow_ctrl(req_msg, param->flow_control); in cm_format_req()
1303 cm_req_set_starting_psn(req_msg, cpu_to_be32(param->starting_psn)); in cm_format_req()
1304 cm_req_set_local_resp_timeout(req_msg, in cm_format_req()
1306 req_msg->pkey = param->primary_path->pkey; in cm_format_req()
1307 cm_req_set_path_mtu(req_msg, param->primary_path->mtu); in cm_format_req()
1308 cm_req_set_max_cm_retries(req_msg, param->max_cm_retries); in cm_format_req()
1311 cm_req_set_resp_res(req_msg, param->responder_resources); in cm_format_req()
1312 cm_req_set_retry_count(req_msg, param->retry_count); in cm_format_req()
1313 cm_req_set_rnr_retry_count(req_msg, param->rnr_retry_count); in cm_format_req()
1314 cm_req_set_srq(req_msg, param->srq); in cm_format_req()
1317 req_msg->primary_local_gid = pri_path->sgid; in cm_format_req()
1318 req_msg->primary_remote_gid = pri_path->dgid; in cm_format_req()
1320 req_msg->primary_local_gid.global.interface_id in cm_format_req()
1322 req_msg->primary_remote_gid.global.interface_id in cm_format_req()
1326 req_msg->primary_local_lid = pri_ext ? 0 : in cm_format_req()
1328 req_msg->primary_remote_lid = pri_ext ? 0 : in cm_format_req()
1332 req_msg->primary_local_lid = IB_LID_PERMISSIVE; in cm_format_req()
1333 req_msg->primary_remote_lid = IB_LID_PERMISSIVE; in cm_format_req()
1335 cm_req_set_primary_flow_label(req_msg, pri_path->flow_label); in cm_format_req()
1336 cm_req_set_primary_packet_rate(req_msg, pri_path->rate); in cm_format_req()
1337 req_msg->primary_traffic_class = pri_path->traffic_class; in cm_format_req()
1338 req_msg->primary_hop_limit = pri_path->hop_limit; in cm_format_req()
1339 cm_req_set_primary_sl(req_msg, pri_path->sl); in cm_format_req()
1340 cm_req_set_primary_subnet_local(req_msg, (pri_path->hop_limit <= 1)); in cm_format_req()
1341 cm_req_set_primary_local_ack_timeout(req_msg, in cm_format_req()
1352 req_msg->alt_local_gid = alt_path->sgid; in cm_format_req()
1353 req_msg->alt_remote_gid = alt_path->dgid; in cm_format_req()
1355 req_msg->alt_local_gid.global.interface_id in cm_format_req()
1357 req_msg->alt_remote_gid.global.interface_id in cm_format_req()
1361 req_msg->alt_local_lid = alt_ext ? 0 : in cm_format_req()
1363 req_msg->alt_remote_lid = alt_ext ? 0 : in cm_format_req()
1366 req_msg->alt_local_lid = IB_LID_PERMISSIVE; in cm_format_req()
1367 req_msg->alt_remote_lid = IB_LID_PERMISSIVE; in cm_format_req()
1369 cm_req_set_alt_flow_label(req_msg, in cm_format_req()
1371 cm_req_set_alt_packet_rate(req_msg, alt_path->rate); in cm_format_req()
1372 req_msg->alt_traffic_class = alt_path->traffic_class; in cm_format_req()
1373 req_msg->alt_hop_limit = alt_path->hop_limit; in cm_format_req()
1374 cm_req_set_alt_sl(req_msg, alt_path->sl); in cm_format_req()
1375 cm_req_set_alt_subnet_local(req_msg, (alt_path->hop_limit <= 1)); in cm_format_req()
1376 cm_req_set_alt_local_ack_timeout(req_msg, in cm_format_req()
1382 memcpy(req_msg->private_data, param->private_data, in cm_format_req()
1415 struct cm_req_msg *req_msg; in ib_send_cm_req() local
1469 req_msg = (struct cm_req_msg *) cm_id_priv->msg->mad; in ib_send_cm_req()
1470 cm_format_req(req_msg, cm_id_priv, param); in ib_send_cm_req()
1471 cm_id_priv->tid = req_msg->hdr.tid; in ib_send_cm_req()
1475 cm_id_priv->local_qpn = cm_req_get_local_qpn(req_msg); in ib_send_cm_req()
1476 cm_id_priv->rq_psn = cm_req_get_starting_psn(req_msg); in ib_send_cm_req()
1539 static bool cm_req_has_alt_path(struct cm_req_msg *req_msg) in cm_req_has_alt_path() argument
1541 return ((req_msg->alt_local_lid) || in cm_req_has_alt_path()
1542 (ib_is_opa_gid(&req_msg->alt_local_gid))); in cm_req_has_alt_path()
1554 static void cm_format_path_lid_from_req(struct cm_req_msg *req_msg, in cm_format_path_lid_from_req() argument
1562 ntohs(req_msg->primary_local_lid)); in cm_format_path_lid_from_req()
1564 ntohs(req_msg->primary_remote_lid)); in cm_format_path_lid_from_req()
1566 lid = opa_get_lid_from_gid(&req_msg->primary_local_gid); in cm_format_path_lid_from_req()
1569 lid = opa_get_lid_from_gid(&req_msg->primary_remote_gid); in cm_format_path_lid_from_req()
1573 if (!cm_req_has_alt_path(req_msg)) in cm_format_path_lid_from_req()
1577 sa_path_set_dlid(alt_path, ntohs(req_msg->alt_local_lid)); in cm_format_path_lid_from_req()
1578 sa_path_set_slid(alt_path, ntohs(req_msg->alt_remote_lid)); in cm_format_path_lid_from_req()
1580 lid = opa_get_lid_from_gid(&req_msg->alt_local_gid); in cm_format_path_lid_from_req()
1583 lid = opa_get_lid_from_gid(&req_msg->alt_remote_gid); in cm_format_path_lid_from_req()
1588 static void cm_format_paths_from_req(struct cm_req_msg *req_msg, in cm_format_paths_from_req() argument
1592 primary_path->dgid = req_msg->primary_local_gid; in cm_format_paths_from_req()
1593 primary_path->sgid = req_msg->primary_remote_gid; in cm_format_paths_from_req()
1594 primary_path->flow_label = cm_req_get_primary_flow_label(req_msg); in cm_format_paths_from_req()
1595 primary_path->hop_limit = req_msg->primary_hop_limit; in cm_format_paths_from_req()
1596 primary_path->traffic_class = req_msg->primary_traffic_class; in cm_format_paths_from_req()
1598 primary_path->pkey = req_msg->pkey; in cm_format_paths_from_req()
1599 primary_path->sl = cm_req_get_primary_sl(req_msg); in cm_format_paths_from_req()
1601 primary_path->mtu = cm_req_get_path_mtu(req_msg); in cm_format_paths_from_req()
1603 primary_path->rate = cm_req_get_primary_packet_rate(req_msg); in cm_format_paths_from_req()
1606 cm_req_get_primary_local_ack_timeout(req_msg); in cm_format_paths_from_req()
1608 primary_path->service_id = req_msg->service_id; in cm_format_paths_from_req()
1612 if (cm_req_has_alt_path(req_msg)) { in cm_format_paths_from_req()
1613 alt_path->dgid = req_msg->alt_local_gid; in cm_format_paths_from_req()
1614 alt_path->sgid = req_msg->alt_remote_gid; in cm_format_paths_from_req()
1615 alt_path->flow_label = cm_req_get_alt_flow_label(req_msg); in cm_format_paths_from_req()
1616 alt_path->hop_limit = req_msg->alt_hop_limit; in cm_format_paths_from_req()
1617 alt_path->traffic_class = req_msg->alt_traffic_class; in cm_format_paths_from_req()
1619 alt_path->pkey = req_msg->pkey; in cm_format_paths_from_req()
1620 alt_path->sl = cm_req_get_alt_sl(req_msg); in cm_format_paths_from_req()
1622 alt_path->mtu = cm_req_get_path_mtu(req_msg); in cm_format_paths_from_req()
1624 alt_path->rate = cm_req_get_alt_packet_rate(req_msg); in cm_format_paths_from_req()
1627 cm_req_get_alt_local_ack_timeout(req_msg); in cm_format_paths_from_req()
1629 alt_path->service_id = req_msg->service_id; in cm_format_paths_from_req()
1634 cm_format_path_lid_from_req(req_msg, primary_path, alt_path); in cm_format_paths_from_req()
1688 struct cm_req_msg *req_msg; in cm_format_req_event() local
1691 req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad; in cm_format_req_event()
1698 if (cm_req_has_alt_path(req_msg)) { in cm_format_req_event()
1704 param->remote_ca_guid = req_msg->local_ca_guid; in cm_format_req_event()
1705 param->remote_qkey = be32_to_cpu(req_msg->local_qkey); in cm_format_req_event()
1706 param->remote_qpn = be32_to_cpu(cm_req_get_local_qpn(req_msg)); in cm_format_req_event()
1707 param->qp_type = cm_req_get_qp_type(req_msg); in cm_format_req_event()
1708 param->starting_psn = be32_to_cpu(cm_req_get_starting_psn(req_msg)); in cm_format_req_event()
1709 param->responder_resources = cm_req_get_init_depth(req_msg); in cm_format_req_event()
1710 param->initiator_depth = cm_req_get_resp_res(req_msg); in cm_format_req_event()
1712 cm_req_get_remote_resp_timeout(req_msg); in cm_format_req_event()
1713 param->flow_control = cm_req_get_flow_ctrl(req_msg); in cm_format_req_event()
1715 cm_req_get_local_resp_timeout(req_msg); in cm_format_req_event()
1716 param->retry_count = cm_req_get_retry_count(req_msg); in cm_format_req_event()
1717 param->rnr_retry_count = cm_req_get_rnr_retry_count(req_msg); in cm_format_req_event()
1718 param->srq = cm_req_get_srq(req_msg); in cm_format_req_event()
1720 work->cm_event.private_data = &req_msg->private_data; in cm_format_req_event()
1852 struct cm_req_msg *req_msg; in cm_match_req() local
1855 req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad; in cm_match_req()
1892 req_msg->service_id); in cm_match_req()
1915 static void cm_process_routed_req(struct cm_req_msg *req_msg, struct ib_wc *wc) in cm_process_routed_req() argument
1917 if (!cm_req_get_primary_subnet_local(req_msg)) { in cm_process_routed_req()
1918 if (req_msg->primary_local_lid == IB_LID_PERMISSIVE) { in cm_process_routed_req()
1919 req_msg->primary_local_lid = ib_lid_be16(wc->slid); in cm_process_routed_req()
1920 cm_req_set_primary_sl(req_msg, wc->sl); in cm_process_routed_req()
1923 if (req_msg->primary_remote_lid == IB_LID_PERMISSIVE) in cm_process_routed_req()
1924 req_msg->primary_remote_lid = cpu_to_be16(wc->dlid_path_bits); in cm_process_routed_req()
1927 if (!cm_req_get_alt_subnet_local(req_msg)) { in cm_process_routed_req()
1928 if (req_msg->alt_local_lid == IB_LID_PERMISSIVE) { in cm_process_routed_req()
1929 req_msg->alt_local_lid = ib_lid_be16(wc->slid); in cm_process_routed_req()
1930 cm_req_set_alt_sl(req_msg, wc->sl); in cm_process_routed_req()
1933 if (req_msg->alt_remote_lid == IB_LID_PERMISSIVE) in cm_process_routed_req()
1934 req_msg->alt_remote_lid = cpu_to_be16(wc->dlid_path_bits); in cm_process_routed_req()
1942 struct cm_req_msg *req_msg; in cm_req_handler() local
1947 req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad; in cm_req_handler()
1954 cm_id_priv->id.remote_id = req_msg->local_comm_id; in cm_req_handler()
1966 cm_id_priv->timewait_info->work.remote_id = req_msg->local_comm_id; in cm_req_handler()
1967 cm_id_priv->timewait_info->remote_ca_guid = req_msg->local_ca_guid; in cm_req_handler()
1968 cm_id_priv->timewait_info->remote_qpn = cm_req_get_local_qpn(req_msg); in cm_req_handler()
1980 cm_id_priv->id.service_id = req_msg->service_id; in cm_req_handler()
1983 cm_process_routed_req(req_msg, work->mad_recv_wc->wc); in cm_req_handler()
1986 if (cm_req_has_alt_path(req_msg)) in cm_req_handler()
1999 &req_msg->primary_local_gid); in cm_req_handler()
2001 if (cm_req_has_alt_path(req_msg)) in cm_req_handler()
2003 cm_format_paths_from_req(req_msg, &work->path[0], in cm_req_handler()
2027 if (cm_req_has_alt_path(req_msg)) { in cm_req_handler()
2037 cm_id_priv->tid = req_msg->hdr.tid; in cm_req_handler()
2039 cm_req_get_local_resp_timeout(req_msg)); in cm_req_handler()
2040 cm_id_priv->max_cm_retries = cm_req_get_max_cm_retries(req_msg); in cm_req_handler()
2041 cm_id_priv->remote_qpn = cm_req_get_local_qpn(req_msg); in cm_req_handler()
2042 cm_id_priv->initiator_depth = cm_req_get_resp_res(req_msg); in cm_req_handler()
2043 cm_id_priv->responder_resources = cm_req_get_init_depth(req_msg); in cm_req_handler()
2044 cm_id_priv->path_mtu = cm_req_get_path_mtu(req_msg); in cm_req_handler()
2045 cm_id_priv->pkey = req_msg->pkey; in cm_req_handler()
2046 cm_id_priv->sq_psn = cm_req_get_starting_psn(req_msg); in cm_req_handler()
2047 cm_id_priv->retry_count = cm_req_get_retry_count(req_msg); in cm_req_handler()
2048 cm_id_priv->rnr_retry_count = cm_req_get_rnr_retry_count(req_msg); in cm_req_handler()
2049 cm_id_priv->qp_type = cm_req_get_qp_type(req_msg); in cm_req_handler()