Lines Matching full:com

165 	c4iw_qp_rem_ref(&ep->com.qp->ibqp);  in deref_qp()
166 clear_bit(QP_REFERENCED, &ep->com.flags); in deref_qp()
167 set_bit(QP_DEREFED, &ep->com.history); in deref_qp()
172 set_bit(QP_REFERENCED, &ep->com.flags); in ref_qp()
173 set_bit(QP_REFED, &ep->com.history); in ref_qp()
174 c4iw_qp_add_ref(&ep->com.qp->ibqp); in ref_qp()
185 clear_bit(TIMEOUT, &ep->com.flags); in start_ep_timer()
186 c4iw_get_ep(&ep->com); in start_ep_timer()
195 if (!test_and_set_bit(TIMEOUT, &ep->com.flags)) { in stop_ep_timer()
196 c4iw_put_ep(&ep->com); in stop_ep_timer()
250 ep->emss = ep->com.dev->rdev.lldi.mtus[TCPOPT_MSS_G(opt)] - in set_emss()
251 ((AF_INET == ep->com.remote_addr.ss_family) ? in set_emss()
334 xa_lock_irqsave(&ep->com.dev->hwtids, flags); in remove_ep_tid()
335 __xa_erase(&ep->com.dev->hwtids, ep->hwtid); in remove_ep_tid()
336 if (xa_empty(&ep->com.dev->hwtids)) in remove_ep_tid()
337 wake_up(&ep->com.dev->wait); in remove_ep_tid()
338 xa_unlock_irqrestore(&ep->com.dev->hwtids, flags); in remove_ep_tid()
346 xa_lock_irqsave(&ep->com.dev->hwtids, flags); in insert_ep_tid()
347 err = __xa_insert(&ep->com.dev->hwtids, ep->hwtid, ep, GFP_KERNEL); in insert_ep_tid()
348 xa_unlock_irqrestore(&ep->com.dev->hwtids, flags); in insert_ep_tid()
364 c4iw_get_ep(&ep->com); in get_ep_from_tid()
381 c4iw_get_ep(&ep->com); in get_ep_from_stid()
390 ep = container_of(kref, struct c4iw_ep, com.kref); in _c4iw_free_ep()
391 pr_debug("ep %p state %s\n", ep, states[ep->com.state]); in _c4iw_free_ep()
392 if (test_bit(QP_REFERENCED, &ep->com.flags)) in _c4iw_free_ep()
394 if (test_bit(RELEASE_RESOURCES, &ep->com.flags)) { in _c4iw_free_ep()
395 if (ep->com.remote_addr.ss_family == AF_INET6) { in _c4iw_free_ep()
398 &ep->com.local_addr; in _c4iw_free_ep()
401 ep->com.dev->rdev.lldi.ports[0], in _c4iw_free_ep()
405 cxgb4_remove_tid(ep->com.dev->rdev.lldi.tids, 0, ep->hwtid, in _c4iw_free_ep()
406 ep->com.local_addr.ss_family); in _c4iw_free_ep()
411 if (!skb_queue_empty(&ep->com.ep_skb_list)) in _c4iw_free_ep()
412 skb_queue_purge(&ep->com.ep_skb_list); in _c4iw_free_ep()
413 c4iw_put_wr_wait(ep->com.wr_waitp); in _c4iw_free_ep()
419 set_bit(RELEASE_RESOURCES, &ep->com.flags); in release_ep_resources()
429 c4iw_put_ep(&ep->com); in release_ep_resources()
506 c4iw_put_ep(&ep->parent_ep->com); in _put_pass_ep_safe()
530 sched(ep->com.dev, skb); in queue_arp_failure_cpl()
541 __state_set(&ep->com, DEAD); in pass_accept_rpl_arp_failure()
554 __state_set(&ep->com, DEAD); in act_open_req_arp_failure()
555 if (ep->com.remote_addr.ss_family == AF_INET6) { in act_open_req_arp_failure()
557 (struct sockaddr_in6 *)&ep->com.local_addr; in act_open_req_arp_failure()
558 cxgb4_clip_release(ep->com.dev->rdev.lldi.ports[0], in act_open_req_arp_failure()
561 xa_erase_irq(&ep->com.dev->atids, ep->atid); in act_open_req_arp_failure()
562 cxgb4_free_atid(ep->com.dev->rdev.lldi.tids, ep->atid); in act_open_req_arp_failure()
574 struct c4iw_rdev *rdev = &ep->com.dev->rdev; in abort_arp_failure()
582 __state_set(&ep->com, DEAD); in abort_arp_failure()
591 struct sk_buff *skb = skb_dequeue(&ep->com.ep_skb_list); in send_flowc()
618 (ep->com.dev->rdev.lldi.pf)); in send_flowc()
643 return c4iw_ofld_send(&ep->com.dev->rdev, skb); in send_flowc()
648 struct sk_buff *skb = skb_dequeue(&ep->com.ep_skb_list); in send_halfclose()
658 return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t); in send_halfclose()
682 c4iw_get_ep(&ep->com); in read_tcb()
683 if (WARN_ON(c4iw_ofld_send(&ep->com.dev->rdev, skb))) in read_tcb()
684 c4iw_put_ep(&ep->com); in read_tcb()
690 struct sk_buff *req_skb = skb_dequeue(&ep->com.ep_skb_list); in send_abort_req()
699 return c4iw_l2t_send(&ep->com.dev->rdev, req_skb, ep->l2t); in send_abort_req()
704 if (!ep->com.qp || !ep->com.qp->srq) { in send_abort()
708 set_bit(ABORT_REQ_IN_PROGRESS, &ep->com.flags); in send_abort()
728 &ep->com.local_addr; in send_connect()
730 &ep->com.remote_addr; in send_connect()
732 &ep->com.local_addr; in send_connect()
734 &ep->com.remote_addr; in send_connect()
736 enum chip_type adapter_type = ep->com.dev->rdev.lldi.adapter_type; in send_connect()
741 netdev = ep->com.dev->rdev.lldi.ports[0]; in send_connect()
762 wrlen = (ep->com.remote_addr.ss_family == AF_INET) ? in send_connect()
775 cxgb_best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx, in send_connect()
777 (ep->com.remote_addr.ss_family == AF_INET) ? 0 : 1); in send_connect()
819 if (ep->com.remote_addr.ss_family == AF_INET6) in send_connect()
820 cxgb4_clip_get(ep->com.dev->rdev.lldi.ports[0], in send_connect()
825 if (ep->com.remote_addr.ss_family == AF_INET) { in send_connect()
857 if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) { in send_connect()
861 if (is_t5(ep->com.dev->rdev.lldi.adapter_type)) { in send_connect()
909 if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) { in send_connect()
914 if (is_t5(ep->com.dev->rdev.lldi.adapter_type)) { in send_connect()
931 set_bit(ACT_OPEN_REQ, &ep->com.history); in send_connect()
932 ret = c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t); in send_connect()
934 if (ret && ep->com.remote_addr.ss_family == AF_INET6) in send_connect()
935 cxgb4_clip_release(ep->com.dev->rdev.lldi.ports[0], in send_connect()
1035 ret = c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t); in send_mpa_req()
1039 __state_set(&ep->com, MPA_REQ_SENT); in send_mpa_req()
1122 return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t); in send_mpa_reject()
1209 __state_set(&ep->com, MPA_REP_SENT); in send_mpa_reply()
1211 return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t); in send_mpa_reply()
1231 mutex_lock(&ep->com.mutex); in act_establish()
1236 cxgb4_insert_tid(t, ep, tid, ep->com.local_addr.ss_family); in act_establish()
1246 xa_erase_irq(&ep->com.dev->atids, atid); in act_establish()
1248 set_bit(ACT_ESTAB, &ep->com.history); in act_establish()
1260 mutex_unlock(&ep->com.mutex); in act_establish()
1263 mutex_unlock(&ep->com.mutex); in act_establish()
1277 if (ep->com.cm_id) { in close_complete_upcall()
1279 ep, ep->com.cm_id, ep->hwtid); in close_complete_upcall()
1280 ep->com.cm_id->event_handler(ep->com.cm_id, &event); in close_complete_upcall()
1281 deref_cm_id(&ep->com); in close_complete_upcall()
1282 set_bit(CLOSE_UPCALL, &ep->com.history); in close_complete_upcall()
1293 if (ep->com.cm_id) { in peer_close_upcall()
1295 ep, ep->com.cm_id, ep->hwtid); in peer_close_upcall()
1296 ep->com.cm_id->event_handler(ep->com.cm_id, &event); in peer_close_upcall()
1297 set_bit(DISCONN_UPCALL, &ep->com.history); in peer_close_upcall()
1309 if (ep->com.cm_id) { in peer_abort_upcall()
1311 ep->com.cm_id, ep->hwtid); in peer_abort_upcall()
1312 ep->com.cm_id->event_handler(ep->com.cm_id, &event); in peer_abort_upcall()
1313 deref_cm_id(&ep->com); in peer_abort_upcall()
1314 set_bit(ABORT_UPCALL, &ep->com.history); in peer_abort_upcall()
1327 memcpy(&event.local_addr, &ep->com.local_addr, in connect_reply_upcall()
1328 sizeof(ep->com.local_addr)); in connect_reply_upcall()
1329 memcpy(&event.remote_addr, &ep->com.remote_addr, in connect_reply_upcall()
1330 sizeof(ep->com.remote_addr)); in connect_reply_upcall()
1344 event.ord = cur_max_read_depth(ep->com.dev); in connect_reply_upcall()
1345 event.ird = cur_max_read_depth(ep->com.dev); in connect_reply_upcall()
1354 set_bit(CONN_RPL_UPCALL, &ep->com.history); in connect_reply_upcall()
1355 ep->com.cm_id->event_handler(ep->com.cm_id, &event); in connect_reply_upcall()
1358 deref_cm_id(&ep->com); in connect_reply_upcall()
1369 memcpy(&event.local_addr, &ep->com.local_addr, in connect_request_upcall()
1370 sizeof(ep->com.local_addr)); in connect_request_upcall()
1371 memcpy(&event.remote_addr, &ep->com.remote_addr, in connect_request_upcall()
1372 sizeof(ep->com.remote_addr)); in connect_request_upcall()
1384 event.ord = cur_max_read_depth(ep->com.dev); in connect_request_upcall()
1385 event.ird = cur_max_read_depth(ep->com.dev); in connect_request_upcall()
1389 c4iw_get_ep(&ep->com); in connect_request_upcall()
1390 ret = ep->parent_ep->com.cm_id->event_handler(ep->parent_ep->com.cm_id, in connect_request_upcall()
1393 c4iw_put_ep(&ep->com); in connect_request_upcall()
1394 set_bit(CONNREQ_UPCALL, &ep->com.history); in connect_request_upcall()
1395 c4iw_put_ep(&ep->parent_ep->com); in connect_request_upcall()
1408 if (ep->com.cm_id) { in established_upcall()
1410 ep->com.cm_id->event_handler(ep->com.cm_id, &event); in established_upcall()
1411 set_bit(ESTAB_UPCALL, &ep->com.history); in established_upcall()
1443 c4iw_ofld_send(&ep->com.dev->rdev, skb); in update_rx_credits()
1555 __state_set(&ep->com, FPDU_MODE); in process_mpa_reply()
1581 ep->com.dev->rdev.lldi.max_ordird_qp) in process_mpa_reply()
1645 err = c4iw_modify_qp(ep->com.qp->rhp, in process_mpa_reply()
1646 ep->com.qp, mask, &attrs, 1); in process_mpa_reply()
1660 err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in process_mpa_reply()
1679 err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in process_mpa_reply()
1796 cur_max_read_depth(ep->com.dev)); in process_mpa_request()
1800 cur_max_read_depth(ep->com.dev)); in process_mpa_request()
1824 __state_set(&ep->com, MPA_REQ_RCVD); in process_mpa_request()
1827 mutex_lock_nested(&ep->parent_ep->com.mutex, SINGLE_DEPTH_NESTING); in process_mpa_request()
1828 if (ep->parent_ep->com.state != DEAD) { in process_mpa_request()
1834 mutex_unlock(&ep->parent_ep->com.mutex); in process_mpa_request()
1838 mutex_unlock(&ep->parent_ep->com.mutex); in process_mpa_request()
1861 mutex_lock(&ep->com.mutex); in rx_data()
1863 switch (ep->com.state) { in rx_data()
1881 __func__, ep->com.qp->wq.sq.qid, ep, in rx_data()
1882 ep->com.state, ep->hwtid, status); in rx_data()
1884 c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in rx_data()
1892 mutex_unlock(&ep->com.mutex); in rx_data()
1895 c4iw_put_ep(&ep->com); in rx_data()
1903 adapter_type = ep->com.dev->rdev.lldi.adapter_type; in complete_cached_srq_buffers()
1912 if (ep->com.qp->ibqp.uobject) in complete_cached_srq_buffers()
1913 t4_set_wq_in_error(&ep->com.qp->wq, srqidx); in complete_cached_srq_buffers()
1915 c4iw_flush_srqidx(ep->com.qp, srqidx); in complete_cached_srq_buffers()
1933 if (ep->com.qp && ep->com.qp->srq) { in abort_rpl()
1939 mutex_lock(&ep->com.mutex); in abort_rpl()
1940 switch (ep->com.state) { in abort_rpl()
1942 c4iw_wake_up_noref(ep->com.wr_waitp, -ECONNRESET); in abort_rpl()
1943 __state_set(&ep->com, DEAD); in abort_rpl()
1947 pr_err("%s ep %p state %d\n", __func__, ep, ep->com.state); in abort_rpl()
1950 mutex_unlock(&ep->com.mutex); in abort_rpl()
1956 c4iw_put_ep(&ep->com); in abort_rpl()
1977 ep->com.dev->rdev.lldi.ports[0], in send_fw_act_open_req()
1979 sin = (struct sockaddr_in *)&ep->com.local_addr; in send_fw_act_open_req()
1982 sin = (struct sockaddr_in *)&ep->com.remote_addr; in send_fw_act_open_req()
1992 cxgb_best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx, in send_fw_act_open_req()
1994 (ep->com.remote_addr.ss_family == AF_INET) ? 0 : 1); in send_fw_act_open_req()
2018 TX_QUEUE_V(ep->com.dev->rdev.lldi.tx_modq[ep->tx_chan]) | in send_fw_act_open_req()
2031 set_bit(ACT_OFLD_CONN, &ep->com.history); in send_fw_act_open_req()
2032 return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t); in send_fw_act_open_req()
2160 &ep->com.cm_id->m_local_addr; in c4iw_reconnect()
2162 &ep->com.cm_id->m_remote_addr; in c4iw_reconnect()
2164 &ep->com.cm_id->m_local_addr; in c4iw_reconnect()
2166 &ep->com.cm_id->m_remote_addr; in c4iw_reconnect()
2170 pr_debug("qp %p cm_id %p\n", ep->com.qp, ep->com.cm_id); in c4iw_reconnect()
2171 c4iw_init_wr_wait(ep->com.wr_waitp); in c4iw_reconnect()
2182 size = (CN_MAX_CON_BUF - skb_queue_len(&ep->com.ep_skb_list)); in c4iw_reconnect()
2183 if (alloc_ep_skb_list(&ep->com.ep_skb_list, size)) { in c4iw_reconnect()
2191 ep->atid = cxgb4_alloc_atid(ep->com.dev->rdev.lldi.tids, ep); in c4iw_reconnect()
2197 err = xa_insert_irq(&ep->com.dev->atids, ep->atid, ep, GFP_KERNEL); in c4iw_reconnect()
2202 if (ep->com.cm_id->m_local_addr.ss_family == AF_INET) { in c4iw_reconnect()
2203 ep->dst = cxgb_find_route(&ep->com.dev->rdev.lldi, get_real_dev, in c4iw_reconnect()
2207 raddr->sin_port, ep->com.cm_id->tos); in c4iw_reconnect()
2211 ep->dst = cxgb_find_route6(&ep->com.dev->rdev.lldi, in c4iw_reconnect()
2217 ep->com.cm_id->tos, in c4iw_reconnect()
2227 err = import_ep(ep, iptype, ra, ep->dst, ep->com.dev, false, in c4iw_reconnect()
2228 ep->com.dev->rdev.lldi.adapter_type, in c4iw_reconnect()
2229 ep->com.cm_id->tos); in c4iw_reconnect()
2239 state_set(&ep->com, CONNECTING); in c4iw_reconnect()
2240 ep->tos = ep->com.cm_id->tos; in c4iw_reconnect()
2251 xa_erase_irq(&ep->com.dev->atids, ep->atid); in c4iw_reconnect()
2253 cxgb4_free_atid(ep->com.dev->rdev.lldi.tids, ep->atid); in c4iw_reconnect()
2263 c4iw_put_ep(&ep->com); in c4iw_reconnect()
2286 la = (struct sockaddr_in *)&ep->com.local_addr; in act_open_rpl()
2287 ra = (struct sockaddr_in *)&ep->com.remote_addr; in act_open_rpl()
2288 la6 = (struct sockaddr_in6 *)&ep->com.local_addr; in act_open_rpl()
2289 ra6 = (struct sockaddr_in6 *)&ep->com.remote_addr; in act_open_rpl()
2304 set_bit(ACT_OPEN_RPL, &ep->com.history); in act_open_rpl()
2317 if (ep->com.local_addr.ss_family == AF_INET && in act_open_rpl()
2328 set_bit(ACT_RETRY_INUSE, &ep->com.history); in act_open_rpl()
2329 if (ep->com.remote_addr.ss_family == AF_INET6) { in act_open_rpl()
2332 &ep->com.local_addr; in act_open_rpl()
2334 ep->com.dev->rdev.lldi.ports[0], in act_open_rpl()
2338 xa_erase_irq(&ep->com.dev->atids, atid); in act_open_rpl()
2347 if (ep->com.local_addr.ss_family == AF_INET) { in act_open_rpl()
2363 state_set(&ep->com, DEAD); in act_open_rpl()
2365 if (ep->com.remote_addr.ss_family == AF_INET6) { in act_open_rpl()
2367 (struct sockaddr_in6 *)&ep->com.local_addr; in act_open_rpl()
2368 cxgb4_clip_release(ep->com.dev->rdev.lldi.ports[0], in act_open_rpl()
2372 cxgb4_remove_tid(ep->com.dev->rdev.lldi.tids, 0, GET_TID(rpl), in act_open_rpl()
2373 ep->com.local_addr.ss_family); in act_open_rpl()
2375 xa_erase_irq(&ep->com.dev->atids, atid); in act_open_rpl()
2379 c4iw_put_ep(&ep->com); in act_open_rpl()
2396 c4iw_wake_up_noref(ep->com.wr_waitp, status2errno(rpl->status)); in pass_open_rpl()
2397 c4iw_put_ep(&ep->com); in pass_open_rpl()
2413 c4iw_wake_up_noref(ep->com.wr_waitp, status2errno(rpl->status)); in close_listsrv_rpl()
2414 c4iw_put_ep(&ep->com); in close_listsrv_rpl()
2429 enum chip_type adapter_type = ep->com.dev->rdev.lldi.adapter_type; in accept_cr()
2432 cxgb_best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx, in accept_cr()
2434 (ep->com.remote_addr.ss_family == AF_INET) ? 0 : 1); in accept_cr()
2503 return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t); in accept_cr()
2538 if (state_read(&parent_ep->com) != LISTEN) { in pass_accept_req()
2543 if (parent_ep->com.cm_id->tos_set) in pass_accept_req()
2544 tos = parent_ep->com.cm_id->tos; in pass_accept_req()
2548 cxgb_get_4tuple(req, parent_ep->com.dev->rdev.lldi.adapter_type, in pass_accept_req()
2569 &parent_ep->com.local_addr)->sin6_scope_id); in pass_accept_req()
2584 parent_ep->com.dev->rdev.lldi.adapter_type, tos); in pass_accept_req()
2598 skb_queue_head_init(&child_ep->com.ep_skb_list); in pass_accept_req()
2599 if (alloc_ep_skb_list(&child_ep->com.ep_skb_list, CN_MAX_CON_BUF)) in pass_accept_req()
2602 state_set(&child_ep->com, CONNECTING); in pass_accept_req()
2603 child_ep->com.dev = dev; in pass_accept_req()
2604 child_ep->com.cm_id = NULL; in pass_accept_req()
2608 &child_ep->com.local_addr; in pass_accept_req()
2614 sin = (struct sockaddr_in *)&child_ep->com.local_addr; in pass_accept_req()
2617 &parent_ep->com.local_addr)->sin_port; in pass_accept_req()
2620 sin = (struct sockaddr_in *)&child_ep->com.remote_addr; in pass_accept_req()
2625 sin6 = (struct sockaddr_in6 *)&child_ep->com.local_addr; in pass_accept_req()
2630 sin6 = (struct sockaddr_in6 *)&child_ep->com.local_addr; in pass_accept_req()
2633 &parent_ep->com.local_addr)->sin6_port; in pass_accept_req()
2636 sin6 = (struct sockaddr_in6 *)&child_ep->com.remote_addr; in pass_accept_req()
2642 c4iw_get_ep(&parent_ep->com); in pass_accept_req()
2653 child_ep->com.local_addr.ss_family); in pass_accept_req()
2656 c4iw_put_ep(&parent_ep->com); in pass_accept_req()
2659 set_bit(PASS_ACCEPT_REQ, &child_ep->com.history); in pass_accept_req()
2662 sin6 = (struct sockaddr_in6 *)&child_ep->com.local_addr; in pass_accept_req()
2663 cxgb4_clip_get(child_ep->com.dev->rdev.lldi.ports[0], in pass_accept_req()
2668 c4iw_put_ep(&child_ep->com); in pass_accept_req()
2673 c4iw_put_ep(&parent_ep->com); in pass_accept_req()
2699 mutex_lock(&ep->com.mutex); in pass_establish()
2700 ep->com.state = MPA_REQ_WAIT; in pass_establish()
2702 set_bit(PASS_ESTAB, &ep->com.history); in pass_establish()
2704 mutex_unlock(&ep->com.mutex); in pass_establish()
2707 c4iw_put_ep(&ep->com); in pass_establish()
2729 set_bit(PEER_CLOSE, &ep->com.history); in peer_close()
2730 mutex_lock(&ep->com.mutex); in peer_close()
2731 switch (ep->com.state) { in peer_close()
2733 __state_set(&ep->com, CLOSING); in peer_close()
2736 __state_set(&ep->com, CLOSING); in peer_close()
2747 __state_set(&ep->com, CLOSING); in peer_close()
2749 c4iw_wake_up_noref(ep->com.wr_waitp, -ECONNRESET); in peer_close()
2752 __state_set(&ep->com, CLOSING); in peer_close()
2754 c4iw_wake_up_noref(ep->com.wr_waitp, -ECONNRESET); in peer_close()
2758 __state_set(&ep->com, CLOSING); in peer_close()
2760 ret = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in peer_close()
2771 __state_set(&ep->com, MORIBUND); in peer_close()
2776 if (ep->com.cm_id && ep->com.qp) { in peer_close()
2778 c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in peer_close()
2782 __state_set(&ep->com, DEAD); in peer_close()
2790 WARN_ONCE(1, "Bad endpoint state %u\n", ep->com.state); in peer_close()
2792 mutex_unlock(&ep->com.mutex); in peer_close()
2797 c4iw_put_ep(&ep->com); in peer_close()
2804 if (ep->com.cm_id && ep->com.qp) { in finish_peer_abort()
2808 c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in finish_peer_abort()
2813 c4iw_put_ep(&ep->com); in finish_peer_abort()
2847 ep->com.state); in peer_abort()
2848 set_bit(PEER_ABORT, &ep->com.history); in peer_abort()
2852 * However, this is not needed if com state is just in peer_abort()
2855 if (ep->com.state != MPA_REQ_SENT) in peer_abort()
2856 c4iw_wake_up_noref(ep->com.wr_waitp, -ECONNRESET); in peer_abort()
2858 mutex_lock(&ep->com.mutex); in peer_abort()
2859 switch (ep->com.state) { in peer_abort()
2861 c4iw_put_ep(&ep->parent_ep->com); in peer_abort()
2894 if (ep->com.qp && ep->com.qp->srq) { in peer_abort()
2901 c4iw_get_ep(&ep->com); in peer_abort()
2902 __state_set(&ep->com, ABORTING); in peer_abort()
2903 set_bit(PEER_ABORT_IN_PROGRESS, &ep->com.flags); in peer_abort()
2910 if (ep->com.cm_id && ep->com.qp) { in peer_abort()
2912 ret = c4iw_modify_qp(ep->com.qp->rhp, in peer_abort()
2913 ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, in peer_abort()
2924 mutex_unlock(&ep->com.mutex); in peer_abort()
2927 WARN_ONCE(1, "Bad endpoint state %u\n", ep->com.state); in peer_abort()
2931 if (ep->com.state != ABORTING) { in peer_abort()
2932 __state_set(&ep->com, DEAD); in peer_abort()
2937 mutex_unlock(&ep->com.mutex); in peer_abort()
2939 rpl_skb = skb_dequeue(&ep->com.ep_skb_list); in peer_abort()
2947 c4iw_ofld_send(&ep->com.dev->rdev, rpl_skb); in peer_abort()
2952 if (ep->com.remote_addr.ss_family == AF_INET6) { in peer_abort()
2955 &ep->com.local_addr; in peer_abort()
2957 ep->com.dev->rdev.lldi.ports[0], in peer_abort()
2961 xa_erase_irq(&ep->com.dev->hwtids, ep->hwtid); in peer_abort()
2962 cxgb4_remove_tid(ep->com.dev->rdev.lldi.tids, 0, ep->hwtid, in peer_abort()
2963 ep->com.local_addr.ss_family); in peer_abort()
2970 c4iw_put_ep(&ep->com); in peer_abort()
2972 c4iw_put_ep(&ep->com); in peer_abort()
2991 mutex_lock(&ep->com.mutex); in close_con_rpl()
2992 set_bit(CLOSE_CON_RPL, &ep->com.history); in close_con_rpl()
2993 switch (ep->com.state) { in close_con_rpl()
2995 __state_set(&ep->com, MORIBUND); in close_con_rpl()
2999 if ((ep->com.cm_id) && (ep->com.qp)) { in close_con_rpl()
3001 c4iw_modify_qp(ep->com.qp->rhp, in close_con_rpl()
3002 ep->com.qp, in close_con_rpl()
3007 __state_set(&ep->com, DEAD); in close_con_rpl()
3014 WARN_ONCE(1, "Bad endpoint state %u\n", ep->com.state); in close_con_rpl()
3017 mutex_unlock(&ep->com.mutex); in close_con_rpl()
3020 c4iw_put_ep(&ep->com); in close_con_rpl()
3034 if (ep->com.qp) { in terminate()
3036 ep->com.qp->wq.sq.qid); in terminate()
3038 c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in terminate()
3046 c4iw_put_ep(&ep->com); in terminate()
3073 ep, ep->hwtid, state_read(&ep->com)); in fw4_ack()
3080 ep, ep->hwtid, state_read(&ep->com), in fw4_ack()
3082 mutex_lock(&ep->com.mutex); in fw4_ack()
3085 if (test_bit(STOP_MPA_TIMER, &ep->com.flags)) in fw4_ack()
3087 mutex_unlock(&ep->com.mutex); in fw4_ack()
3090 c4iw_put_ep(&ep->com); in fw4_ack()
3101 mutex_lock(&ep->com.mutex); in c4iw_reject_cr()
3102 if (ep->com.state != MPA_REQ_RCVD) { in c4iw_reject_cr()
3103 mutex_unlock(&ep->com.mutex); in c4iw_reject_cr()
3104 c4iw_put_ep(&ep->com); in c4iw_reject_cr()
3107 set_bit(ULP_REJECT, &ep->com.history); in c4iw_reject_cr()
3112 mutex_unlock(&ep->com.mutex); in c4iw_reject_cr()
3116 c4iw_put_ep(&ep->com); in c4iw_reject_cr()
3132 mutex_lock(&ep->com.mutex); in c4iw_accept_cr()
3133 if (ep->com.state != MPA_REQ_RCVD) { in c4iw_accept_cr()
3143 set_bit(ULP_ACCEPT, &ep->com.history); in c4iw_accept_cr()
3144 if ((conn_param->ord > cur_max_read_depth(ep->com.dev)) || in c4iw_accept_cr()
3145 (conn_param->ird > cur_max_read_depth(ep->com.dev))) { in c4iw_accept_cr()
3188 ep->com.cm_id = cm_id; in c4iw_accept_cr()
3189 ref_cm_id(&ep->com); in c4iw_accept_cr()
3190 ep->com.qp = qp; in c4iw_accept_cr()
3207 err = c4iw_modify_qp(ep->com.qp->rhp, in c4iw_accept_cr()
3208 ep->com.qp, mask, &attrs, 1); in c4iw_accept_cr()
3212 set_bit(STOP_MPA_TIMER, &ep->com.flags); in c4iw_accept_cr()
3218 __state_set(&ep->com, FPDU_MODE); in c4iw_accept_cr()
3220 mutex_unlock(&ep->com.mutex); in c4iw_accept_cr()
3221 c4iw_put_ep(&ep->com); in c4iw_accept_cr()
3224 deref_cm_id(&ep->com); in c4iw_accept_cr()
3228 mutex_unlock(&ep->com.mutex); in c4iw_accept_cr()
3231 c4iw_put_ep(&ep->com); in c4iw_accept_cr()
3325 skb_queue_head_init(&ep->com.ep_skb_list); in c4iw_connect()
3326 if (alloc_ep_skb_list(&ep->com.ep_skb_list, CN_MAX_CON_BUF)) { in c4iw_connect()
3342 ep->com.cm_id = cm_id; in c4iw_connect()
3343 ref_cm_id(&ep->com); in c4iw_connect()
3345 ep->com.dev = dev; in c4iw_connect()
3346 ep->com.qp = get_qhp(dev, conn_param->qpn); in c4iw_connect()
3347 if (!ep->com.qp) { in c4iw_connect()
3354 ep->com.qp, cm_id); in c4iw_connect()
3369 memcpy(&ep->com.local_addr, &cm_id->m_local_addr, in c4iw_connect()
3370 sizeof(ep->com.local_addr)); in c4iw_connect()
3371 memcpy(&ep->com.remote_addr, &cm_id->m_remote_addr, in c4iw_connect()
3372 sizeof(ep->com.remote_addr)); in c4iw_connect()
3374 laddr = (struct sockaddr_in *)&ep->com.local_addr; in c4iw_connect()
3375 raddr = (struct sockaddr_in *)&ep->com.remote_addr; in c4iw_connect()
3376 laddr6 = (struct sockaddr_in6 *)&ep->com.local_addr; in c4iw_connect()
3377 raddr6 = (struct sockaddr_in6 *) &ep->com.remote_addr; in c4iw_connect()
3432 err = import_ep(ep, iptype, ra, ep->dst, ep->com.dev, true, in c4iw_connect()
3433 ep->com.dev->rdev.lldi.adapter_type, cm_id->tos); in c4iw_connect()
3443 state_set(&ep->com, CONNECTING); in c4iw_connect()
3455 xa_erase_irq(&ep->com.dev->atids, ep->atid); in c4iw_connect()
3457 cxgb4_free_atid(ep->com.dev->rdev.lldi.tids, ep->atid); in c4iw_connect()
3459 skb_queue_purge(&ep->com.ep_skb_list); in c4iw_connect()
3460 deref_cm_id(&ep->com); in c4iw_connect()
3462 c4iw_put_ep(&ep->com); in c4iw_connect()
3471 &ep->com.local_addr; in create_server6()
3474 err = cxgb4_clip_get(ep->com.dev->rdev.lldi.ports[0], in create_server6()
3479 c4iw_init_wr_wait(ep->com.wr_waitp); in create_server6()
3480 err = cxgb4_create_server6(ep->com.dev->rdev.lldi.ports[0], in create_server6()
3483 ep->com.dev->rdev.lldi.rxq_ids[0]); in create_server6()
3485 err = c4iw_wait_for_reply(&ep->com.dev->rdev, in create_server6()
3486 ep->com.wr_waitp, in create_server6()
3491 cxgb4_clip_release(ep->com.dev->rdev.lldi.ports[0], in create_server6()
3504 &ep->com.local_addr; in create_server4()
3509 ep->com.dev->rdev.lldi.ports[0], ep->stid, in create_server4()
3511 ep->com.dev->rdev.lldi.rxq_ids[0], 0, 0); in create_server4()
3513 if (c4iw_fatal_error(&ep->com.dev->rdev)) { in create_server4()
3522 c4iw_init_wr_wait(ep->com.wr_waitp); in create_server4()
3523 err = cxgb4_create_server(ep->com.dev->rdev.lldi.ports[0], in create_server4()
3525 0, ep->com.dev->rdev.lldi.rxq_ids[0]); in create_server4()
3527 err = c4iw_wait_for_reply(&ep->com.dev->rdev, in create_server4()
3528 ep->com.wr_waitp, in create_server4()
3554 skb_queue_head_init(&ep->com.ep_skb_list); in c4iw_create_listen()
3556 ep->com.cm_id = cm_id; in c4iw_create_listen()
3557 ref_cm_id(&ep->com); in c4iw_create_listen()
3558 ep->com.dev = dev; in c4iw_create_listen()
3560 memcpy(&ep->com.local_addr, &cm_id->m_local_addr, in c4iw_create_listen()
3561 sizeof(ep->com.local_addr)); in c4iw_create_listen()
3567 ep->com.local_addr.ss_family == AF_INET) in c4iw_create_listen()
3583 state_set(&ep->com, LISTEN); in c4iw_create_listen()
3584 if (ep->com.local_addr.ss_family == AF_INET) in c4iw_create_listen()
3592 xa_erase_irq(&ep->com.dev->stids, ep->stid); in c4iw_create_listen()
3594 cxgb4_free_stid(ep->com.dev->rdev.lldi.tids, ep->stid, in c4iw_create_listen()
3595 ep->com.local_addr.ss_family); in c4iw_create_listen()
3597 deref_cm_id(&ep->com); in c4iw_create_listen()
3598 c4iw_put_ep(&ep->com); in c4iw_create_listen()
3612 state_set(&ep->com, DEAD); in c4iw_destroy_listen()
3613 if (ep->com.dev->rdev.lldi.enable_fw_ofld_conn && in c4iw_destroy_listen()
3614 ep->com.local_addr.ss_family == AF_INET) { in c4iw_destroy_listen()
3616 ep->com.dev->rdev.lldi.ports[0], ep->stid, in c4iw_destroy_listen()
3617 ep->com.dev->rdev.lldi.rxq_ids[0], false); in c4iw_destroy_listen()
3620 c4iw_init_wr_wait(ep->com.wr_waitp); in c4iw_destroy_listen()
3622 ep->com.dev->rdev.lldi.ports[0], ep->stid, in c4iw_destroy_listen()
3623 ep->com.dev->rdev.lldi.rxq_ids[0], in c4iw_destroy_listen()
3624 ep->com.local_addr.ss_family == AF_INET6); in c4iw_destroy_listen()
3627 err = c4iw_wait_for_reply(&ep->com.dev->rdev, ep->com.wr_waitp, in c4iw_destroy_listen()
3629 sin6 = (struct sockaddr_in6 *)&ep->com.local_addr; in c4iw_destroy_listen()
3630 cxgb4_clip_release(ep->com.dev->rdev.lldi.ports[0], in c4iw_destroy_listen()
3633 xa_erase_irq(&ep->com.dev->stids, ep->stid); in c4iw_destroy_listen()
3634 cxgb4_free_stid(ep->com.dev->rdev.lldi.tids, ep->stid, in c4iw_destroy_listen()
3635 ep->com.local_addr.ss_family); in c4iw_destroy_listen()
3637 deref_cm_id(&ep->com); in c4iw_destroy_listen()
3638 c4iw_put_ep(&ep->com); in c4iw_destroy_listen()
3649 mutex_lock(&ep->com.mutex); in c4iw_ep_disconnect()
3652 states[ep->com.state], abrupt); in c4iw_ep_disconnect()
3658 c4iw_get_ep(&ep->com); in c4iw_ep_disconnect()
3660 rdev = &ep->com.dev->rdev; in c4iw_ep_disconnect()
3664 ep->com.state = DEAD; in c4iw_ep_disconnect()
3666 switch (ep->com.state) { in c4iw_ep_disconnect()
3675 ep->com.state = ABORTING; in c4iw_ep_disconnect()
3677 ep->com.state = CLOSING; in c4iw_ep_disconnect()
3684 test_bit(STOP_MPA_TIMER, &ep->com.flags)) { in c4iw_ep_disconnect()
3685 clear_bit(STOP_MPA_TIMER, &ep->com.flags); in c4iw_ep_disconnect()
3690 set_bit(CLOSE_SENT, &ep->com.flags); in c4iw_ep_disconnect()
3693 if (!test_and_set_bit(CLOSE_SENT, &ep->com.flags)) { in c4iw_ep_disconnect()
3697 ep->com.state = ABORTING; in c4iw_ep_disconnect()
3699 ep->com.state = MORIBUND; in c4iw_ep_disconnect()
3706 ep, ep->com.state); in c4iw_ep_disconnect()
3709 WARN_ONCE(1, "Bad endpoint state %u\n", ep->com.state); in c4iw_ep_disconnect()
3715 set_bit(EP_DISC_ABORT, &ep->com.history); in c4iw_ep_disconnect()
3718 set_bit(EP_DISC_CLOSE, &ep->com.history); in c4iw_ep_disconnect()
3722 set_bit(EP_DISC_FAIL, &ep->com.history); in c4iw_ep_disconnect()
3727 if (ep->com.qp) { in c4iw_ep_disconnect()
3731 ret = c4iw_modify_qp(ep->com.qp->rhp, in c4iw_ep_disconnect()
3732 ep->com.qp, in c4iw_ep_disconnect()
3742 mutex_unlock(&ep->com.mutex); in c4iw_ep_disconnect()
3743 c4iw_put_ep(&ep->com); in c4iw_ep_disconnect()
3762 set_bit(ACT_RETRY_NOMEM, &ep->com.history); in active_ofld_conn_reply()
3769 set_bit(ACT_RETRY_INUSE, &ep->com.history); in active_ofld_conn_reply()
3786 state_set(&ep->com, DEAD); in active_ofld_conn_reply()
3787 if (ep->com.remote_addr.ss_family == AF_INET6) { in active_ofld_conn_reply()
3789 (struct sockaddr_in6 *)&ep->com.local_addr; in active_ofld_conn_reply()
3790 cxgb4_clip_release(ep->com.dev->rdev.lldi.ports[0], in active_ofld_conn_reply()
3797 c4iw_put_ep(&ep->com); in active_ofld_conn_reply()
3872 c4iw_put_ep(&ep->com); /* from get_ep_from_tid() */ in read_tcb_rpl()
3873 c4iw_put_ep(&ep->com); /* from read_tcb() */ in read_tcb_rpl()
3890 if (test_bit(PEER_ABORT_IN_PROGRESS, &ep->com.flags)) in read_tcb_rpl()
3892 else if (test_bit(ABORT_REQ_IN_PROGRESS, &ep->com.flags)) in read_tcb_rpl()
4201 c4iw_put_ep(&lep->com); in rx_pkt()
4236 mutex_lock(&ep->com.mutex); in process_timeout()
4237 pr_debug("ep %p tid %u state %d\n", ep, ep->hwtid, ep->com.state); in process_timeout()
4238 set_bit(TIMEDOUT, &ep->com.history); in process_timeout()
4239 switch (ep->com.state) { in process_timeout()
4250 if (ep->com.cm_id && ep->com.qp) { in process_timeout()
4252 c4iw_modify_qp(ep->com.qp->rhp, in process_timeout()
4253 ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, in process_timeout()
4270 __func__, ep, ep->hwtid, ep->com.state); in process_timeout()
4273 mutex_unlock(&ep->com.mutex); in process_timeout()
4276 c4iw_put_ep(&ep->com); in process_timeout()
4334 if (!test_and_set_bit(TIMEOUT, &ep->com.flags)) { in ep_timeout()
4428 pr_debug("ep %p tid %u state %u\n", ep, ep->hwtid, ep->com.state); in peer_abort_intr()
4430 c4iw_wake_up_noref(ep->com.wr_waitp, -ECONNRESET); in peer_abort_intr()