Lines Matching refs:p_hwfn

62 static int qed_iwarp_async_event(struct qed_hwfn *p_hwfn, u8 fw_event_code,
67 void qed_iwarp_init_devinfo(struct qed_hwfn *p_hwfn) in qed_iwarp_init_devinfo() argument
69 struct qed_rdma_device *dev = p_hwfn->p_rdma_info->dev; in qed_iwarp_init_devinfo()
74 p_hwfn->p_rdma_info->num_qps) - in qed_iwarp_init_devinfo()
83 void qed_iwarp_init_hw(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) in qed_iwarp_init_hw() argument
85 p_hwfn->rdma_prs_search_reg = PRS_REG_SEARCH_TCP; in qed_iwarp_init_hw()
86 qed_wr(p_hwfn, p_ptt, p_hwfn->rdma_prs_search_reg, 1); in qed_iwarp_init_hw()
87 p_hwfn->b_rdma_enabled_in_prs = true; in qed_iwarp_init_hw()
94 static void qed_iwarp_cid_cleaned(struct qed_hwfn *p_hwfn, u32 cid) in qed_iwarp_cid_cleaned() argument
96 cid -= qed_cxt_get_proto_cid_start(p_hwfn, p_hwfn->p_rdma_info->proto); in qed_iwarp_cid_cleaned()
98 spin_lock_bh(&p_hwfn->p_rdma_info->lock); in qed_iwarp_cid_cleaned()
101 qed_bmap_release_id(p_hwfn, &p_hwfn->p_rdma_info->tcp_cid_map, in qed_iwarp_cid_cleaned()
104 qed_bmap_release_id(p_hwfn, &p_hwfn->p_rdma_info->cid_map, cid); in qed_iwarp_cid_cleaned()
106 spin_unlock_bh(&p_hwfn->p_rdma_info->lock); in qed_iwarp_cid_cleaned()
110 qed_iwarp_init_fw_ramrod(struct qed_hwfn *p_hwfn, in qed_iwarp_init_fw_ramrod() argument
114 RESC_START(p_hwfn, QED_LL2_RAM_QUEUE) + in qed_iwarp_init_fw_ramrod()
115 p_hwfn->p_rdma_info->iwarp.ll2_ooo_handle; in qed_iwarp_init_fw_ramrod()
124 static int qed_iwarp_alloc_cid(struct qed_hwfn *p_hwfn, u32 *cid) in qed_iwarp_alloc_cid() argument
128 spin_lock_bh(&p_hwfn->p_rdma_info->lock); in qed_iwarp_alloc_cid()
129 rc = qed_rdma_bmap_alloc_id(p_hwfn, &p_hwfn->p_rdma_info->cid_map, cid); in qed_iwarp_alloc_cid()
130 spin_unlock_bh(&p_hwfn->p_rdma_info->lock); in qed_iwarp_alloc_cid()
132 DP_NOTICE(p_hwfn, "Failed in allocating iwarp cid\n"); in qed_iwarp_alloc_cid()
135 *cid += qed_cxt_get_proto_cid_start(p_hwfn, p_hwfn->p_rdma_info->proto); in qed_iwarp_alloc_cid()
137 rc = qed_cxt_dynamic_ilt_alloc(p_hwfn, QED_ELEM_CXT, *cid); in qed_iwarp_alloc_cid()
139 qed_iwarp_cid_cleaned(p_hwfn, *cid); in qed_iwarp_alloc_cid()
144 static void qed_iwarp_set_tcp_cid(struct qed_hwfn *p_hwfn, u32 cid) in qed_iwarp_set_tcp_cid() argument
146 cid -= qed_cxt_get_proto_cid_start(p_hwfn, p_hwfn->p_rdma_info->proto); in qed_iwarp_set_tcp_cid()
148 spin_lock_bh(&p_hwfn->p_rdma_info->lock); in qed_iwarp_set_tcp_cid()
149 qed_bmap_set_id(p_hwfn, &p_hwfn->p_rdma_info->tcp_cid_map, cid); in qed_iwarp_set_tcp_cid()
150 spin_unlock_bh(&p_hwfn->p_rdma_info->lock); in qed_iwarp_set_tcp_cid()
158 static int qed_iwarp_alloc_tcp_cid(struct qed_hwfn *p_hwfn, u32 *cid) in qed_iwarp_alloc_tcp_cid() argument
162 spin_lock_bh(&p_hwfn->p_rdma_info->lock); in qed_iwarp_alloc_tcp_cid()
164 rc = qed_rdma_bmap_alloc_id(p_hwfn, in qed_iwarp_alloc_tcp_cid()
165 &p_hwfn->p_rdma_info->tcp_cid_map, cid); in qed_iwarp_alloc_tcp_cid()
167 spin_unlock_bh(&p_hwfn->p_rdma_info->lock); in qed_iwarp_alloc_tcp_cid()
170 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_alloc_tcp_cid()
172 p_hwfn->p_rdma_info->tcp_cid_map.max_count); in qed_iwarp_alloc_tcp_cid()
178 *cid += qed_cxt_get_proto_cid_start(p_hwfn, in qed_iwarp_alloc_tcp_cid()
179 p_hwfn->p_rdma_info->proto); in qed_iwarp_alloc_tcp_cid()
183 int qed_iwarp_create_qp(struct qed_hwfn *p_hwfn, in qed_iwarp_create_qp() argument
194 qp->shared_queue = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, in qed_iwarp_create_qp()
210 rc = qed_iwarp_alloc_cid(p_hwfn, &cid); in qed_iwarp_create_qp()
217 init_data.opaque_fid = p_hwfn->hw_info.opaque_fid; in qed_iwarp_create_qp()
221 rc = qed_sp_init_request(p_hwfn, &p_ent, in qed_iwarp_create_qp()
256 p_ramrod->srq_id.opaque_fid = cpu_to_le16(p_hwfn->hw_info.opaque_fid); in qed_iwarp_create_qp()
261 cpu_to_le32((p_hwfn->hw_info.opaque_fid << 16) | qp->sq_cq_id); in qed_iwarp_create_qp()
263 cpu_to_le32((p_hwfn->hw_info.opaque_fid << 16) | qp->rq_cq_id); in qed_iwarp_create_qp()
267 physical_queue = qed_get_cm_pq_idx(p_hwfn, PQ_FLAGS_OFLD); in qed_iwarp_create_qp()
269 physical_queue = qed_get_cm_pq_idx(p_hwfn, PQ_FLAGS_ACK); in qed_iwarp_create_qp()
272 rc = qed_spq_post(p_hwfn, p_ent, NULL); in qed_iwarp_create_qp()
279 qed_iwarp_cid_cleaned(p_hwfn, cid); in qed_iwarp_create_qp()
281 dma_free_coherent(&p_hwfn->cdev->pdev->dev, in qed_iwarp_create_qp()
288 static int qed_iwarp_modify_fw(struct qed_hwfn *p_hwfn, struct qed_rdma_qp *qp) in qed_iwarp_modify_fw() argument
299 init_data.opaque_fid = p_hwfn->hw_info.opaque_fid; in qed_iwarp_modify_fw()
302 rc = qed_sp_init_request(p_hwfn, &p_ent, in qed_iwarp_modify_fw()
304 p_hwfn->p_rdma_info->proto, &init_data); in qed_iwarp_modify_fw()
321 rc = qed_spq_post(p_hwfn, p_ent, NULL); in qed_iwarp_modify_fw()
323 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "QP(0x%x)rc=%d\n", qp->icid, rc); in qed_iwarp_modify_fw()
376 qed_iwarp_modify_qp(struct qed_hwfn *p_hwfn, in qed_iwarp_modify_qp() argument
387 spin_lock_bh(&p_hwfn->p_rdma_info->iwarp.qp_lock); in qed_iwarp_modify_qp()
391 spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.qp_lock); in qed_iwarp_modify_qp()
448 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "QP(0x%x) %s --> %s%s\n", in qed_iwarp_modify_qp()
454 spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.qp_lock); in qed_iwarp_modify_qp()
457 rc = qed_iwarp_modify_fw(p_hwfn, qp); in qed_iwarp_modify_qp()
462 int qed_iwarp_fw_destroy(struct qed_hwfn *p_hwfn, struct qed_rdma_qp *qp) in qed_iwarp_fw_destroy() argument
471 init_data.opaque_fid = p_hwfn->hw_info.opaque_fid; in qed_iwarp_fw_destroy()
474 rc = qed_sp_init_request(p_hwfn, &p_ent, in qed_iwarp_fw_destroy()
476 p_hwfn->p_rdma_info->proto, &init_data); in qed_iwarp_fw_destroy()
480 rc = qed_spq_post(p_hwfn, p_ent, NULL); in qed_iwarp_fw_destroy()
482 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "QP(0x%x) rc = %d\n", qp->icid, rc); in qed_iwarp_fw_destroy()
487 static void qed_iwarp_destroy_ep(struct qed_hwfn *p_hwfn, in qed_iwarp_destroy_ep() argument
491 dma_free_coherent(&p_hwfn->cdev->pdev->dev, in qed_iwarp_destroy_ep()
496 spin_lock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_destroy_ep()
498 spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_destroy_ep()
507 int qed_iwarp_destroy_qp(struct qed_hwfn *p_hwfn, struct qed_rdma_qp *qp) in qed_iwarp_destroy_qp() argument
514 rc = qed_iwarp_modify_qp(p_hwfn, qp, in qed_iwarp_destroy_qp()
527 DP_NOTICE(p_hwfn, "ep state close timeout state=%x\n", in qed_iwarp_destroy_qp()
530 qed_iwarp_destroy_ep(p_hwfn, ep, false); in qed_iwarp_destroy_qp()
533 rc = qed_iwarp_fw_destroy(p_hwfn, qp); in qed_iwarp_destroy_qp()
536 dma_free_coherent(&p_hwfn->cdev->pdev->dev, in qed_iwarp_destroy_qp()
544 qed_iwarp_create_ep(struct qed_hwfn *p_hwfn, struct qed_iwarp_ep **ep_out) in qed_iwarp_create_ep() argument
555 ep->ep_buffer_virt = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, in qed_iwarp_create_ep()
576 qed_iwarp_print_tcp_ramrod(struct qed_hwfn *p_hwfn, in qed_iwarp_print_tcp_ramrod() argument
579 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "local_mac=%x %x %x, remote_mac=%x %x %x\n", in qed_iwarp_print_tcp_ramrod()
588 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_print_tcp_ramrod()
596 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_print_tcp_ramrod()
605 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_print_tcp_ramrod()
615 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "syn_ip_payload_length=%x, lo=%x, hi=%x\n", in qed_iwarp_print_tcp_ramrod()
622 qed_iwarp_tcp_offload(struct qed_hwfn *p_hwfn, struct qed_iwarp_ep *ep) in qed_iwarp_tcp_offload() argument
624 struct qed_iwarp_info *iwarp_info = &p_hwfn->p_rdma_info->iwarp; in qed_iwarp_tcp_offload()
639 init_data.opaque_fid = p_hwfn->hw_info.opaque_fid; in qed_iwarp_tcp_offload()
645 rc = qed_sp_init_request(p_hwfn, &p_ent, in qed_iwarp_tcp_offload()
669 physical_q = qed_get_cm_pq_idx(p_hwfn, PQ_FLAGS_OFLD); in qed_iwarp_tcp_offload()
671 physical_q = qed_get_cm_pq_idx(p_hwfn, PQ_FLAGS_ACK); in qed_iwarp_tcp_offload()
684 tcp_flags = p_hwfn->p_rdma_info->iwarp.tcp_flags; in qed_iwarp_tcp_offload()
713 tcp->rcv_wnd_scale = (u8)p_hwfn->p_rdma_info->iwarp.rcv_wnd_scale; in qed_iwarp_tcp_offload()
723 qed_iwarp_print_tcp_ramrod(p_hwfn, p_tcp_ramrod); in qed_iwarp_tcp_offload()
725 rc = qed_spq_post(p_hwfn, p_ent, NULL); in qed_iwarp_tcp_offload()
727 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_tcp_offload()
734 qed_iwarp_mpa_received(struct qed_hwfn *p_hwfn, struct qed_iwarp_ep *ep) in qed_iwarp_mpa_received() argument
736 struct qed_iwarp_info *iwarp_info = &p_hwfn->p_rdma_info->iwarp; in qed_iwarp_mpa_received()
748 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_mpa_received()
798 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_mpa_received()
819 qed_iwarp_mpa_offload(struct qed_hwfn *p_hwfn, struct qed_iwarp_ep *ep) in qed_iwarp_mpa_offload() argument
842 init_data.opaque_fid = p_hwfn->hw_info.opaque_fid; in qed_iwarp_mpa_offload()
849 rc = qed_sp_init_request(p_hwfn, &p_ent, in qed_iwarp_mpa_offload()
864 common->crc_needed = p_hwfn->p_rdma_info->iwarp.crc_needed; in qed_iwarp_mpa_offload()
869 val = p_hwfn->hw_info.opaque_fid << 16 | ep->tcp_cid; in qed_iwarp_mpa_offload()
890 RESC_START(p_hwfn, QED_RDMA_STATS_QUEUE) + qp->stats_queue; in qed_iwarp_mpa_offload()
895 iwarp_info = &p_hwfn->p_rdma_info->iwarp; in qed_iwarp_mpa_offload()
902 rc = qed_spq_post(p_hwfn, p_ent, NULL); in qed_iwarp_mpa_offload()
906 DP_VERBOSE(p_hwfn, in qed_iwarp_mpa_offload()
918 qed_iwarp_return_ep(struct qed_hwfn *p_hwfn, struct qed_iwarp_ep *ep) in qed_iwarp_return_ep() argument
930 qed_iwarp_alloc_tcp_cid(p_hwfn, &ep->tcp_cid); in qed_iwarp_return_ep()
932 spin_lock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_return_ep()
935 &p_hwfn->p_rdma_info->iwarp.ep_free_list); in qed_iwarp_return_ep()
937 spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_return_ep()
941 qed_iwarp_parse_private_data(struct qed_hwfn *p_hwfn, struct qed_iwarp_ep *ep) in qed_iwarp_parse_private_data() argument
949 if (MPA_REV2(p_hwfn->p_rdma_info->iwarp.mpa_rev)) { in qed_iwarp_parse_private_data()
968 qed_iwarp_mpa_reply_arrived(struct qed_hwfn *p_hwfn, struct qed_iwarp_ep *ep) in qed_iwarp_mpa_reply_arrived() argument
973 DP_NOTICE(p_hwfn, in qed_iwarp_mpa_reply_arrived()
980 qed_iwarp_parse_private_data(p_hwfn, ep); in qed_iwarp_mpa_reply_arrived()
982 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_mpa_reply_arrived()
1002 qed_iwarp_mpa_complete(struct qed_hwfn *p_hwfn, in qed_iwarp_mpa_complete() argument
1013 qed_iwarp_parse_private_data(p_hwfn, ep); in qed_iwarp_mpa_complete()
1015 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_mpa_complete()
1027 qed_iwarp_modify_qp(p_hwfn, ep->qp, QED_IWARP_QP_STATE_RTS, 1); in qed_iwarp_mpa_complete()
1032 DP_NOTICE(p_hwfn, "%s(0x%x) MPA timeout\n", in qed_iwarp_mpa_complete()
1037 DP_NOTICE(p_hwfn, "%s(0x%x) MPA Reject\n", in qed_iwarp_mpa_complete()
1042 DP_NOTICE(p_hwfn, "%s(0x%x) MPA reset(tcp cid: 0x%x)\n", in qed_iwarp_mpa_complete()
1048 DP_NOTICE(p_hwfn, "%s(0x%x) MPA received FIN\n", in qed_iwarp_mpa_complete()
1053 DP_NOTICE(p_hwfn, "%s(0x%x) MPA insufficient ird\n", in qed_iwarp_mpa_complete()
1058 DP_NOTICE(p_hwfn, "%s(0x%x) MPA RTR MISMATCH\n", in qed_iwarp_mpa_complete()
1063 DP_NOTICE(p_hwfn, "%s(0x%x) MPA Invalid Packet\n", in qed_iwarp_mpa_complete()
1068 DP_NOTICE(p_hwfn, "%s(0x%x) MPA Local Error\n", in qed_iwarp_mpa_complete()
1073 DP_NOTICE(p_hwfn, "%s(0x%x) MPA TERMINATE\n", in qed_iwarp_mpa_complete()
1097 qed_iwarp_return_ep(p_hwfn, ep); in qed_iwarp_mpa_complete()
1099 spin_lock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_mpa_complete()
1101 spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_mpa_complete()
1107 qed_iwarp_mpa_v2_set_private(struct qed_hwfn *p_hwfn, in qed_iwarp_mpa_v2_set_private() argument
1138 DP_VERBOSE(p_hwfn, in qed_iwarp_mpa_v2_set_private()
1157 struct qed_hwfn *p_hwfn = rdma_cxt; in qed_iwarp_connect() local
1166 DP_NOTICE(p_hwfn, in qed_iwarp_connect()
1174 iwarp_info = &p_hwfn->p_rdma_info->iwarp; in qed_iwarp_connect()
1177 rc = qed_iwarp_alloc_cid(p_hwfn, &cid); in qed_iwarp_connect()
1181 rc = qed_iwarp_create_ep(p_hwfn, &ep); in qed_iwarp_connect()
1187 spin_lock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_connect()
1188 list_add_tail(&ep->list_entry, &p_hwfn->p_rdma_info->iwarp.ep_list); in qed_iwarp_connect()
1189 spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_connect()
1209 qed_iwarp_mpa_v2_set_private(p_hwfn, ep, &mpa_data_size); in qed_iwarp_connect()
1228 rc = qed_iwarp_tcp_offload(p_hwfn, ep); in qed_iwarp_connect()
1230 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "QP(0x%x) EP(0x%x) rc = %d\n", in qed_iwarp_connect()
1234 qed_iwarp_destroy_ep(p_hwfn, ep, true); in qed_iwarp_connect()
1240 qed_iwarp_cid_cleaned(p_hwfn, cid); in qed_iwarp_connect()
1245 static struct qed_iwarp_ep *qed_iwarp_get_free_ep(struct qed_hwfn *p_hwfn) in qed_iwarp_get_free_ep() argument
1250 spin_lock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_get_free_ep()
1252 if (list_empty(&p_hwfn->p_rdma_info->iwarp.ep_free_list)) { in qed_iwarp_get_free_ep()
1253 DP_ERR(p_hwfn, "Ep list is empty\n"); in qed_iwarp_get_free_ep()
1257 ep = list_first_entry(&p_hwfn->p_rdma_info->iwarp.ep_free_list, in qed_iwarp_get_free_ep()
1264 rc = qed_iwarp_alloc_tcp_cid(p_hwfn, &ep->tcp_cid); in qed_iwarp_get_free_ep()
1280 spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_get_free_ep()
1292 qed_iwarp_wait_cid_map_cleared(struct qed_hwfn *p_hwfn, struct qed_bmap *bmap) in qed_iwarp_wait_cid_map_cleared() argument
1307 if (p_hwfn->cdev->recov_in_prog) in qed_iwarp_wait_cid_map_cleared()
1322 DP_NOTICE(p_hwfn, in qed_iwarp_wait_cid_map_cleared()
1331 static int qed_iwarp_wait_for_all_cids(struct qed_hwfn *p_hwfn) in qed_iwarp_wait_for_all_cids() argument
1336 rc = qed_iwarp_wait_cid_map_cleared(p_hwfn, in qed_iwarp_wait_for_all_cids()
1337 &p_hwfn->p_rdma_info->tcp_cid_map); in qed_iwarp_wait_for_all_cids()
1343 qed_bmap_release_id(p_hwfn, &p_hwfn->p_rdma_info->cid_map, i); in qed_iwarp_wait_for_all_cids()
1346 return qed_iwarp_wait_cid_map_cleared(p_hwfn, in qed_iwarp_wait_for_all_cids()
1347 &p_hwfn->p_rdma_info->cid_map); in qed_iwarp_wait_for_all_cids()
1350 static void qed_iwarp_free_prealloc_ep(struct qed_hwfn *p_hwfn) in qed_iwarp_free_prealloc_ep() argument
1354 while (!list_empty(&p_hwfn->p_rdma_info->iwarp.ep_free_list)) { in qed_iwarp_free_prealloc_ep()
1355 spin_lock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_free_prealloc_ep()
1357 ep = list_first_entry(&p_hwfn->p_rdma_info->iwarp.ep_free_list, in qed_iwarp_free_prealloc_ep()
1361 spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_free_prealloc_ep()
1366 spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_free_prealloc_ep()
1369 qed_iwarp_cid_cleaned(p_hwfn, ep->tcp_cid); in qed_iwarp_free_prealloc_ep()
1371 qed_iwarp_destroy_ep(p_hwfn, ep, false); in qed_iwarp_free_prealloc_ep()
1375 static int qed_iwarp_prealloc_ep(struct qed_hwfn *p_hwfn, bool init) in qed_iwarp_prealloc_ep() argument
1385 rc = qed_iwarp_create_ep(p_hwfn, &ep); in qed_iwarp_prealloc_ep()
1393 rc = qed_iwarp_alloc_cid(p_hwfn, &cid); in qed_iwarp_prealloc_ep()
1396 qed_iwarp_set_tcp_cid(p_hwfn, cid); in qed_iwarp_prealloc_ep()
1402 qed_iwarp_alloc_tcp_cid(p_hwfn, &cid); in qed_iwarp_prealloc_ep()
1407 spin_lock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_prealloc_ep()
1409 &p_hwfn->p_rdma_info->iwarp.ep_free_list); in qed_iwarp_prealloc_ep()
1410 spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_prealloc_ep()
1416 qed_iwarp_destroy_ep(p_hwfn, ep, false); in qed_iwarp_prealloc_ep()
1421 int qed_iwarp_alloc(struct qed_hwfn *p_hwfn) in qed_iwarp_alloc() argument
1429 rc = qed_rdma_bmap_alloc(p_hwfn, &p_hwfn->p_rdma_info->tcp_cid_map, in qed_iwarp_alloc()
1432 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_alloc()
1437 INIT_LIST_HEAD(&p_hwfn->p_rdma_info->iwarp.ep_free_list); in qed_iwarp_alloc()
1438 spin_lock_init(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_alloc()
1440 rc = qed_iwarp_prealloc_ep(p_hwfn, true); in qed_iwarp_alloc()
1444 return qed_ooo_alloc(p_hwfn); in qed_iwarp_alloc()
1447 void qed_iwarp_resc_free(struct qed_hwfn *p_hwfn) in qed_iwarp_resc_free() argument
1449 struct qed_iwarp_info *iwarp_info = &p_hwfn->p_rdma_info->iwarp; in qed_iwarp_resc_free()
1451 qed_ooo_free(p_hwfn); in qed_iwarp_resc_free()
1452 qed_rdma_bmap_free(p_hwfn, &p_hwfn->p_rdma_info->tcp_cid_map, 1); in qed_iwarp_resc_free()
1460 struct qed_hwfn *p_hwfn = rdma_cxt; in qed_iwarp_accept() local
1467 DP_ERR(p_hwfn, "Ep Context receive in accept is NULL\n"); in qed_iwarp_accept()
1471 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "QP(0x%x) EP(0x%x)\n", in qed_iwarp_accept()
1476 DP_VERBOSE(p_hwfn, in qed_iwarp_accept()
1484 qed_iwarp_prealloc_ep(p_hwfn, false); in qed_iwarp_accept()
1506 qed_iwarp_mpa_v2_set_private(p_hwfn, ep, &mpa_data_size); in qed_iwarp_accept()
1515 rc = qed_iwarp_mpa_offload(p_hwfn, ep); in qed_iwarp_accept()
1517 qed_iwarp_modify_qp(p_hwfn, in qed_iwarp_accept()
1525 struct qed_hwfn *p_hwfn = rdma_cxt; in qed_iwarp_reject() local
1531 DP_ERR(p_hwfn, "Ep Context receive in reject is NULL\n"); in qed_iwarp_reject()
1535 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "EP(0x%x)\n", ep->tcp_cid); in qed_iwarp_reject()
1540 qed_iwarp_mpa_v2_set_private(p_hwfn, ep, &mpa_data_size); in qed_iwarp_reject()
1549 return qed_iwarp_mpa_offload(p_hwfn, ep); in qed_iwarp_reject()
1553 qed_iwarp_print_cm_info(struct qed_hwfn *p_hwfn, in qed_iwarp_print_cm_info() argument
1556 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "ip_version = %d\n", in qed_iwarp_print_cm_info()
1560 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_print_cm_info()
1566 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_print_cm_info()
1572 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_print_cm_info()
1578 qed_iwarp_ll2_post_rx(struct qed_hwfn *p_hwfn, in qed_iwarp_ll2_post_rx() argument
1583 rc = qed_ll2_post_rx_buffer(p_hwfn, handle, buf->data_phys_addr, in qed_iwarp_ll2_post_rx()
1586 DP_NOTICE(p_hwfn, in qed_iwarp_ll2_post_rx()
1589 dma_free_coherent(&p_hwfn->cdev->pdev->dev, buf->buff_size, in qed_iwarp_ll2_post_rx()
1598 qed_iwarp_ep_exists(struct qed_hwfn *p_hwfn, struct qed_iwarp_cm_info *cm_info) in qed_iwarp_ep_exists() argument
1604 &p_hwfn->p_rdma_info->iwarp.ep_list, in qed_iwarp_ep_exists()
1619 DP_NOTICE(p_hwfn, in qed_iwarp_ep_exists()
1621 qed_iwarp_print_cm_info(p_hwfn, cm_info); in qed_iwarp_ep_exists()
1630 qed_iwarp_get_listener(struct qed_hwfn *p_hwfn, in qed_iwarp_get_listener() argument
1638 &p_hwfn->p_rdma_info->iwarp.listen_list, in qed_iwarp_get_listener()
1658 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "listener found = %p\n", in qed_iwarp_get_listener()
1663 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "listener not found\n"); in qed_iwarp_get_listener()
1668 qed_iwarp_parse_rx_pkt(struct qed_hwfn *p_hwfn, in qed_iwarp_parse_rx_pkt() argument
1698 p_hwfn->p_rdma_info->iwarp.mac_addr)) { in qed_iwarp_parse_rx_pkt()
1699 DP_VERBOSE(p_hwfn, in qed_iwarp_parse_rx_pkt()
1702 ethh->h_dest, p_hwfn->p_rdma_info->iwarp.mac_addr); in qed_iwarp_parse_rx_pkt()
1709 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "eth_type =%d source mac: %pM\n", in qed_iwarp_parse_rx_pkt()
1712 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "eth_hlen=%d destination mac: %pM\n", in qed_iwarp_parse_rx_pkt()
1719 DP_NOTICE(p_hwfn, in qed_iwarp_parse_rx_pkt()
1735 DP_NOTICE(p_hwfn, in qed_iwarp_parse_rx_pkt()
1752 DP_NOTICE(p_hwfn, "Unexpected ethertype on ll2 %x\n", eth_type); in qed_iwarp_parse_rx_pkt()
1759 DP_NOTICE(p_hwfn, in qed_iwarp_parse_rx_pkt()
1768 qed_iwarp_print_cm_info(p_hwfn, cm_info); in qed_iwarp_parse_rx_pkt()
1775 static struct qed_iwarp_fpdu *qed_iwarp_get_curr_fpdu(struct qed_hwfn *p_hwfn, in qed_iwarp_get_curr_fpdu() argument
1778 struct qed_iwarp_info *iwarp_info = &p_hwfn->p_rdma_info->iwarp; in qed_iwarp_get_curr_fpdu()
1782 idx = cid - qed_cxt_get_proto_cid_start(p_hwfn, PROTOCOLID_IWARP); in qed_iwarp_get_curr_fpdu()
1784 DP_ERR(p_hwfn, "Invalid cid %x max_num_partial_fpdus=%x\n", cid, in qed_iwarp_get_curr_fpdu()
1821 qed_iwarp_recycle_pkt(struct qed_hwfn *p_hwfn,
1826 qed_iwarp_mpa_classify(struct qed_hwfn *p_hwfn, in qed_iwarp_mpa_classify() argument
1856 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_mpa_classify()
1888 qed_iwarp_cp_pkt(struct qed_hwfn *p_hwfn, in qed_iwarp_cp_pkt() argument
1894 u8 *tmp_buf = p_hwfn->p_rdma_info->iwarp.mpa_intermediate_buf; in qed_iwarp_cp_pkt()
1904 DP_ERR(p_hwfn, in qed_iwarp_cp_pkt()
1911 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_cp_pkt()
1920 rc = qed_iwarp_recycle_pkt(p_hwfn, fpdu, fpdu->mpa_buf); in qed_iwarp_cp_pkt()
1939 DP_VERBOSE(p_hwfn, in qed_iwarp_cp_pkt()
1949 qed_iwarp_update_fpdu_length(struct qed_hwfn *p_hwfn, in qed_iwarp_update_fpdu_length() argument
1962 DP_VERBOSE(p_hwfn, in qed_iwarp_update_fpdu_length()
1984 qed_iwarp_recycle_pkt(struct qed_hwfn *p_hwfn, in qed_iwarp_recycle_pkt() argument
2001 ll2_handle = p_hwfn->p_rdma_info->iwarp.ll2_mpa_handle; in qed_iwarp_recycle_pkt()
2003 rc = qed_ll2_prepare_tx_packet(p_hwfn, ll2_handle, &tx_pkt, true); in qed_iwarp_recycle_pkt()
2005 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_recycle_pkt()
2008 DP_VERBOSE(p_hwfn, in qed_iwarp_recycle_pkt()
2018 qed_iwarp_win_right_edge(struct qed_hwfn *p_hwfn, struct qed_iwarp_fpdu *fpdu) in qed_iwarp_win_right_edge() argument
2037 ll2_handle = p_hwfn->p_rdma_info->iwarp.ll2_mpa_handle; in qed_iwarp_win_right_edge()
2039 rc = qed_ll2_prepare_tx_packet(p_hwfn, ll2_handle, &tx_pkt, true); in qed_iwarp_win_right_edge()
2041 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_win_right_edge()
2043 DP_VERBOSE(p_hwfn, in qed_iwarp_win_right_edge()
2054 qed_iwarp_send_fpdu(struct qed_hwfn *p_hwfn, in qed_iwarp_send_fpdu() argument
2096 ll2_handle = p_hwfn->p_rdma_info->iwarp.ll2_mpa_handle; in qed_iwarp_send_fpdu()
2099 rc = qed_ll2_prepare_tx_packet(p_hwfn, ll2_handle, &tx_pkt, true); in qed_iwarp_send_fpdu()
2104 rc = qed_ll2_set_fragment_of_tx_packet(p_hwfn, ll2_handle, in qed_iwarp_send_fpdu()
2116 rc = qed_ll2_set_fragment_of_tx_packet(p_hwfn, in qed_iwarp_send_fpdu()
2122 DP_VERBOSE(p_hwfn, in qed_iwarp_send_fpdu()
2134 qed_iwarp_mpa_get_data(struct qed_hwfn *p_hwfn, in qed_iwarp_mpa_get_data() argument
2153 qed_iwarp_process_mpa_pkt(struct qed_hwfn *p_hwfn, in qed_iwarp_process_mpa_pkt() argument
2166 fpdu = qed_iwarp_get_curr_fpdu(p_hwfn, (u16)cid); in qed_iwarp_process_mpa_pkt()
2168 DP_ERR(p_hwfn, "Invalid cid, drop and post back to rx cid=%x\n", in qed_iwarp_process_mpa_pkt()
2177 pkt_type = qed_iwarp_mpa_classify(p_hwfn, fpdu, in qed_iwarp_process_mpa_pkt()
2193 rc = qed_iwarp_win_right_edge(p_hwfn, fpdu); in qed_iwarp_process_mpa_pkt()
2196 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_process_mpa_pkt()
2210 rc = qed_iwarp_send_fpdu(p_hwfn, fpdu, curr_pkt, buf, in qed_iwarp_process_mpa_pkt()
2214 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_process_mpa_pkt()
2225 qed_iwarp_update_fpdu_length(p_hwfn, fpdu, mpa_data); in qed_iwarp_process_mpa_pkt()
2231 rc = qed_iwarp_win_right_edge(p_hwfn, in qed_iwarp_process_mpa_pkt()
2238 rc = qed_iwarp_cp_pkt(p_hwfn, fpdu, curr_pkt, in qed_iwarp_process_mpa_pkt()
2248 rc = qed_iwarp_send_fpdu(p_hwfn, fpdu, curr_pkt, buf, in qed_iwarp_process_mpa_pkt()
2252 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_process_mpa_pkt()
2273 qed_iwarp_ll2_post_rx(p_hwfn, in qed_iwarp_process_mpa_pkt()
2275 p_hwfn->p_rdma_info->iwarp.ll2_mpa_handle); in qed_iwarp_process_mpa_pkt()
2279 static void qed_iwarp_process_pending_pkts(struct qed_hwfn *p_hwfn) in qed_iwarp_process_pending_pkts() argument
2281 struct qed_iwarp_info *iwarp_info = &p_hwfn->p_rdma_info->iwarp; in qed_iwarp_process_pending_pkts()
2290 rc = qed_iwarp_process_mpa_pkt(p_hwfn, mpa_buf); in qed_iwarp_process_pending_pkts()
2302 DP_NOTICE(p_hwfn, "process pkts failed rc=%d\n", rc); in qed_iwarp_process_pending_pkts()
2313 struct qed_hwfn *p_hwfn = cxt; in qed_iwarp_ll2_comp_mpa_pkt() local
2316 iwarp_info = &p_hwfn->p_rdma_info->iwarp; in qed_iwarp_ll2_comp_mpa_pkt()
2320 DP_ERR(p_hwfn, "No free mpa buf\n"); in qed_iwarp_ll2_comp_mpa_pkt()
2325 qed_iwarp_mpa_get_data(p_hwfn, &mpa_buf->data, in qed_iwarp_ll2_comp_mpa_pkt()
2330 DP_VERBOSE(p_hwfn, in qed_iwarp_ll2_comp_mpa_pkt()
2347 qed_iwarp_process_pending_pkts(p_hwfn); in qed_iwarp_ll2_comp_mpa_pkt()
2350 qed_iwarp_ll2_post_rx(p_hwfn, data->cookie, in qed_iwarp_ll2_comp_mpa_pkt()
2361 struct qed_hwfn *p_hwfn = cxt; in qed_iwarp_ll2_comp_syn_pkt() local
2372 ll2_syn_handle = p_hwfn->p_rdma_info->iwarp.ll2_syn_handle; in qed_iwarp_ll2_comp_syn_pkt()
2376 DP_NOTICE(p_hwfn, "Error received on SYN packet: 0x%x\n", in qed_iwarp_ll2_comp_syn_pkt()
2384 DP_NOTICE(p_hwfn, "Syn packet received with checksum error\n"); in qed_iwarp_ll2_comp_syn_pkt()
2388 rc = qed_iwarp_parse_rx_pkt(p_hwfn, &cm_info, (u8 *)(buf->data) + in qed_iwarp_ll2_comp_syn_pkt()
2396 listener = qed_iwarp_get_listener(p_hwfn, &cm_info); in qed_iwarp_ll2_comp_syn_pkt()
2398 DP_VERBOSE(p_hwfn, in qed_iwarp_ll2_comp_syn_pkt()
2412 rc = qed_ll2_prepare_tx_packet(p_hwfn, ll2_syn_handle, in qed_iwarp_ll2_comp_syn_pkt()
2416 DP_NOTICE(p_hwfn, in qed_iwarp_ll2_comp_syn_pkt()
2423 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "Received syn on listening port\n"); in qed_iwarp_ll2_comp_syn_pkt()
2427 if (qed_iwarp_ep_exists(p_hwfn, &cm_info)) in qed_iwarp_ll2_comp_syn_pkt()
2430 ep = qed_iwarp_get_free_ep(p_hwfn); in qed_iwarp_ll2_comp_syn_pkt()
2434 spin_lock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_ll2_comp_syn_pkt()
2435 list_add_tail(&ep->list_entry, &p_hwfn->p_rdma_info->iwarp.ep_list); in qed_iwarp_ll2_comp_syn_pkt()
2436 spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_ll2_comp_syn_pkt()
2444 ep->mss = p_hwfn->p_rdma_info->iwarp.max_mtu - hdr_size; in qed_iwarp_ll2_comp_syn_pkt()
2456 rc = qed_iwarp_tcp_offload(p_hwfn, ep); in qed_iwarp_ll2_comp_syn_pkt()
2458 qed_iwarp_return_ep(p_hwfn, ep); in qed_iwarp_ll2_comp_syn_pkt()
2464 qed_iwarp_ll2_post_rx(p_hwfn, buf, ll2_syn_handle); in qed_iwarp_ll2_comp_syn_pkt()
2472 struct qed_hwfn *p_hwfn = cxt; in qed_iwarp_ll2_rel_rx_pkt() local
2474 dma_free_coherent(&p_hwfn->cdev->pdev->dev, buffer->buff_size, in qed_iwarp_ll2_rel_rx_pkt()
2485 struct qed_hwfn *p_hwfn = cxt; in qed_iwarp_ll2_comp_tx_pkt() local
2494 qed_iwarp_ll2_post_rx(p_hwfn, piggy, connection_handle); in qed_iwarp_ll2_comp_tx_pkt()
2497 qed_iwarp_ll2_post_rx(p_hwfn, buffer, connection_handle); in qed_iwarp_ll2_comp_tx_pkt()
2499 if (connection_handle == p_hwfn->p_rdma_info->iwarp.ll2_mpa_handle) in qed_iwarp_ll2_comp_tx_pkt()
2500 qed_iwarp_process_pending_pkts(p_hwfn); in qed_iwarp_ll2_comp_tx_pkt()
2510 struct qed_hwfn *p_hwfn = cxt; in qed_iwarp_ll2_rel_tx_pkt() local
2516 dma_free_coherent(&p_hwfn->cdev->pdev->dev, in qed_iwarp_ll2_rel_tx_pkt()
2524 dma_free_coherent(&p_hwfn->cdev->pdev->dev, buffer->buff_size, in qed_iwarp_ll2_rel_tx_pkt()
2539 struct qed_hwfn *p_hwfn = cxt; in qed_iwarp_ll2_slowpath() local
2543 qed_iwarp_mpa_get_data(p_hwfn, &unalign_data, in qed_iwarp_ll2_slowpath()
2548 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "(0x%x) Flush fpdu\n", cid); in qed_iwarp_ll2_slowpath()
2550 fpdu = qed_iwarp_get_curr_fpdu(p_hwfn, (u16)cid); in qed_iwarp_ll2_slowpath()
2555 static int qed_iwarp_ll2_stop(struct qed_hwfn *p_hwfn) in qed_iwarp_ll2_stop() argument
2557 struct qed_iwarp_info *iwarp_info = &p_hwfn->p_rdma_info->iwarp; in qed_iwarp_ll2_stop()
2561 rc = qed_ll2_terminate_connection(p_hwfn, in qed_iwarp_ll2_stop()
2564 DP_INFO(p_hwfn, "Failed to terminate syn connection\n"); in qed_iwarp_ll2_stop()
2566 qed_ll2_release_connection(p_hwfn, iwarp_info->ll2_syn_handle); in qed_iwarp_ll2_stop()
2571 rc = qed_ll2_terminate_connection(p_hwfn, in qed_iwarp_ll2_stop()
2574 DP_INFO(p_hwfn, "Failed to terminate ooo connection\n"); in qed_iwarp_ll2_stop()
2576 qed_ll2_release_connection(p_hwfn, iwarp_info->ll2_ooo_handle); in qed_iwarp_ll2_stop()
2581 rc = qed_ll2_terminate_connection(p_hwfn, in qed_iwarp_ll2_stop()
2584 DP_INFO(p_hwfn, "Failed to terminate mpa connection\n"); in qed_iwarp_ll2_stop()
2586 qed_ll2_release_connection(p_hwfn, iwarp_info->ll2_mpa_handle); in qed_iwarp_ll2_stop()
2590 qed_llh_remove_mac_filter(p_hwfn->cdev, 0, in qed_iwarp_ll2_stop()
2591 p_hwfn->p_rdma_info->iwarp.mac_addr); in qed_iwarp_ll2_stop()
2597 qed_iwarp_ll2_alloc_buffers(struct qed_hwfn *p_hwfn, in qed_iwarp_ll2_alloc_buffers() argument
2611 buffer->data = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, in qed_iwarp_ll2_alloc_buffers()
2622 rc = qed_iwarp_ll2_post_rx(p_hwfn, buffer, ll2_handle); in qed_iwarp_ll2_alloc_buffers()
2635 qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn, in qed_iwarp_ll2_start() argument
2647 iwarp_info = &p_hwfn->p_rdma_info->iwarp; in qed_iwarp_ll2_start()
2654 ether_addr_copy(p_hwfn->p_rdma_info->iwarp.mac_addr, params->mac_addr); in qed_iwarp_ll2_start()
2656 rc = qed_llh_add_mac_filter(p_hwfn->cdev, 0, params->mac_addr); in qed_iwarp_ll2_start()
2666 cbs.cookie = p_hwfn; in qed_iwarp_ll2_start()
2681 rc = qed_ll2_acquire_connection(p_hwfn, &data); in qed_iwarp_ll2_start()
2683 DP_NOTICE(p_hwfn, "Failed to acquire LL2 connection\n"); in qed_iwarp_ll2_start()
2684 qed_llh_remove_mac_filter(p_hwfn->cdev, 0, params->mac_addr); in qed_iwarp_ll2_start()
2688 rc = qed_ll2_establish_connection(p_hwfn, iwarp_info->ll2_syn_handle); in qed_iwarp_ll2_start()
2690 DP_NOTICE(p_hwfn, "Failed to establish LL2 connection\n"); in qed_iwarp_ll2_start()
2695 rc = qed_iwarp_ll2_alloc_buffers(p_hwfn, in qed_iwarp_ll2_start()
2719 rc = qed_ll2_acquire_connection(p_hwfn, &data); in qed_iwarp_ll2_start()
2723 rc = qed_ll2_establish_connection(p_hwfn, iwarp_info->ll2_ooo_handle); in qed_iwarp_ll2_start()
2747 rc = qed_ll2_acquire_connection(p_hwfn, &data); in qed_iwarp_ll2_start()
2751 rc = qed_ll2_establish_connection(p_hwfn, iwarp_info->ll2_mpa_handle); in qed_iwarp_ll2_start()
2755 rc = qed_iwarp_ll2_alloc_buffers(p_hwfn, in qed_iwarp_ll2_start()
2762 iwarp_info->partial_fpdus = kcalloc((u16)p_hwfn->p_rdma_info->num_qps, in qed_iwarp_ll2_start()
2770 iwarp_info->max_num_partial_fpdus = (u16)p_hwfn->p_rdma_info->num_qps; in qed_iwarp_ll2_start()
2798 qed_iwarp_ll2_stop(p_hwfn); in qed_iwarp_ll2_start()
2811 int qed_iwarp_setup(struct qed_hwfn *p_hwfn, in qed_iwarp_setup() argument
2814 struct qed_dev *cdev = p_hwfn->cdev; in qed_iwarp_setup()
2819 iwarp_info = &p_hwfn->p_rdma_info->iwarp; in qed_iwarp_setup()
2841 spin_lock_init(&p_hwfn->p_rdma_info->iwarp.qp_lock); in qed_iwarp_setup()
2842 INIT_LIST_HEAD(&p_hwfn->p_rdma_info->iwarp.ep_list); in qed_iwarp_setup()
2843 INIT_LIST_HEAD(&p_hwfn->p_rdma_info->iwarp.listen_list); in qed_iwarp_setup()
2845 qed_spq_register_async_cb(p_hwfn, PROTOCOLID_IWARP, in qed_iwarp_setup()
2847 qed_ooo_setup(p_hwfn); in qed_iwarp_setup()
2849 return qed_iwarp_ll2_start(p_hwfn, params, rcv_wnd_size); in qed_iwarp_setup()
2852 int qed_iwarp_stop(struct qed_hwfn *p_hwfn) in qed_iwarp_stop() argument
2856 qed_iwarp_free_prealloc_ep(p_hwfn); in qed_iwarp_stop()
2857 rc = qed_iwarp_wait_for_all_cids(p_hwfn); in qed_iwarp_stop()
2861 return qed_iwarp_ll2_stop(p_hwfn); in qed_iwarp_stop()
2864 static void qed_iwarp_qp_in_error(struct qed_hwfn *p_hwfn, in qed_iwarp_qp_in_error() argument
2870 qed_iwarp_modify_qp(p_hwfn, ep->qp, QED_IWARP_QP_STATE_ERROR, true); in qed_iwarp_qp_in_error()
2881 spin_lock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_qp_in_error()
2883 spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_qp_in_error()
2888 static void qed_iwarp_exception_received(struct qed_hwfn *p_hwfn, in qed_iwarp_exception_received() argument
2895 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "EP(0x%x) fw_ret_code=%d\n", in qed_iwarp_exception_received()
2946 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_exception_received()
2960 qed_iwarp_tcp_connect_unsuccessful(struct qed_hwfn *p_hwfn, in qed_iwarp_tcp_connect_unsuccessful() argument
2974 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_tcp_connect_unsuccessful()
2980 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_tcp_connect_unsuccessful()
2986 DP_NOTICE(p_hwfn, "%s(0x%x) TCP timeout\n", in qed_iwarp_tcp_connect_unsuccessful()
2991 DP_NOTICE(p_hwfn, "%s(0x%x) MPA not supported VER\n", in qed_iwarp_tcp_connect_unsuccessful()
2996 DP_NOTICE(p_hwfn, "%s(0x%x) MPA Invalid Packet\n", in qed_iwarp_tcp_connect_unsuccessful()
3001 DP_ERR(p_hwfn, in qed_iwarp_tcp_connect_unsuccessful()
3011 qed_iwarp_return_ep(p_hwfn, ep); in qed_iwarp_tcp_connect_unsuccessful()
3014 spin_lock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_tcp_connect_unsuccessful()
3016 spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_tcp_connect_unsuccessful()
3021 qed_iwarp_connect_complete(struct qed_hwfn *p_hwfn, in qed_iwarp_connect_complete() argument
3024 u8 ll2_syn_handle = p_hwfn->p_rdma_info->iwarp.ll2_syn_handle; in qed_iwarp_connect_complete()
3028 qed_iwarp_ll2_post_rx(p_hwfn, ep->syn, ll2_syn_handle); in qed_iwarp_connect_complete()
3034 qed_iwarp_mpa_received(p_hwfn, ep); in qed_iwarp_connect_complete()
3036 qed_iwarp_tcp_connect_unsuccessful(p_hwfn, ep, in qed_iwarp_connect_complete()
3040 qed_iwarp_mpa_offload(p_hwfn, ep); in qed_iwarp_connect_complete()
3042 qed_iwarp_tcp_connect_unsuccessful(p_hwfn, ep, in qed_iwarp_connect_complete()
3048 qed_iwarp_check_ep_ok(struct qed_hwfn *p_hwfn, struct qed_iwarp_ep *ep) in qed_iwarp_check_ep_ok() argument
3051 DP_ERR(p_hwfn, "ERROR ON ASYNC ep=%p\n", ep); in qed_iwarp_check_ep_ok()
3058 static int qed_iwarp_async_event(struct qed_hwfn *p_hwfn, u8 fw_event_code, in qed_iwarp_async_event() argument
3062 struct qed_rdma_events events = p_hwfn->p_rdma_info->events; in qed_iwarp_async_event()
3075 if (!qed_iwarp_check_ep_ok(p_hwfn, ep)) in qed_iwarp_async_event()
3077 DP_VERBOSE(p_hwfn, in qed_iwarp_async_event()
3081 qed_iwarp_connect_complete(p_hwfn, ep, fw_return_code); in qed_iwarp_async_event()
3084 if (!qed_iwarp_check_ep_ok(p_hwfn, ep)) in qed_iwarp_async_event()
3086 DP_VERBOSE(p_hwfn, in qed_iwarp_async_event()
3090 qed_iwarp_exception_received(p_hwfn, ep, fw_return_code); in qed_iwarp_async_event()
3094 if (!qed_iwarp_check_ep_ok(p_hwfn, ep)) in qed_iwarp_async_event()
3096 DP_VERBOSE(p_hwfn, in qed_iwarp_async_event()
3100 qed_iwarp_qp_in_error(p_hwfn, ep, fw_return_code); in qed_iwarp_async_event()
3104 if (!qed_iwarp_check_ep_ok(p_hwfn, ep)) in qed_iwarp_async_event()
3106 DP_VERBOSE(p_hwfn, in qed_iwarp_async_event()
3110 qed_iwarp_mpa_reply_arrived(p_hwfn, ep); in qed_iwarp_async_event()
3113 if (!qed_iwarp_check_ep_ok(p_hwfn, ep)) in qed_iwarp_async_event()
3115 DP_VERBOSE(p_hwfn, in qed_iwarp_async_event()
3119 qed_iwarp_mpa_complete(p_hwfn, ep, fw_return_code); in qed_iwarp_async_event()
3123 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, in qed_iwarp_async_event()
3125 qed_iwarp_cid_cleaned(p_hwfn, cid); in qed_iwarp_async_event()
3129 DP_NOTICE(p_hwfn, "IWARP_EVENT_TYPE_ASYNC_SRQ_EMPTY\n"); in qed_iwarp_async_event()
3130 srq_offset = p_hwfn->p_rdma_info->srq_id_offset; in qed_iwarp_async_event()
3138 DP_NOTICE(p_hwfn, "IWARP_EVENT_TYPE_ASYNC_SRQ_LIMIT\n"); in qed_iwarp_async_event()
3139 srq_offset = p_hwfn->p_rdma_info->srq_id_offset; in qed_iwarp_async_event()
3147 DP_NOTICE(p_hwfn, "IWARP_EVENT_TYPE_ASYNC_CQ_OVERFLOW\n"); in qed_iwarp_async_event()
3149 p_hwfn->p_rdma_info->events.affiliated_event( in qed_iwarp_async_event()
3150 p_hwfn->p_rdma_info->events.context, in qed_iwarp_async_event()
3155 DP_ERR(p_hwfn, "Received unexpected async iwarp event %d\n", in qed_iwarp_async_event()
3167 struct qed_hwfn *p_hwfn = rdma_cxt; in qed_iwarp_create_listen() local
3184 spin_lock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_create_listen()
3186 &p_hwfn->p_rdma_info->iwarp.listen_list); in qed_iwarp_create_listen()
3187 spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_create_listen()
3189 DP_VERBOSE(p_hwfn, in qed_iwarp_create_listen()
3205 struct qed_hwfn *p_hwfn = rdma_cxt; in qed_iwarp_destroy_listen() local
3207 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "handle=%p\n", handle); in qed_iwarp_destroy_listen()
3209 spin_lock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_destroy_listen()
3211 spin_unlock_bh(&p_hwfn->p_rdma_info->iwarp.iw_lock); in qed_iwarp_destroy_listen()
3220 struct qed_hwfn *p_hwfn = rdma_cxt; in qed_iwarp_send_rtr() local
3229 DP_ERR(p_hwfn, "Ep Context receive in send_rtr is NULL\n"); in qed_iwarp_send_rtr()
3235 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "QP(0x%x) EP(0x%x)\n", in qed_iwarp_send_rtr()
3240 init_data.opaque_fid = p_hwfn->hw_info.opaque_fid; in qed_iwarp_send_rtr()
3243 rc = qed_sp_init_request(p_hwfn, &p_ent, in qed_iwarp_send_rtr()
3250 rc = qed_spq_post(p_hwfn, p_ent, NULL); in qed_iwarp_send_rtr()
3252 DP_VERBOSE(p_hwfn, QED_MSG_RDMA, "rc = 0x%x\n", rc); in qed_iwarp_send_rtr()