Lines Matching full:ep

91  * syn processing and replacing a pre-allocated ep in the list. The second
488 struct qed_iwarp_ep *ep, in qed_iwarp_destroy_ep() argument
492 sizeof(*ep->ep_buffer_virt), in qed_iwarp_destroy_ep()
493 ep->ep_buffer_virt, ep->ep_buffer_phys); in qed_iwarp_destroy_ep()
497 list_del(&ep->list_entry); in qed_iwarp_destroy_ep()
501 if (ep->qp) in qed_iwarp_destroy_ep()
502 ep->qp->ep = NULL; in qed_iwarp_destroy_ep()
504 kfree(ep); in qed_iwarp_destroy_ep()
509 struct qed_iwarp_ep *ep = qp->ep; in qed_iwarp_destroy_qp() local
520 /* Make sure ep is closed before returning and freeing memory. */ in qed_iwarp_destroy_qp()
521 if (ep) { in qed_iwarp_destroy_qp()
522 while (READ_ONCE(ep->state) != QED_IWARP_EP_CLOSED && in qed_iwarp_destroy_qp()
526 if (ep->state != QED_IWARP_EP_CLOSED) in qed_iwarp_destroy_qp()
527 DP_NOTICE(p_hwfn, "ep state close timeout state=%x\n", in qed_iwarp_destroy_qp()
528 ep->state); in qed_iwarp_destroy_qp()
530 qed_iwarp_destroy_ep(p_hwfn, ep, false); in qed_iwarp_destroy_qp()
546 struct qed_iwarp_ep *ep; in qed_iwarp_create_ep() local
549 ep = kzalloc(sizeof(*ep), GFP_KERNEL); in qed_iwarp_create_ep()
550 if (!ep) in qed_iwarp_create_ep()
553 ep->state = QED_IWARP_EP_INIT; in qed_iwarp_create_ep()
555 ep->ep_buffer_virt = dma_alloc_coherent(&p_hwfn->cdev->pdev->dev, in qed_iwarp_create_ep()
556 sizeof(*ep->ep_buffer_virt), in qed_iwarp_create_ep()
557 &ep->ep_buffer_phys, in qed_iwarp_create_ep()
559 if (!ep->ep_buffer_virt) { in qed_iwarp_create_ep()
564 ep->sig = QED_EP_SIG; in qed_iwarp_create_ep()
566 *ep_out = ep; in qed_iwarp_create_ep()
571 kfree(ep); in qed_iwarp_create_ep()
622 qed_iwarp_tcp_offload(struct qed_hwfn *p_hwfn, struct qed_iwarp_ep *ep) in qed_iwarp_tcp_offload() argument
638 init_data.cid = ep->tcp_cid; in qed_iwarp_tcp_offload()
640 if (ep->connect_mode == TCP_CONNECT_PASSIVE) in qed_iwarp_tcp_offload()
653 in_pdata_phys = ep->ep_buffer_phys + in qed_iwarp_tcp_offload()
659 cpu_to_le16(sizeof(ep->ep_buffer_virt->in_pdata)); in qed_iwarp_tcp_offload()
661 async_output_phys = ep->ep_buffer_phys + in qed_iwarp_tcp_offload()
666 p_tcp_ramrod->iwarp.handle_for_async.hi = cpu_to_le32(PTR_HI(ep)); in qed_iwarp_tcp_offload()
667 p_tcp_ramrod->iwarp.handle_for_async.lo = cpu_to_le32(PTR_LO(ep)); in qed_iwarp_tcp_offload()
678 &tcp->remote_mac_addr_lo, ep->remote_mac_addr); in qed_iwarp_tcp_offload()
680 &tcp->local_mac_addr_lo, ep->local_mac_addr); in qed_iwarp_tcp_offload()
682 tcp->vlan_id = cpu_to_le16(ep->cm_info.vlan); in qed_iwarp_tcp_offload()
693 tcp->ip_version = ep->cm_info.ip_version; in qed_iwarp_tcp_offload()
696 tcp->remote_ip[i] = cpu_to_le32(ep->cm_info.remote_ip[i]); in qed_iwarp_tcp_offload()
697 tcp->local_ip[i] = cpu_to_le32(ep->cm_info.local_ip[i]); in qed_iwarp_tcp_offload()
700 tcp->remote_port = cpu_to_le16(ep->cm_info.remote_port); in qed_iwarp_tcp_offload()
701 tcp->local_port = cpu_to_le16(ep->cm_info.local_port); in qed_iwarp_tcp_offload()
702 tcp->mss = cpu_to_le16(ep->mss); in qed_iwarp_tcp_offload()
708 tcp->cwnd = cpu_to_le32(QED_IWARP_DEF_CWND_FACTOR * ep->mss); in qed_iwarp_tcp_offload()
714 tcp->connect_mode = ep->connect_mode; in qed_iwarp_tcp_offload()
716 if (ep->connect_mode == TCP_CONNECT_PASSIVE) { in qed_iwarp_tcp_offload()
718 cpu_to_le16(ep->syn_ip_payload_length); in qed_iwarp_tcp_offload()
719 tcp->syn_phy_addr_hi = DMA_HI_LE(ep->syn_phy_addr); in qed_iwarp_tcp_offload()
720 tcp->syn_phy_addr_lo = DMA_LO_LE(ep->syn_phy_addr); in qed_iwarp_tcp_offload()
728 "EP(0x%x) Offload completed rc=%d\n", ep->tcp_cid, rc); 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
745 async_data = &ep->ep_buffer_virt->async_output; in qed_iwarp_mpa_received()
751 mpa_rev, *((u32 *)(ep->ep_buffer_virt->in_pdata))); in qed_iwarp_mpa_received()
755 mpa_v2 = (struct mpa_v2_hdr *)ep->ep_buffer_virt->in_pdata; in qed_iwarp_mpa_received()
764 ep->cm_info.ord = (u8)min_t(u16, in qed_iwarp_mpa_received()
768 ep->cm_info.ird = (u8)min_t(u16, in qed_iwarp_mpa_received()
773 ep->rtr_type = MPA_RTR_TYPE_NONE; in qed_iwarp_mpa_received()
776 ep->rtr_type |= MPA_RTR_TYPE_ZERO_WRITE; in qed_iwarp_mpa_received()
779 ep->rtr_type |= MPA_RTR_TYPE_ZERO_READ; in qed_iwarp_mpa_received()
782 ep->rtr_type |= MPA_RTR_TYPE_ZERO_SEND; in qed_iwarp_mpa_received()
784 ep->rtr_type &= iwarp_info->rtr_type; in qed_iwarp_mpa_received()
787 if (ep->rtr_type == MPA_RTR_TYPE_NONE) in qed_iwarp_mpa_received()
788 ep->rtr_type = iwarp_info->rtr_type; in qed_iwarp_mpa_received()
791 ep->mpa_rev = MPA_NEGOTIATION_TYPE_ENHANCED; in qed_iwarp_mpa_received()
793 ep->cm_info.ord = QED_IWARP_ORD_DEFAULT; in qed_iwarp_mpa_received()
794 ep->cm_info.ird = QED_IWARP_IRD_DEFAULT; in qed_iwarp_mpa_received()
795 ep->mpa_rev = MPA_NEGOTIATION_TYPE_BASIC; in qed_iwarp_mpa_received()
800 mpa_rev, ep->cm_info.ord, ep->cm_info.ird, ep->rtr_type, in qed_iwarp_mpa_received()
804 ep->cm_info.private_data = ep->ep_buffer_virt->in_pdata + mpa_hdr_size; in qed_iwarp_mpa_received()
807 ep->cm_info.private_data_len = ulp_data_len - mpa_hdr_size; in qed_iwarp_mpa_received()
810 params.cm_info = &ep->cm_info; in qed_iwarp_mpa_received()
811 params.ep_context = ep; in qed_iwarp_mpa_received()
814 ep->state = QED_IWARP_EP_MPA_REQ_RCVD; in qed_iwarp_mpa_received()
815 ep->event_cb(ep->cb_context, &params); 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
834 if (!ep) in qed_iwarp_mpa_offload()
837 qp = ep->qp; in qed_iwarp_mpa_offload()
841 init_data.cid = reject ? ep->tcp_cid : qp->icid; in qed_iwarp_mpa_offload()
844 if (ep->connect_mode == TCP_CONNECT_ACTIVE) in qed_iwarp_mpa_offload()
858 out_pdata_phys = ep->ep_buffer_phys + in qed_iwarp_mpa_offload()
862 val = ep->cm_info.private_data_len; in qed_iwarp_mpa_offload()
866 common->out_rq.ord = cpu_to_le32(ep->cm_info.ord); in qed_iwarp_mpa_offload()
867 common->out_rq.ird = cpu_to_le32(ep->cm_info.ird); in qed_iwarp_mpa_offload()
869 val = p_hwfn->hw_info.opaque_fid << 16 | ep->tcp_cid; in qed_iwarp_mpa_offload()
872 in_pdata_phys = ep->ep_buffer_phys + in qed_iwarp_mpa_offload()
874 p_mpa_ramrod->tcp_connect_side = ep->connect_mode; in qed_iwarp_mpa_offload()
878 cpu_to_le16(sizeof(ep->ep_buffer_virt->in_pdata)); in qed_iwarp_mpa_offload()
879 async_output_phys = ep->ep_buffer_phys + in qed_iwarp_mpa_offload()
883 p_mpa_ramrod->handle_for_async.hi = cpu_to_le32(PTR_HI(ep)); in qed_iwarp_mpa_offload()
884 p_mpa_ramrod->handle_for_async.lo = cpu_to_le32(PTR_LO(ep)); in qed_iwarp_mpa_offload()
897 p_mpa_ramrod->mode = ep->mpa_rev; in qed_iwarp_mpa_offload()
899 IWARP_MPA_OFFLOAD_RAMROD_DATA_RTR_SUPPORTED, ep->rtr_type); in qed_iwarp_mpa_offload()
901 ep->state = QED_IWARP_EP_MPA_OFFLOADED; in qed_iwarp_mpa_offload()
904 ep->cid = qp->icid; /* Now they're migrated. */ in qed_iwarp_mpa_offload()
908 "QP(0x%x) EP(0x%x) MPA Offload rc = %d IRD=0x%x ORD=0x%x rtr_type=%d mpa_rev=%d reject=%d\n", in qed_iwarp_mpa_offload()
910 ep->tcp_cid, in qed_iwarp_mpa_offload()
912 ep->cm_info.ird, in qed_iwarp_mpa_offload()
913 ep->cm_info.ord, ep->rtr_type, ep->mpa_rev, reject); 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
920 ep->state = QED_IWARP_EP_INIT; in qed_iwarp_return_ep()
921 if (ep->qp) in qed_iwarp_return_ep()
922 ep->qp->ep = NULL; in qed_iwarp_return_ep()
923 ep->qp = NULL; in qed_iwarp_return_ep()
924 memset(&ep->cm_info, 0, sizeof(ep->cm_info)); in qed_iwarp_return_ep()
926 if (ep->tcp_cid == QED_IWARP_INVALID_TCP_CID) { in qed_iwarp_return_ep()
930 qed_iwarp_alloc_tcp_cid(p_hwfn, &ep->tcp_cid); in qed_iwarp_return_ep()
934 list_move_tail(&ep->list_entry, 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
951 (struct mpa_v2_hdr *)(ep->ep_buffer_virt->in_pdata); in qed_iwarp_parse_private_data()
956 ep->cm_info.ird = (u8)(mpa_ord & MPA_V2_IRD_ORD_MASK); in qed_iwarp_parse_private_data()
957 ep->cm_info.ord = (u8)(mpa_ird & MPA_V2_IRD_ORD_MASK); in qed_iwarp_parse_private_data()
960 async_data = &ep->ep_buffer_virt->async_output; in qed_iwarp_parse_private_data()
961 ep->cm_info.private_data = ep->ep_buffer_virt->in_pdata + mpa_data_size; in qed_iwarp_parse_private_data()
964 ep->cm_info.private_data_len = ulp_data_len - mpa_data_size; 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
972 if (ep->connect_mode == TCP_CONNECT_PASSIVE) { in qed_iwarp_mpa_reply_arrived()
980 qed_iwarp_parse_private_data(p_hwfn, ep); in qed_iwarp_mpa_reply_arrived()
984 ep->mpa_rev, ep->cm_info.ord, ep->cm_info.ird); in qed_iwarp_mpa_reply_arrived()
986 params.cm_info = &ep->cm_info; in qed_iwarp_mpa_reply_arrived()
987 params.ep_context = ep; in qed_iwarp_mpa_reply_arrived()
990 ep->mpa_reply_processed = true; in qed_iwarp_mpa_reply_arrived()
992 ep->event_cb(ep->cb_context, &params); in qed_iwarp_mpa_reply_arrived()
995 #define QED_IWARP_CONNECT_MODE_STRING(ep) \ argument
996 ((ep)->connect_mode == TCP_CONNECT_PASSIVE) ? "Passive" : "Active"
1003 struct qed_iwarp_ep *ep, u8 fw_return_code) in qed_iwarp_mpa_complete() argument
1007 if (ep->connect_mode == TCP_CONNECT_ACTIVE) in qed_iwarp_mpa_complete()
1012 if (ep->connect_mode == TCP_CONNECT_ACTIVE && !ep->mpa_reply_processed) in qed_iwarp_mpa_complete()
1013 qed_iwarp_parse_private_data(p_hwfn, ep); in qed_iwarp_mpa_complete()
1017 ep->mpa_rev, ep->cm_info.ord, ep->cm_info.ird); in qed_iwarp_mpa_complete()
1019 params.cm_info = &ep->cm_info; in qed_iwarp_mpa_complete()
1021 params.ep_context = ep; in qed_iwarp_mpa_complete()
1025 ep->qp->max_rd_atomic_req = ep->cm_info.ord; in qed_iwarp_mpa_complete()
1026 ep->qp->max_rd_atomic_resp = ep->cm_info.ird; 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()
1028 ep->state = QED_IWARP_EP_ESTABLISHED; in qed_iwarp_mpa_complete()
1033 QED_IWARP_CONNECT_MODE_STRING(ep), ep->cid); in qed_iwarp_mpa_complete()
1038 QED_IWARP_CONNECT_MODE_STRING(ep), ep->cid); in qed_iwarp_mpa_complete()
1043 QED_IWARP_CONNECT_MODE_STRING(ep), ep->cid, in qed_iwarp_mpa_complete()
1044 ep->tcp_cid); in qed_iwarp_mpa_complete()
1049 QED_IWARP_CONNECT_MODE_STRING(ep), ep->cid); in qed_iwarp_mpa_complete()
1054 QED_IWARP_CONNECT_MODE_STRING(ep), ep->cid); in qed_iwarp_mpa_complete()
1059 QED_IWARP_CONNECT_MODE_STRING(ep), ep->cid); in qed_iwarp_mpa_complete()
1064 QED_IWARP_CONNECT_MODE_STRING(ep), ep->cid); in qed_iwarp_mpa_complete()
1069 QED_IWARP_CONNECT_MODE_STRING(ep), ep->cid); in qed_iwarp_mpa_complete()
1074 QED_IWARP_CONNECT_MODE_STRING(ep), ep->cid); in qed_iwarp_mpa_complete()
1084 smp_store_release(&ep->state, QED_IWARP_EP_CLOSED); in qed_iwarp_mpa_complete()
1086 ep->event_cb(ep->cb_context, &params); in qed_iwarp_mpa_complete()
1089 * return the ep to the pool, (in the regular case we add an element in qed_iwarp_mpa_complete()
1094 ep->tcp_cid = QED_IWARP_INVALID_TCP_CID; in qed_iwarp_mpa_complete()
1095 if ((ep->connect_mode == TCP_CONNECT_PASSIVE) && in qed_iwarp_mpa_complete()
1096 (!ep->qp)) { /* Rejected */ in qed_iwarp_mpa_complete()
1097 qed_iwarp_return_ep(p_hwfn, ep); in qed_iwarp_mpa_complete()
1100 list_del(&ep->list_entry); in qed_iwarp_mpa_complete()
1108 struct qed_iwarp_ep *ep, u8 *mpa_data_size) in qed_iwarp_mpa_v2_set_private() argument
1114 if (MPA_REV2(ep->mpa_rev)) { in qed_iwarp_mpa_v2_set_private()
1116 (struct mpa_v2_hdr *)ep->ep_buffer_virt->out_pdata; in qed_iwarp_mpa_v2_set_private()
1119 mpa_ird = (u16)ep->cm_info.ird; in qed_iwarp_mpa_v2_set_private()
1120 mpa_ord = (u16)ep->cm_info.ord; in qed_iwarp_mpa_v2_set_private()
1122 if (ep->rtr_type != MPA_RTR_TYPE_NONE) { in qed_iwarp_mpa_v2_set_private()
1125 if (ep->rtr_type & MPA_RTR_TYPE_ZERO_SEND) in qed_iwarp_mpa_v2_set_private()
1128 if (ep->rtr_type & MPA_RTR_TYPE_ZERO_WRITE) in qed_iwarp_mpa_v2_set_private()
1131 if (ep->rtr_type & MPA_RTR_TYPE_ZERO_READ) in qed_iwarp_mpa_v2_set_private()
1159 struct qed_iwarp_ep *ep; in qed_iwarp_connect() local
1176 /* Allocate ep object */ in qed_iwarp_connect()
1181 rc = qed_iwarp_create_ep(p_hwfn, &ep); in qed_iwarp_connect()
1185 ep->tcp_cid = cid; in qed_iwarp_connect()
1188 list_add_tail(&ep->list_entry, &p_hwfn->p_rdma_info->iwarp.ep_list); in qed_iwarp_connect()
1191 ep->qp = iparams->qp; in qed_iwarp_connect()
1192 ep->qp->ep = ep; in qed_iwarp_connect()
1193 ether_addr_copy(ep->remote_mac_addr, iparams->remote_mac_addr); in qed_iwarp_connect()
1194 ether_addr_copy(ep->local_mac_addr, iparams->local_mac_addr); in qed_iwarp_connect()
1195 memcpy(&ep->cm_info, &iparams->cm_info, sizeof(ep->cm_info)); in qed_iwarp_connect()
1197 ep->cm_info.ord = iparams->cm_info.ord; in qed_iwarp_connect()
1198 ep->cm_info.ird = iparams->cm_info.ird; in qed_iwarp_connect()
1200 ep->rtr_type = iwarp_info->rtr_type; in qed_iwarp_connect()
1202 ep->rtr_type = MPA_RTR_TYPE_NONE; in qed_iwarp_connect()
1204 if ((ep->rtr_type & MPA_RTR_TYPE_ZERO_READ) && (ep->cm_info.ord == 0)) in qed_iwarp_connect()
1205 ep->cm_info.ord = 1; in qed_iwarp_connect()
1207 ep->mpa_rev = iwarp_info->mpa_rev; in qed_iwarp_connect()
1209 qed_iwarp_mpa_v2_set_private(p_hwfn, ep, &mpa_data_size); in qed_iwarp_connect()
1211 ep->cm_info.private_data = ep->ep_buffer_virt->out_pdata; in qed_iwarp_connect()
1212 ep->cm_info.private_data_len = iparams->cm_info.private_data_len + in qed_iwarp_connect()
1215 memcpy((u8 *)ep->ep_buffer_virt->out_pdata + mpa_data_size, in qed_iwarp_connect()
1219 ep->mss = iparams->mss; in qed_iwarp_connect()
1220 ep->mss = min_t(u16, QED_IWARP_MAX_FW_MSS, ep->mss); in qed_iwarp_connect()
1222 ep->event_cb = iparams->event_cb; in qed_iwarp_connect()
1223 ep->cb_context = iparams->cb_context; in qed_iwarp_connect()
1224 ep->connect_mode = TCP_CONNECT_ACTIVE; in qed_iwarp_connect()
1226 oparams->ep_context = ep; 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()
1231 iparams->qp->icid, ep->tcp_cid, rc); in qed_iwarp_connect()
1234 qed_iwarp_destroy_ep(p_hwfn, ep, true); in qed_iwarp_connect()
1247 struct qed_iwarp_ep *ep = NULL; in qed_iwarp_get_free_ep() local
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()
1263 if (ep->tcp_cid == QED_IWARP_INVALID_TCP_CID) { in qed_iwarp_get_free_ep()
1264 rc = qed_iwarp_alloc_tcp_cid(p_hwfn, &ep->tcp_cid); in qed_iwarp_get_free_ep()
1271 ep->tcp_cid = QED_IWARP_INVALID_TCP_CID; in qed_iwarp_get_free_ep()
1272 ep = NULL; in qed_iwarp_get_free_ep()
1277 list_del(&ep->list_entry); in qed_iwarp_get_free_ep()
1281 return ep; in qed_iwarp_get_free_ep()
1352 struct qed_iwarp_ep *ep; in qed_iwarp_free_prealloc_ep() local
1357 ep = list_first_entry(&p_hwfn->p_rdma_info->iwarp.ep_free_list, in qed_iwarp_free_prealloc_ep()
1360 if (!ep) { in qed_iwarp_free_prealloc_ep()
1364 list_del(&ep->list_entry); in qed_iwarp_free_prealloc_ep()
1368 if (ep->tcp_cid != QED_IWARP_INVALID_TCP_CID) 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()
1377 struct qed_iwarp_ep *ep; in qed_iwarp_prealloc_ep() local
1385 rc = qed_iwarp_create_ep(p_hwfn, &ep); in qed_iwarp_prealloc_ep()
1405 ep->tcp_cid = cid; in qed_iwarp_prealloc_ep()
1408 list_add_tail(&ep->list_entry, in qed_iwarp_prealloc_ep()
1416 qed_iwarp_destroy_ep(p_hwfn, ep, false); in qed_iwarp_prealloc_ep()
1461 struct qed_iwarp_ep *ep; in qed_iwarp_accept() local
1465 ep = iparams->ep_context; in qed_iwarp_accept()
1466 if (!ep) { in qed_iwarp_accept()
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()
1472 iparams->qp->icid, ep->tcp_cid); in qed_iwarp_accept()
1478 "QP(0x%x) EP(0x%x) ERROR: Invalid ord(0x%x)/ird(0x%x)\n", in qed_iwarp_accept()
1480 ep->tcp_cid, iparams->ord, iparams->ord); in qed_iwarp_accept()
1486 ep->cb_context = iparams->cb_context; in qed_iwarp_accept()
1487 ep->qp = iparams->qp; in qed_iwarp_accept()
1488 ep->qp->ep = ep; in qed_iwarp_accept()
1490 if (ep->mpa_rev == MPA_NEGOTIATION_TYPE_ENHANCED) { in qed_iwarp_accept()
1494 if (iparams->ord > ep->cm_info.ird) in qed_iwarp_accept()
1495 iparams->ord = ep->cm_info.ird; in qed_iwarp_accept()
1497 if ((ep->rtr_type & MPA_RTR_TYPE_ZERO_READ) && in qed_iwarp_accept()
1503 ep->cm_info.ord = iparams->ord; in qed_iwarp_accept()
1504 ep->cm_info.ird = iparams->ird; in qed_iwarp_accept()
1506 qed_iwarp_mpa_v2_set_private(p_hwfn, ep, &mpa_data_size); in qed_iwarp_accept()
1508 ep->cm_info.private_data = ep->ep_buffer_virt->out_pdata; in qed_iwarp_accept()
1509 ep->cm_info.private_data_len = iparams->private_data_len + in qed_iwarp_accept()
1512 memcpy((u8 *)ep->ep_buffer_virt->out_pdata + mpa_data_size, in qed_iwarp_accept()
1515 rc = qed_iwarp_mpa_offload(p_hwfn, ep); in qed_iwarp_accept()
1526 struct qed_iwarp_ep *ep; in qed_iwarp_reject() local
1529 ep = iparams->ep_context; in qed_iwarp_reject()
1530 if (!ep) { in qed_iwarp_reject()
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()
1537 ep->cb_context = iparams->cb_context; in qed_iwarp_reject()
1538 ep->qp = NULL; in qed_iwarp_reject()
1540 qed_iwarp_mpa_v2_set_private(p_hwfn, ep, &mpa_data_size); in qed_iwarp_reject()
1542 ep->cm_info.private_data = ep->ep_buffer_virt->out_pdata; in qed_iwarp_reject()
1543 ep->cm_info.private_data_len = iparams->private_data_len + in qed_iwarp_reject()
1546 memcpy((u8 *)ep->ep_buffer_virt->out_pdata + mpa_data_size, in qed_iwarp_reject()
1549 return qed_iwarp_mpa_offload(p_hwfn, ep); in qed_iwarp_reject()
1600 struct qed_iwarp_ep *ep = NULL; in qed_iwarp_ep_exists() local
1603 list_for_each_entry(ep, in qed_iwarp_ep_exists()
1606 if ((ep->cm_info.local_port == cm_info->local_port) && in qed_iwarp_ep_exists()
1607 (ep->cm_info.remote_port == cm_info->remote_port) && in qed_iwarp_ep_exists()
1608 (ep->cm_info.vlan == cm_info->vlan) && in qed_iwarp_ep_exists()
1609 !memcmp(&ep->cm_info.local_ip, cm_info->local_ip, in qed_iwarp_ep_exists()
1611 !memcmp(&ep->cm_info.remote_ip, cm_info->remote_ip, in qed_iwarp_ep_exists()
2364 struct qed_iwarp_ep *ep; in qed_iwarp_ll2_comp_syn_pkt() local
2424 /* There may be an open ep on this connection if this is a syn in qed_iwarp_ll2_comp_syn_pkt()
2430 ep = qed_iwarp_get_free_ep(p_hwfn); in qed_iwarp_ll2_comp_syn_pkt()
2431 if (!ep) 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()
2438 ether_addr_copy(ep->remote_mac_addr, remote_mac_addr); in qed_iwarp_ll2_comp_syn_pkt()
2439 ether_addr_copy(ep->local_mac_addr, local_mac_addr); in qed_iwarp_ll2_comp_syn_pkt()
2441 memcpy(&ep->cm_info, &cm_info, sizeof(ep->cm_info)); 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()
2445 ep->mss = min_t(u16, QED_IWARP_MAX_FW_MSS, ep->mss); in qed_iwarp_ll2_comp_syn_pkt()
2447 ep->event_cb = listener->event_cb; in qed_iwarp_ll2_comp_syn_pkt()
2448 ep->cb_context = listener->cb_context; in qed_iwarp_ll2_comp_syn_pkt()
2449 ep->connect_mode = TCP_CONNECT_PASSIVE; in qed_iwarp_ll2_comp_syn_pkt()
2451 ep->syn = buf; in qed_iwarp_ll2_comp_syn_pkt()
2452 ep->syn_ip_payload_length = (u16)payload_len; in qed_iwarp_ll2_comp_syn_pkt()
2453 ep->syn_phy_addr = buf->data_phys_addr + data->u.placement_offset + 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()
2865 struct qed_iwarp_ep *ep, 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()
2873 params.ep_context = ep; in qed_iwarp_qp_in_error()
2874 params.cm_info = &ep->cm_info; in qed_iwarp_qp_in_error()
2879 smp_store_release(&ep->state, QED_IWARP_EP_CLOSED); in qed_iwarp_qp_in_error()
2882 list_del(&ep->list_entry); in qed_iwarp_qp_in_error()
2885 ep->event_cb(ep->cb_context, &params); in qed_iwarp_qp_in_error()
2889 struct qed_iwarp_ep *ep, 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()
2896 ep->cid, fw_ret_code); in qed_iwarp_exception_received()
2953 params.ep_context = ep; in qed_iwarp_exception_received()
2954 params.cm_info = &ep->cm_info; in qed_iwarp_exception_received()
2955 ep->event_cb(ep->cb_context, &params); in qed_iwarp_exception_received()
2961 struct qed_iwarp_ep *ep, u8 fw_return_code) in qed_iwarp_tcp_connect_unsuccessful() argument
2967 params.ep_context = ep; in qed_iwarp_tcp_connect_unsuccessful()
2968 params.cm_info = &ep->cm_info; in qed_iwarp_tcp_connect_unsuccessful()
2970 smp_store_release(&ep->state, QED_IWARP_EP_CLOSED); in qed_iwarp_tcp_connect_unsuccessful()
2976 QED_IWARP_CONNECT_MODE_STRING(ep), ep->tcp_cid); in qed_iwarp_tcp_connect_unsuccessful()
2982 QED_IWARP_CONNECT_MODE_STRING(ep), ep->tcp_cid); in qed_iwarp_tcp_connect_unsuccessful()
2987 QED_IWARP_CONNECT_MODE_STRING(ep), ep->tcp_cid); in qed_iwarp_tcp_connect_unsuccessful()
2992 QED_IWARP_CONNECT_MODE_STRING(ep), ep->tcp_cid); in qed_iwarp_tcp_connect_unsuccessful()
2997 QED_IWARP_CONNECT_MODE_STRING(ep), ep->tcp_cid); in qed_iwarp_tcp_connect_unsuccessful()
3003 QED_IWARP_CONNECT_MODE_STRING(ep), in qed_iwarp_tcp_connect_unsuccessful()
3004 ep->tcp_cid, fw_return_code); in qed_iwarp_tcp_connect_unsuccessful()
3009 if (ep->connect_mode == TCP_CONNECT_PASSIVE) { in qed_iwarp_tcp_connect_unsuccessful()
3010 ep->tcp_cid = QED_IWARP_INVALID_TCP_CID; in qed_iwarp_tcp_connect_unsuccessful()
3011 qed_iwarp_return_ep(p_hwfn, ep); in qed_iwarp_tcp_connect_unsuccessful()
3013 ep->event_cb(ep->cb_context, &params); in qed_iwarp_tcp_connect_unsuccessful()
3015 list_del(&ep->list_entry); in qed_iwarp_tcp_connect_unsuccessful()
3022 struct qed_iwarp_ep *ep, u8 fw_return_code) in qed_iwarp_connect_complete() argument
3026 if (ep->connect_mode == TCP_CONNECT_PASSIVE) { in qed_iwarp_connect_complete()
3028 qed_iwarp_ll2_post_rx(p_hwfn, ep->syn, ll2_syn_handle); in qed_iwarp_connect_complete()
3030 ep->syn = NULL; 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
3050 if (!ep || (ep->sig != QED_EP_SIG)) { in qed_iwarp_check_ep_ok()
3051 DP_ERR(p_hwfn, "ERROR ON ASYNC ep=%p\n", ep); in qed_iwarp_check_ep_ok()
3064 struct qed_iwarp_ep *ep = NULL; in qed_iwarp_async_event() local
3069 ep = (struct qed_iwarp_ep *)(uintptr_t)HILO_64(fw_handle->hi, in qed_iwarp_async_event()
3075 if (!qed_iwarp_check_ep_ok(p_hwfn, ep)) in qed_iwarp_async_event()
3079 "EP(0x%x) IWARP_EVENT_TYPE_ASYNC_CONNECT_COMPLETE fw_ret_code=%d\n", in qed_iwarp_async_event()
3080 ep->tcp_cid, fw_return_code); 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()
3089 ep->cid, fw_return_code); 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()
3099 ep->cid, fw_return_code); 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()
3109 ep->cid, fw_return_code); 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()
3118 ep->cid, fw_return_code); in qed_iwarp_async_event()
3119 qed_iwarp_mpa_complete(p_hwfn, ep, fw_return_code); in qed_iwarp_async_event()
3223 struct qed_iwarp_ep *ep; in qed_iwarp_send_rtr() local
3227 ep = iparams->ep_context; in qed_iwarp_send_rtr()
3228 if (!ep) { in qed_iwarp_send_rtr()
3229 DP_ERR(p_hwfn, "Ep Context receive in send_rtr is NULL\n"); in qed_iwarp_send_rtr()
3233 qp = ep->qp; 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()
3236 qp->icid, ep->tcp_cid); in qed_iwarp_send_rtr()