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()
1229 mutex_lock(&ep->com.mutex); in act_establish()
1234 cxgb4_insert_tid(t, ep, tid, ep->com.local_addr.ss_family); in act_establish()
1244 xa_erase_irq(&ep->com.dev->atids, atid); in act_establish()
1246 set_bit(ACT_ESTAB, &ep->com.history); in act_establish()
1258 mutex_unlock(&ep->com.mutex); in act_establish()
1261 mutex_unlock(&ep->com.mutex); in act_establish()
1275 if (ep->com.cm_id) { in close_complete_upcall()
1277 ep, ep->com.cm_id, ep->hwtid); in close_complete_upcall()
1278 ep->com.cm_id->event_handler(ep->com.cm_id, &event); in close_complete_upcall()
1279 deref_cm_id(&ep->com); in close_complete_upcall()
1280 set_bit(CLOSE_UPCALL, &ep->com.history); in close_complete_upcall()
1291 if (ep->com.cm_id) { in peer_close_upcall()
1293 ep, ep->com.cm_id, ep->hwtid); in peer_close_upcall()
1294 ep->com.cm_id->event_handler(ep->com.cm_id, &event); in peer_close_upcall()
1295 set_bit(DISCONN_UPCALL, &ep->com.history); in peer_close_upcall()
1307 if (ep->com.cm_id) { in peer_abort_upcall()
1309 ep->com.cm_id, ep->hwtid); in peer_abort_upcall()
1310 ep->com.cm_id->event_handler(ep->com.cm_id, &event); in peer_abort_upcall()
1311 deref_cm_id(&ep->com); in peer_abort_upcall()
1312 set_bit(ABORT_UPCALL, &ep->com.history); in peer_abort_upcall()
1325 memcpy(&event.local_addr, &ep->com.local_addr, in connect_reply_upcall()
1326 sizeof(ep->com.local_addr)); in connect_reply_upcall()
1327 memcpy(&event.remote_addr, &ep->com.remote_addr, in connect_reply_upcall()
1328 sizeof(ep->com.remote_addr)); in connect_reply_upcall()
1342 event.ord = cur_max_read_depth(ep->com.dev); in connect_reply_upcall()
1343 event.ird = cur_max_read_depth(ep->com.dev); in connect_reply_upcall()
1352 set_bit(CONN_RPL_UPCALL, &ep->com.history); in connect_reply_upcall()
1353 ep->com.cm_id->event_handler(ep->com.cm_id, &event); in connect_reply_upcall()
1356 deref_cm_id(&ep->com); in connect_reply_upcall()
1367 memcpy(&event.local_addr, &ep->com.local_addr, in connect_request_upcall()
1368 sizeof(ep->com.local_addr)); in connect_request_upcall()
1369 memcpy(&event.remote_addr, &ep->com.remote_addr, in connect_request_upcall()
1370 sizeof(ep->com.remote_addr)); in connect_request_upcall()
1382 event.ord = cur_max_read_depth(ep->com.dev); in connect_request_upcall()
1383 event.ird = cur_max_read_depth(ep->com.dev); in connect_request_upcall()
1387 c4iw_get_ep(&ep->com); in connect_request_upcall()
1388 ret = ep->parent_ep->com.cm_id->event_handler(ep->parent_ep->com.cm_id, in connect_request_upcall()
1391 c4iw_put_ep(&ep->com); in connect_request_upcall()
1392 set_bit(CONNREQ_UPCALL, &ep->com.history); in connect_request_upcall()
1393 c4iw_put_ep(&ep->parent_ep->com); in connect_request_upcall()
1406 if (ep->com.cm_id) { in established_upcall()
1408 ep->com.cm_id->event_handler(ep->com.cm_id, &event); in established_upcall()
1409 set_bit(ESTAB_UPCALL, &ep->com.history); in established_upcall()
1441 c4iw_ofld_send(&ep->com.dev->rdev, skb); in update_rx_credits()
1553 __state_set(&ep->com, FPDU_MODE); in process_mpa_reply()
1579 ep->com.dev->rdev.lldi.max_ordird_qp) in process_mpa_reply()
1643 err = c4iw_modify_qp(ep->com.qp->rhp, in process_mpa_reply()
1644 ep->com.qp, mask, &attrs, 1); in process_mpa_reply()
1658 err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in process_mpa_reply()
1677 err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in process_mpa_reply()
1794 cur_max_read_depth(ep->com.dev)); in process_mpa_request()
1798 cur_max_read_depth(ep->com.dev)); in process_mpa_request()
1822 __state_set(&ep->com, MPA_REQ_RCVD); in process_mpa_request()
1825 mutex_lock_nested(&ep->parent_ep->com.mutex, SINGLE_DEPTH_NESTING); in process_mpa_request()
1826 if (ep->parent_ep->com.state != DEAD) { in process_mpa_request()
1832 mutex_unlock(&ep->parent_ep->com.mutex); in process_mpa_request()
1836 mutex_unlock(&ep->parent_ep->com.mutex); in process_mpa_request()
1859 mutex_lock(&ep->com.mutex); in rx_data()
1861 switch (ep->com.state) { in rx_data()
1879 __func__, ep->com.qp->wq.sq.qid, ep, in rx_data()
1880 ep->com.state, ep->hwtid, status); in rx_data()
1882 c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in rx_data()
1890 mutex_unlock(&ep->com.mutex); in rx_data()
1893 c4iw_put_ep(&ep->com); in rx_data()
1901 adapter_type = ep->com.dev->rdev.lldi.adapter_type; in complete_cached_srq_buffers()
1910 if (ep->com.qp->ibqp.uobject) in complete_cached_srq_buffers()
1911 t4_set_wq_in_error(&ep->com.qp->wq, srqidx); in complete_cached_srq_buffers()
1913 c4iw_flush_srqidx(ep->com.qp, srqidx); in complete_cached_srq_buffers()
1931 if (ep->com.qp && ep->com.qp->srq) { in abort_rpl()
1937 mutex_lock(&ep->com.mutex); in abort_rpl()
1938 switch (ep->com.state) { in abort_rpl()
1940 c4iw_wake_up_noref(ep->com.wr_waitp, -ECONNRESET); in abort_rpl()
1941 __state_set(&ep->com, DEAD); in abort_rpl()
1945 pr_err("%s ep %p state %d\n", __func__, ep, ep->com.state); in abort_rpl()
1948 mutex_unlock(&ep->com.mutex); in abort_rpl()
1954 c4iw_put_ep(&ep->com); in abort_rpl()
1972 ep->com.dev->rdev.lldi.ports[0], in send_fw_act_open_req()
1974 sin = (struct sockaddr_in *)&ep->com.local_addr; in send_fw_act_open_req()
1977 sin = (struct sockaddr_in *)&ep->com.remote_addr; in send_fw_act_open_req()
1987 cxgb_best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx, in send_fw_act_open_req()
1989 (ep->com.remote_addr.ss_family == AF_INET) ? 0 : 1); in send_fw_act_open_req()
2013 TX_QUEUE_V(ep->com.dev->rdev.lldi.tx_modq[ep->tx_chan]) | in send_fw_act_open_req()
2026 set_bit(ACT_OFLD_CONN, &ep->com.history); in send_fw_act_open_req()
2027 return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t); in send_fw_act_open_req()
2156 &ep->com.cm_id->m_local_addr; in c4iw_reconnect()
2158 &ep->com.cm_id->m_remote_addr; in c4iw_reconnect()
2160 &ep->com.cm_id->m_local_addr; in c4iw_reconnect()
2162 &ep->com.cm_id->m_remote_addr; in c4iw_reconnect()
2166 pr_debug("qp %p cm_id %p\n", ep->com.qp, ep->com.cm_id); in c4iw_reconnect()
2167 c4iw_init_wr_wait(ep->com.wr_waitp); in c4iw_reconnect()
2178 size = (CN_MAX_CON_BUF - skb_queue_len(&ep->com.ep_skb_list)); in c4iw_reconnect()
2179 if (alloc_ep_skb_list(&ep->com.ep_skb_list, size)) { in c4iw_reconnect()
2187 ep->atid = cxgb4_alloc_atid(ep->com.dev->rdev.lldi.tids, ep); in c4iw_reconnect()
2193 err = xa_insert_irq(&ep->com.dev->atids, ep->atid, ep, GFP_KERNEL); in c4iw_reconnect()
2198 if (ep->com.cm_id->m_local_addr.ss_family == AF_INET) { in c4iw_reconnect()
2199 ep->dst = cxgb_find_route(&ep->com.dev->rdev.lldi, get_real_dev, in c4iw_reconnect()
2203 raddr->sin_port, ep->com.cm_id->tos); in c4iw_reconnect()
2207 ep->dst = cxgb_find_route6(&ep->com.dev->rdev.lldi, in c4iw_reconnect()
2213 ep->com.cm_id->tos, in c4iw_reconnect()
2223 err = import_ep(ep, iptype, ra, ep->dst, ep->com.dev, false, in c4iw_reconnect()
2224 ep->com.dev->rdev.lldi.adapter_type, in c4iw_reconnect()
2225 ep->com.cm_id->tos); in c4iw_reconnect()
2235 state_set(&ep->com, CONNECTING); in c4iw_reconnect()
2236 ep->tos = ep->com.cm_id->tos; in c4iw_reconnect()
2247 xa_erase_irq(&ep->com.dev->atids, ep->atid); in c4iw_reconnect()
2249 cxgb4_free_atid(ep->com.dev->rdev.lldi.tids, ep->atid); in c4iw_reconnect()
2259 c4iw_put_ep(&ep->com); in c4iw_reconnect()
2279 la = (struct sockaddr_in *)&ep->com.local_addr; in act_open_rpl()
2280 ra = (struct sockaddr_in *)&ep->com.remote_addr; in act_open_rpl()
2281 la6 = (struct sockaddr_in6 *)&ep->com.local_addr; in act_open_rpl()
2282 ra6 = (struct sockaddr_in6 *)&ep->com.remote_addr; in act_open_rpl()
2297 set_bit(ACT_OPEN_RPL, &ep->com.history); in act_open_rpl()
2310 if (ep->com.local_addr.ss_family == AF_INET && in act_open_rpl()
2321 set_bit(ACT_RETRY_INUSE, &ep->com.history); in act_open_rpl()
2322 if (ep->com.remote_addr.ss_family == AF_INET6) { in act_open_rpl()
2325 &ep->com.local_addr; in act_open_rpl()
2327 ep->com.dev->rdev.lldi.ports[0], in act_open_rpl()
2331 xa_erase_irq(&ep->com.dev->atids, atid); in act_open_rpl()
2340 if (ep->com.local_addr.ss_family == AF_INET) { in act_open_rpl()
2356 state_set(&ep->com, DEAD); in act_open_rpl()
2358 if (ep->com.remote_addr.ss_family == AF_INET6) { in act_open_rpl()
2360 (struct sockaddr_in6 *)&ep->com.local_addr; in act_open_rpl()
2361 cxgb4_clip_release(ep->com.dev->rdev.lldi.ports[0], in act_open_rpl()
2365 cxgb4_remove_tid(ep->com.dev->rdev.lldi.tids, 0, GET_TID(rpl), in act_open_rpl()
2366 ep->com.local_addr.ss_family); in act_open_rpl()
2368 xa_erase_irq(&ep->com.dev->atids, atid); in act_open_rpl()
2372 c4iw_put_ep(&ep->com); in act_open_rpl()
2389 c4iw_wake_up_noref(ep->com.wr_waitp, status2errno(rpl->status)); in pass_open_rpl()
2390 c4iw_put_ep(&ep->com); in pass_open_rpl()
2406 c4iw_wake_up_noref(ep->com.wr_waitp, status2errno(rpl->status)); in close_listsrv_rpl()
2407 c4iw_put_ep(&ep->com); in close_listsrv_rpl()
2422 enum chip_type adapter_type = ep->com.dev->rdev.lldi.adapter_type; in accept_cr()
2425 cxgb_best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx, in accept_cr()
2427 (ep->com.remote_addr.ss_family == AF_INET) ? 0 : 1); in accept_cr()
2496 return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t); in accept_cr()
2531 if (state_read(&parent_ep->com) != LISTEN) { in pass_accept_req()
2536 if (parent_ep->com.cm_id->tos_set) in pass_accept_req()
2537 tos = parent_ep->com.cm_id->tos; in pass_accept_req()
2541 cxgb_get_4tuple(req, parent_ep->com.dev->rdev.lldi.adapter_type, in pass_accept_req()
2562 &parent_ep->com.local_addr)->sin6_scope_id); in pass_accept_req()
2577 parent_ep->com.dev->rdev.lldi.adapter_type, tos); in pass_accept_req()
2591 skb_queue_head_init(&child_ep->com.ep_skb_list); in pass_accept_req()
2592 if (alloc_ep_skb_list(&child_ep->com.ep_skb_list, CN_MAX_CON_BUF)) in pass_accept_req()
2595 state_set(&child_ep->com, CONNECTING); in pass_accept_req()
2596 child_ep->com.dev = dev; in pass_accept_req()
2597 child_ep->com.cm_id = NULL; in pass_accept_req()
2601 &child_ep->com.local_addr; in pass_accept_req()
2607 sin = (struct sockaddr_in *)&child_ep->com.local_addr; in pass_accept_req()
2610 &parent_ep->com.local_addr)->sin_port; in pass_accept_req()
2613 sin = (struct sockaddr_in *)&child_ep->com.remote_addr; in pass_accept_req()
2618 sin6 = (struct sockaddr_in6 *)&child_ep->com.local_addr; in pass_accept_req()
2623 sin6 = (struct sockaddr_in6 *)&child_ep->com.local_addr; in pass_accept_req()
2626 &parent_ep->com.local_addr)->sin6_port; in pass_accept_req()
2629 sin6 = (struct sockaddr_in6 *)&child_ep->com.remote_addr; in pass_accept_req()
2635 c4iw_get_ep(&parent_ep->com); in pass_accept_req()
2646 child_ep->com.local_addr.ss_family); in pass_accept_req()
2649 c4iw_put_ep(&parent_ep->com); in pass_accept_req()
2652 set_bit(PASS_ACCEPT_REQ, &child_ep->com.history); in pass_accept_req()
2655 sin6 = (struct sockaddr_in6 *)&child_ep->com.local_addr; in pass_accept_req()
2656 cxgb4_clip_get(child_ep->com.dev->rdev.lldi.ports[0], in pass_accept_req()
2661 c4iw_put_ep(&child_ep->com); in pass_accept_req()
2666 c4iw_put_ep(&parent_ep->com); in pass_accept_req()
2689 mutex_lock(&ep->com.mutex); in pass_establish()
2690 ep->com.state = MPA_REQ_WAIT; in pass_establish()
2692 set_bit(PASS_ESTAB, &ep->com.history); in pass_establish()
2694 mutex_unlock(&ep->com.mutex); in pass_establish()
2697 c4iw_put_ep(&ep->com); in pass_establish()
2719 set_bit(PEER_CLOSE, &ep->com.history); in peer_close()
2720 mutex_lock(&ep->com.mutex); in peer_close()
2721 switch (ep->com.state) { in peer_close()
2723 __state_set(&ep->com, CLOSING); in peer_close()
2726 __state_set(&ep->com, CLOSING); in peer_close()
2737 __state_set(&ep->com, CLOSING); in peer_close()
2739 c4iw_wake_up_noref(ep->com.wr_waitp, -ECONNRESET); in peer_close()
2742 __state_set(&ep->com, CLOSING); in peer_close()
2744 c4iw_wake_up_noref(ep->com.wr_waitp, -ECONNRESET); in peer_close()
2748 __state_set(&ep->com, CLOSING); in peer_close()
2750 ret = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in peer_close()
2761 __state_set(&ep->com, MORIBUND); in peer_close()
2766 if (ep->com.cm_id && ep->com.qp) { in peer_close()
2768 c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in peer_close()
2772 __state_set(&ep->com, DEAD); in peer_close()
2780 WARN_ONCE(1, "Bad endpoint state %u\n", ep->com.state); in peer_close()
2782 mutex_unlock(&ep->com.mutex); in peer_close()
2787 c4iw_put_ep(&ep->com); in peer_close()
2794 if (ep->com.cm_id && ep->com.qp) { in finish_peer_abort()
2798 c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in finish_peer_abort()
2803 c4iw_put_ep(&ep->com); in finish_peer_abort()
2837 ep->com.state); in peer_abort()
2838 set_bit(PEER_ABORT, &ep->com.history); in peer_abort()
2842 * However, this is not needed if com state is just in peer_abort()
2845 if (ep->com.state != MPA_REQ_SENT) in peer_abort()
2846 c4iw_wake_up_noref(ep->com.wr_waitp, -ECONNRESET); in peer_abort()
2848 mutex_lock(&ep->com.mutex); in peer_abort()
2849 switch (ep->com.state) { in peer_abort()
2851 c4iw_put_ep(&ep->parent_ep->com); in peer_abort()
2884 if (ep->com.qp && ep->com.qp->srq) { in peer_abort()
2891 c4iw_get_ep(&ep->com); in peer_abort()
2892 __state_set(&ep->com, ABORTING); in peer_abort()
2893 set_bit(PEER_ABORT_IN_PROGRESS, &ep->com.flags); in peer_abort()
2900 if (ep->com.cm_id && ep->com.qp) { in peer_abort()
2902 ret = c4iw_modify_qp(ep->com.qp->rhp, in peer_abort()
2903 ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, in peer_abort()
2914 mutex_unlock(&ep->com.mutex); in peer_abort()
2917 WARN_ONCE(1, "Bad endpoint state %u\n", ep->com.state); in peer_abort()
2921 if (ep->com.state != ABORTING) { in peer_abort()
2922 __state_set(&ep->com, DEAD); in peer_abort()
2927 mutex_unlock(&ep->com.mutex); in peer_abort()
2929 rpl_skb = skb_dequeue(&ep->com.ep_skb_list); in peer_abort()
2937 c4iw_ofld_send(&ep->com.dev->rdev, rpl_skb); in peer_abort()
2942 if (ep->com.remote_addr.ss_family == AF_INET6) { in peer_abort()
2945 &ep->com.local_addr; in peer_abort()
2947 ep->com.dev->rdev.lldi.ports[0], in peer_abort()
2951 xa_erase_irq(&ep->com.dev->hwtids, ep->hwtid); in peer_abort()
2952 cxgb4_remove_tid(ep->com.dev->rdev.lldi.tids, 0, ep->hwtid, in peer_abort()
2953 ep->com.local_addr.ss_family); in peer_abort()
2960 c4iw_put_ep(&ep->com); in peer_abort()
2962 c4iw_put_ep(&ep->com); in peer_abort()
2981 mutex_lock(&ep->com.mutex); in close_con_rpl()
2982 set_bit(CLOSE_CON_RPL, &ep->com.history); in close_con_rpl()
2983 switch (ep->com.state) { in close_con_rpl()
2985 __state_set(&ep->com, MORIBUND); in close_con_rpl()
2989 if ((ep->com.cm_id) && (ep->com.qp)) { in close_con_rpl()
2991 c4iw_modify_qp(ep->com.qp->rhp, in close_con_rpl()
2992 ep->com.qp, in close_con_rpl()
2997 __state_set(&ep->com, DEAD); in close_con_rpl()
3004 WARN_ONCE(1, "Bad endpoint state %u\n", ep->com.state); in close_con_rpl()
3007 mutex_unlock(&ep->com.mutex); in close_con_rpl()
3010 c4iw_put_ep(&ep->com); in close_con_rpl()
3024 if (ep->com.qp) { in terminate()
3026 ep->com.qp->wq.sq.qid); in terminate()
3028 c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in terminate()
3036 c4iw_put_ep(&ep->com); in terminate()
3063 ep, ep->hwtid, state_read(&ep->com)); in fw4_ack()
3070 ep, ep->hwtid, state_read(&ep->com), in fw4_ack()
3072 mutex_lock(&ep->com.mutex); in fw4_ack()
3075 if (test_bit(STOP_MPA_TIMER, &ep->com.flags)) in fw4_ack()
3077 mutex_unlock(&ep->com.mutex); in fw4_ack()
3080 c4iw_put_ep(&ep->com); in fw4_ack()
3091 mutex_lock(&ep->com.mutex); in c4iw_reject_cr()
3092 if (ep->com.state != MPA_REQ_RCVD) { in c4iw_reject_cr()
3093 mutex_unlock(&ep->com.mutex); in c4iw_reject_cr()
3094 c4iw_put_ep(&ep->com); in c4iw_reject_cr()
3097 set_bit(ULP_REJECT, &ep->com.history); in c4iw_reject_cr()
3102 mutex_unlock(&ep->com.mutex); in c4iw_reject_cr()
3106 c4iw_put_ep(&ep->com); in c4iw_reject_cr()
3122 mutex_lock(&ep->com.mutex); in c4iw_accept_cr()
3123 if (ep->com.state != MPA_REQ_RCVD) { in c4iw_accept_cr()
3133 set_bit(ULP_ACCEPT, &ep->com.history); in c4iw_accept_cr()
3134 if ((conn_param->ord > cur_max_read_depth(ep->com.dev)) || in c4iw_accept_cr()
3135 (conn_param->ird > cur_max_read_depth(ep->com.dev))) { in c4iw_accept_cr()
3178 ep->com.cm_id = cm_id; in c4iw_accept_cr()
3179 ref_cm_id(&ep->com); in c4iw_accept_cr()
3180 ep->com.qp = qp; in c4iw_accept_cr()
3197 err = c4iw_modify_qp(ep->com.qp->rhp, in c4iw_accept_cr()
3198 ep->com.qp, mask, &attrs, 1); in c4iw_accept_cr()
3202 set_bit(STOP_MPA_TIMER, &ep->com.flags); in c4iw_accept_cr()
3208 __state_set(&ep->com, FPDU_MODE); in c4iw_accept_cr()
3210 mutex_unlock(&ep->com.mutex); in c4iw_accept_cr()
3211 c4iw_put_ep(&ep->com); in c4iw_accept_cr()
3214 deref_cm_id(&ep->com); in c4iw_accept_cr()
3218 mutex_unlock(&ep->com.mutex); in c4iw_accept_cr()
3221 c4iw_put_ep(&ep->com); in c4iw_accept_cr()
3315 skb_queue_head_init(&ep->com.ep_skb_list); in c4iw_connect()
3316 if (alloc_ep_skb_list(&ep->com.ep_skb_list, CN_MAX_CON_BUF)) { in c4iw_connect()
3332 ep->com.cm_id = cm_id; in c4iw_connect()
3333 ref_cm_id(&ep->com); in c4iw_connect()
3335 ep->com.dev = dev; in c4iw_connect()
3336 ep->com.qp = get_qhp(dev, conn_param->qpn); in c4iw_connect()
3337 if (!ep->com.qp) { in c4iw_connect()
3344 ep->com.qp, cm_id); in c4iw_connect()
3359 memcpy(&ep->com.local_addr, &cm_id->m_local_addr, in c4iw_connect()
3360 sizeof(ep->com.local_addr)); in c4iw_connect()
3361 memcpy(&ep->com.remote_addr, &cm_id->m_remote_addr, in c4iw_connect()
3362 sizeof(ep->com.remote_addr)); in c4iw_connect()
3364 laddr = (struct sockaddr_in *)&ep->com.local_addr; in c4iw_connect()
3365 raddr = (struct sockaddr_in *)&ep->com.remote_addr; in c4iw_connect()
3366 laddr6 = (struct sockaddr_in6 *)&ep->com.local_addr; in c4iw_connect()
3367 raddr6 = (struct sockaddr_in6 *) &ep->com.remote_addr; in c4iw_connect()
3422 err = import_ep(ep, iptype, ra, ep->dst, ep->com.dev, true, in c4iw_connect()
3423 ep->com.dev->rdev.lldi.adapter_type, cm_id->tos); in c4iw_connect()
3433 state_set(&ep->com, CONNECTING); in c4iw_connect()
3445 xa_erase_irq(&ep->com.dev->atids, ep->atid); in c4iw_connect()
3447 cxgb4_free_atid(ep->com.dev->rdev.lldi.tids, ep->atid); in c4iw_connect()
3449 skb_queue_purge(&ep->com.ep_skb_list); in c4iw_connect()
3450 deref_cm_id(&ep->com); in c4iw_connect()
3452 c4iw_put_ep(&ep->com); in c4iw_connect()
3461 &ep->com.local_addr; in create_server6()
3464 err = cxgb4_clip_get(ep->com.dev->rdev.lldi.ports[0], in create_server6()
3469 c4iw_init_wr_wait(ep->com.wr_waitp); in create_server6()
3470 err = cxgb4_create_server6(ep->com.dev->rdev.lldi.ports[0], in create_server6()
3473 ep->com.dev->rdev.lldi.rxq_ids[0]); in create_server6()
3475 err = c4iw_wait_for_reply(&ep->com.dev->rdev, in create_server6()
3476 ep->com.wr_waitp, in create_server6()
3481 cxgb4_clip_release(ep->com.dev->rdev.lldi.ports[0], in create_server6()
3494 &ep->com.local_addr; in create_server4()
3499 ep->com.dev->rdev.lldi.ports[0], ep->stid, in create_server4()
3501 ep->com.dev->rdev.lldi.rxq_ids[0], 0, 0); in create_server4()
3503 if (c4iw_fatal_error(&ep->com.dev->rdev)) { in create_server4()
3512 c4iw_init_wr_wait(ep->com.wr_waitp); in create_server4()
3513 err = cxgb4_create_server(ep->com.dev->rdev.lldi.ports[0], in create_server4()
3515 0, ep->com.dev->rdev.lldi.rxq_ids[0]); in create_server4()
3517 err = c4iw_wait_for_reply(&ep->com.dev->rdev, in create_server4()
3518 ep->com.wr_waitp, in create_server4()
3544 skb_queue_head_init(&ep->com.ep_skb_list); in c4iw_create_listen()
3546 ep->com.cm_id = cm_id; in c4iw_create_listen()
3547 ref_cm_id(&ep->com); in c4iw_create_listen()
3548 ep->com.dev = dev; in c4iw_create_listen()
3550 memcpy(&ep->com.local_addr, &cm_id->m_local_addr, in c4iw_create_listen()
3551 sizeof(ep->com.local_addr)); in c4iw_create_listen()
3557 ep->com.local_addr.ss_family == AF_INET) in c4iw_create_listen()
3573 state_set(&ep->com, LISTEN); in c4iw_create_listen()
3574 if (ep->com.local_addr.ss_family == AF_INET) in c4iw_create_listen()
3582 xa_erase_irq(&ep->com.dev->stids, ep->stid); in c4iw_create_listen()
3584 cxgb4_free_stid(ep->com.dev->rdev.lldi.tids, ep->stid, in c4iw_create_listen()
3585 ep->com.local_addr.ss_family); in c4iw_create_listen()
3587 deref_cm_id(&ep->com); in c4iw_create_listen()
3588 c4iw_put_ep(&ep->com); in c4iw_create_listen()
3602 state_set(&ep->com, DEAD); in c4iw_destroy_listen()
3603 if (ep->com.dev->rdev.lldi.enable_fw_ofld_conn && in c4iw_destroy_listen()
3604 ep->com.local_addr.ss_family == AF_INET) { in c4iw_destroy_listen()
3606 ep->com.dev->rdev.lldi.ports[0], ep->stid, in c4iw_destroy_listen()
3607 ep->com.dev->rdev.lldi.rxq_ids[0], false); in c4iw_destroy_listen()
3610 c4iw_init_wr_wait(ep->com.wr_waitp); in c4iw_destroy_listen()
3612 ep->com.dev->rdev.lldi.ports[0], ep->stid, in c4iw_destroy_listen()
3613 ep->com.dev->rdev.lldi.rxq_ids[0], in c4iw_destroy_listen()
3614 ep->com.local_addr.ss_family == AF_INET6); in c4iw_destroy_listen()
3617 err = c4iw_wait_for_reply(&ep->com.dev->rdev, ep->com.wr_waitp, in c4iw_destroy_listen()
3619 sin6 = (struct sockaddr_in6 *)&ep->com.local_addr; in c4iw_destroy_listen()
3620 cxgb4_clip_release(ep->com.dev->rdev.lldi.ports[0], in c4iw_destroy_listen()
3623 xa_erase_irq(&ep->com.dev->stids, ep->stid); in c4iw_destroy_listen()
3624 cxgb4_free_stid(ep->com.dev->rdev.lldi.tids, ep->stid, in c4iw_destroy_listen()
3625 ep->com.local_addr.ss_family); in c4iw_destroy_listen()
3627 deref_cm_id(&ep->com); in c4iw_destroy_listen()
3628 c4iw_put_ep(&ep->com); in c4iw_destroy_listen()
3639 mutex_lock(&ep->com.mutex); in c4iw_ep_disconnect()
3642 states[ep->com.state], abrupt); in c4iw_ep_disconnect()
3648 c4iw_get_ep(&ep->com); in c4iw_ep_disconnect()
3650 rdev = &ep->com.dev->rdev; in c4iw_ep_disconnect()
3654 ep->com.state = DEAD; in c4iw_ep_disconnect()
3656 switch (ep->com.state) { in c4iw_ep_disconnect()
3665 ep->com.state = ABORTING; in c4iw_ep_disconnect()
3667 ep->com.state = CLOSING; in c4iw_ep_disconnect()
3674 test_bit(STOP_MPA_TIMER, &ep->com.flags)) { in c4iw_ep_disconnect()
3675 clear_bit(STOP_MPA_TIMER, &ep->com.flags); in c4iw_ep_disconnect()
3680 set_bit(CLOSE_SENT, &ep->com.flags); in c4iw_ep_disconnect()
3683 if (!test_and_set_bit(CLOSE_SENT, &ep->com.flags)) { in c4iw_ep_disconnect()
3687 ep->com.state = ABORTING; in c4iw_ep_disconnect()
3689 ep->com.state = MORIBUND; in c4iw_ep_disconnect()
3696 ep, ep->com.state); in c4iw_ep_disconnect()
3699 WARN_ONCE(1, "Bad endpoint state %u\n", ep->com.state); in c4iw_ep_disconnect()
3705 set_bit(EP_DISC_ABORT, &ep->com.history); in c4iw_ep_disconnect()
3708 set_bit(EP_DISC_CLOSE, &ep->com.history); in c4iw_ep_disconnect()
3712 set_bit(EP_DISC_FAIL, &ep->com.history); in c4iw_ep_disconnect()
3717 if (ep->com.qp) { in c4iw_ep_disconnect()
3721 ret = c4iw_modify_qp(ep->com.qp->rhp, in c4iw_ep_disconnect()
3722 ep->com.qp, in c4iw_ep_disconnect()
3732 mutex_unlock(&ep->com.mutex); in c4iw_ep_disconnect()
3733 c4iw_put_ep(&ep->com); in c4iw_ep_disconnect()
3752 set_bit(ACT_RETRY_NOMEM, &ep->com.history); in active_ofld_conn_reply()
3759 set_bit(ACT_RETRY_INUSE, &ep->com.history); in active_ofld_conn_reply()
3776 state_set(&ep->com, DEAD); in active_ofld_conn_reply()
3777 if (ep->com.remote_addr.ss_family == AF_INET6) { in active_ofld_conn_reply()
3779 (struct sockaddr_in6 *)&ep->com.local_addr; in active_ofld_conn_reply()
3780 cxgb4_clip_release(ep->com.dev->rdev.lldi.ports[0], in active_ofld_conn_reply()
3787 c4iw_put_ep(&ep->com); in active_ofld_conn_reply()
3862 c4iw_put_ep(&ep->com); /* from get_ep_from_tid() */ in read_tcb_rpl()
3863 c4iw_put_ep(&ep->com); /* from read_tcb() */ in read_tcb_rpl()
3880 if (test_bit(PEER_ABORT_IN_PROGRESS, &ep->com.flags)) in read_tcb_rpl()
3882 else if (test_bit(ABORT_REQ_IN_PROGRESS, &ep->com.flags)) in read_tcb_rpl()
4187 c4iw_put_ep(&lep->com); in rx_pkt()
4222 mutex_lock(&ep->com.mutex); in process_timeout()
4223 pr_debug("ep %p tid %u state %d\n", ep, ep->hwtid, ep->com.state); in process_timeout()
4224 set_bit(TIMEDOUT, &ep->com.history); in process_timeout()
4225 switch (ep->com.state) { in process_timeout()
4236 if (ep->com.cm_id && ep->com.qp) { in process_timeout()
4238 c4iw_modify_qp(ep->com.qp->rhp, in process_timeout()
4239 ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, in process_timeout()
4256 __func__, ep, ep->hwtid, ep->com.state); in process_timeout()
4259 mutex_unlock(&ep->com.mutex); in process_timeout()
4262 c4iw_put_ep(&ep->com); in process_timeout()
4320 if (!test_and_set_bit(TIMEOUT, &ep->com.flags)) { in ep_timeout()
4414 pr_debug("ep %p tid %u state %u\n", ep, ep->hwtid, ep->com.state); in peer_abort_intr()
4416 c4iw_wake_up_noref(ep->com.wr_waitp, -ECONNRESET); in peer_abort_intr()