Lines Matching refs:req_msg
1276 static void cm_format_req(struct cm_req_msg *req_msg, in cm_format_req() argument
1288 cm_format_mad_hdr(&req_msg->hdr, CM_REQ_ATTR_ID, in cm_format_req()
1291 req_msg->local_comm_id = cm_id_priv->id.local_id; in cm_format_req()
1292 req_msg->service_id = param->service_id; in cm_format_req()
1293 req_msg->local_ca_guid = cm_id_priv->id.device->node_guid; in cm_format_req()
1294 cm_req_set_local_qpn(req_msg, cpu_to_be32(param->qp_num)); in cm_format_req()
1295 cm_req_set_init_depth(req_msg, param->initiator_depth); in cm_format_req()
1296 cm_req_set_remote_resp_timeout(req_msg, in cm_format_req()
1298 cm_req_set_qp_type(req_msg, param->qp_type); in cm_format_req()
1299 cm_req_set_flow_ctrl(req_msg, param->flow_control); in cm_format_req()
1300 cm_req_set_starting_psn(req_msg, cpu_to_be32(param->starting_psn)); in cm_format_req()
1301 cm_req_set_local_resp_timeout(req_msg, in cm_format_req()
1303 req_msg->pkey = param->primary_path->pkey; in cm_format_req()
1304 cm_req_set_path_mtu(req_msg, param->primary_path->mtu); in cm_format_req()
1305 cm_req_set_max_cm_retries(req_msg, param->max_cm_retries); in cm_format_req()
1308 cm_req_set_resp_res(req_msg, param->responder_resources); in cm_format_req()
1309 cm_req_set_retry_count(req_msg, param->retry_count); in cm_format_req()
1310 cm_req_set_rnr_retry_count(req_msg, param->rnr_retry_count); in cm_format_req()
1311 cm_req_set_srq(req_msg, param->srq); in cm_format_req()
1314 req_msg->primary_local_gid = pri_path->sgid; in cm_format_req()
1315 req_msg->primary_remote_gid = pri_path->dgid; in cm_format_req()
1317 req_msg->primary_local_gid.global.interface_id in cm_format_req()
1319 req_msg->primary_remote_gid.global.interface_id in cm_format_req()
1323 req_msg->primary_local_lid = pri_ext ? 0 : in cm_format_req()
1325 req_msg->primary_remote_lid = pri_ext ? 0 : in cm_format_req()
1329 req_msg->primary_local_lid = IB_LID_PERMISSIVE; in cm_format_req()
1330 req_msg->primary_remote_lid = IB_LID_PERMISSIVE; in cm_format_req()
1332 cm_req_set_primary_flow_label(req_msg, pri_path->flow_label); in cm_format_req()
1333 cm_req_set_primary_packet_rate(req_msg, pri_path->rate); in cm_format_req()
1334 req_msg->primary_traffic_class = pri_path->traffic_class; in cm_format_req()
1335 req_msg->primary_hop_limit = pri_path->hop_limit; in cm_format_req()
1336 cm_req_set_primary_sl(req_msg, pri_path->sl); in cm_format_req()
1337 cm_req_set_primary_subnet_local(req_msg, (pri_path->hop_limit <= 1)); in cm_format_req()
1338 cm_req_set_primary_local_ack_timeout(req_msg, in cm_format_req()
1349 req_msg->alt_local_gid = alt_path->sgid; in cm_format_req()
1350 req_msg->alt_remote_gid = alt_path->dgid; in cm_format_req()
1352 req_msg->alt_local_gid.global.interface_id in cm_format_req()
1354 req_msg->alt_remote_gid.global.interface_id in cm_format_req()
1358 req_msg->alt_local_lid = alt_ext ? 0 : in cm_format_req()
1360 req_msg->alt_remote_lid = alt_ext ? 0 : in cm_format_req()
1363 req_msg->alt_local_lid = IB_LID_PERMISSIVE; in cm_format_req()
1364 req_msg->alt_remote_lid = IB_LID_PERMISSIVE; in cm_format_req()
1366 cm_req_set_alt_flow_label(req_msg, in cm_format_req()
1368 cm_req_set_alt_packet_rate(req_msg, alt_path->rate); in cm_format_req()
1369 req_msg->alt_traffic_class = alt_path->traffic_class; in cm_format_req()
1370 req_msg->alt_hop_limit = alt_path->hop_limit; in cm_format_req()
1371 cm_req_set_alt_sl(req_msg, alt_path->sl); in cm_format_req()
1372 cm_req_set_alt_subnet_local(req_msg, (alt_path->hop_limit <= 1)); in cm_format_req()
1373 cm_req_set_alt_local_ack_timeout(req_msg, in cm_format_req()
1379 memcpy(req_msg->private_data, param->private_data, in cm_format_req()
1412 struct cm_req_msg *req_msg; in ib_send_cm_req() local
1466 req_msg = (struct cm_req_msg *) cm_id_priv->msg->mad; in ib_send_cm_req()
1467 cm_format_req(req_msg, cm_id_priv, param); in ib_send_cm_req()
1468 cm_id_priv->tid = req_msg->hdr.tid; in ib_send_cm_req()
1472 cm_id_priv->local_qpn = cm_req_get_local_qpn(req_msg); in ib_send_cm_req()
1473 cm_id_priv->rq_psn = cm_req_get_starting_psn(req_msg); in ib_send_cm_req()
1536 static bool cm_req_has_alt_path(struct cm_req_msg *req_msg) in cm_req_has_alt_path() argument
1538 return ((req_msg->alt_local_lid) || in cm_req_has_alt_path()
1539 (ib_is_opa_gid(&req_msg->alt_local_gid))); in cm_req_has_alt_path()
1551 static void cm_format_path_lid_from_req(struct cm_req_msg *req_msg, in cm_format_path_lid_from_req() argument
1559 ntohs(req_msg->primary_local_lid)); in cm_format_path_lid_from_req()
1561 ntohs(req_msg->primary_remote_lid)); in cm_format_path_lid_from_req()
1563 lid = opa_get_lid_from_gid(&req_msg->primary_local_gid); in cm_format_path_lid_from_req()
1566 lid = opa_get_lid_from_gid(&req_msg->primary_remote_gid); in cm_format_path_lid_from_req()
1570 if (!cm_req_has_alt_path(req_msg)) in cm_format_path_lid_from_req()
1574 sa_path_set_dlid(alt_path, ntohs(req_msg->alt_local_lid)); in cm_format_path_lid_from_req()
1575 sa_path_set_slid(alt_path, ntohs(req_msg->alt_remote_lid)); in cm_format_path_lid_from_req()
1577 lid = opa_get_lid_from_gid(&req_msg->alt_local_gid); in cm_format_path_lid_from_req()
1580 lid = opa_get_lid_from_gid(&req_msg->alt_remote_gid); in cm_format_path_lid_from_req()
1585 static void cm_format_paths_from_req(struct cm_req_msg *req_msg, in cm_format_paths_from_req() argument
1589 primary_path->dgid = req_msg->primary_local_gid; in cm_format_paths_from_req()
1590 primary_path->sgid = req_msg->primary_remote_gid; in cm_format_paths_from_req()
1591 primary_path->flow_label = cm_req_get_primary_flow_label(req_msg); in cm_format_paths_from_req()
1592 primary_path->hop_limit = req_msg->primary_hop_limit; in cm_format_paths_from_req()
1593 primary_path->traffic_class = req_msg->primary_traffic_class; in cm_format_paths_from_req()
1595 primary_path->pkey = req_msg->pkey; in cm_format_paths_from_req()
1596 primary_path->sl = cm_req_get_primary_sl(req_msg); in cm_format_paths_from_req()
1598 primary_path->mtu = cm_req_get_path_mtu(req_msg); in cm_format_paths_from_req()
1600 primary_path->rate = cm_req_get_primary_packet_rate(req_msg); in cm_format_paths_from_req()
1603 cm_req_get_primary_local_ack_timeout(req_msg); in cm_format_paths_from_req()
1605 primary_path->service_id = req_msg->service_id; in cm_format_paths_from_req()
1609 if (cm_req_has_alt_path(req_msg)) { in cm_format_paths_from_req()
1610 alt_path->dgid = req_msg->alt_local_gid; in cm_format_paths_from_req()
1611 alt_path->sgid = req_msg->alt_remote_gid; in cm_format_paths_from_req()
1612 alt_path->flow_label = cm_req_get_alt_flow_label(req_msg); in cm_format_paths_from_req()
1613 alt_path->hop_limit = req_msg->alt_hop_limit; in cm_format_paths_from_req()
1614 alt_path->traffic_class = req_msg->alt_traffic_class; in cm_format_paths_from_req()
1616 alt_path->pkey = req_msg->pkey; in cm_format_paths_from_req()
1617 alt_path->sl = cm_req_get_alt_sl(req_msg); in cm_format_paths_from_req()
1619 alt_path->mtu = cm_req_get_path_mtu(req_msg); in cm_format_paths_from_req()
1621 alt_path->rate = cm_req_get_alt_packet_rate(req_msg); in cm_format_paths_from_req()
1624 cm_req_get_alt_local_ack_timeout(req_msg); in cm_format_paths_from_req()
1626 alt_path->service_id = req_msg->service_id; in cm_format_paths_from_req()
1631 cm_format_path_lid_from_req(req_msg, primary_path, alt_path); in cm_format_paths_from_req()
1685 struct cm_req_msg *req_msg; in cm_format_req_event() local
1688 req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad; in cm_format_req_event()
1695 if (cm_req_has_alt_path(req_msg)) { in cm_format_req_event()
1701 param->remote_ca_guid = req_msg->local_ca_guid; in cm_format_req_event()
1702 param->remote_qkey = be32_to_cpu(req_msg->local_qkey); in cm_format_req_event()
1703 param->remote_qpn = be32_to_cpu(cm_req_get_local_qpn(req_msg)); in cm_format_req_event()
1704 param->qp_type = cm_req_get_qp_type(req_msg); in cm_format_req_event()
1705 param->starting_psn = be32_to_cpu(cm_req_get_starting_psn(req_msg)); in cm_format_req_event()
1706 param->responder_resources = cm_req_get_init_depth(req_msg); in cm_format_req_event()
1707 param->initiator_depth = cm_req_get_resp_res(req_msg); in cm_format_req_event()
1709 cm_req_get_remote_resp_timeout(req_msg); in cm_format_req_event()
1710 param->flow_control = cm_req_get_flow_ctrl(req_msg); in cm_format_req_event()
1712 cm_req_get_local_resp_timeout(req_msg); in cm_format_req_event()
1713 param->retry_count = cm_req_get_retry_count(req_msg); in cm_format_req_event()
1714 param->rnr_retry_count = cm_req_get_rnr_retry_count(req_msg); in cm_format_req_event()
1715 param->srq = cm_req_get_srq(req_msg); in cm_format_req_event()
1717 work->cm_event.private_data = &req_msg->private_data; in cm_format_req_event()
1849 struct cm_req_msg *req_msg; in cm_match_req() local
1852 req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad; in cm_match_req()
1889 req_msg->service_id); in cm_match_req()
1912 static void cm_process_routed_req(struct cm_req_msg *req_msg, struct ib_wc *wc) in cm_process_routed_req() argument
1914 if (!cm_req_get_primary_subnet_local(req_msg)) { in cm_process_routed_req()
1915 if (req_msg->primary_local_lid == IB_LID_PERMISSIVE) { in cm_process_routed_req()
1916 req_msg->primary_local_lid = ib_lid_be16(wc->slid); in cm_process_routed_req()
1917 cm_req_set_primary_sl(req_msg, wc->sl); in cm_process_routed_req()
1920 if (req_msg->primary_remote_lid == IB_LID_PERMISSIVE) in cm_process_routed_req()
1921 req_msg->primary_remote_lid = cpu_to_be16(wc->dlid_path_bits); in cm_process_routed_req()
1924 if (!cm_req_get_alt_subnet_local(req_msg)) { in cm_process_routed_req()
1925 if (req_msg->alt_local_lid == IB_LID_PERMISSIVE) { in cm_process_routed_req()
1926 req_msg->alt_local_lid = ib_lid_be16(wc->slid); in cm_process_routed_req()
1927 cm_req_set_alt_sl(req_msg, wc->sl); in cm_process_routed_req()
1930 if (req_msg->alt_remote_lid == IB_LID_PERMISSIVE) in cm_process_routed_req()
1931 req_msg->alt_remote_lid = cpu_to_be16(wc->dlid_path_bits); in cm_process_routed_req()
1939 struct cm_req_msg *req_msg; in cm_req_handler() local
1944 req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad; in cm_req_handler()
1951 cm_id_priv->id.remote_id = req_msg->local_comm_id; in cm_req_handler()
1963 cm_id_priv->timewait_info->work.remote_id = req_msg->local_comm_id; in cm_req_handler()
1964 cm_id_priv->timewait_info->remote_ca_guid = req_msg->local_ca_guid; in cm_req_handler()
1965 cm_id_priv->timewait_info->remote_qpn = cm_req_get_local_qpn(req_msg); in cm_req_handler()
1977 cm_id_priv->id.service_id = req_msg->service_id; in cm_req_handler()
1980 cm_process_routed_req(req_msg, work->mad_recv_wc->wc); in cm_req_handler()
1983 if (cm_req_has_alt_path(req_msg)) in cm_req_handler()
1997 &req_msg->primary_local_gid); in cm_req_handler()
1999 if (cm_req_has_alt_path(req_msg)) in cm_req_handler()
2001 cm_format_paths_from_req(req_msg, &work->path[0], in cm_req_handler()
2025 if (cm_req_has_alt_path(req_msg)) { in cm_req_handler()
2035 cm_id_priv->tid = req_msg->hdr.tid; in cm_req_handler()
2037 cm_req_get_local_resp_timeout(req_msg)); in cm_req_handler()
2038 cm_id_priv->max_cm_retries = cm_req_get_max_cm_retries(req_msg); in cm_req_handler()
2039 cm_id_priv->remote_qpn = cm_req_get_local_qpn(req_msg); in cm_req_handler()
2040 cm_id_priv->initiator_depth = cm_req_get_resp_res(req_msg); in cm_req_handler()
2041 cm_id_priv->responder_resources = cm_req_get_init_depth(req_msg); in cm_req_handler()
2042 cm_id_priv->path_mtu = cm_req_get_path_mtu(req_msg); in cm_req_handler()
2043 cm_id_priv->pkey = req_msg->pkey; in cm_req_handler()
2044 cm_id_priv->sq_psn = cm_req_get_starting_psn(req_msg); in cm_req_handler()
2045 cm_id_priv->retry_count = cm_req_get_retry_count(req_msg); in cm_req_handler()
2046 cm_id_priv->rnr_retry_count = cm_req_get_rnr_retry_count(req_msg); in cm_req_handler()
2047 cm_id_priv->qp_type = cm_req_get_qp_type(req_msg); in cm_req_handler()