Lines Matching refs: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()
1975 ep->com.dev->rdev.lldi.ports[0], in send_fw_act_open_req()
1977 sin = (struct sockaddr_in *)&ep->com.local_addr; in send_fw_act_open_req()
1980 sin = (struct sockaddr_in *)&ep->com.remote_addr; in send_fw_act_open_req()
1990 cxgb_best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx, in send_fw_act_open_req()
1992 (ep->com.remote_addr.ss_family == AF_INET) ? 0 : 1); in send_fw_act_open_req()
2016 TX_QUEUE_V(ep->com.dev->rdev.lldi.tx_modq[ep->tx_chan]) | in send_fw_act_open_req()
2029 set_bit(ACT_OFLD_CONN, &ep->com.history); in send_fw_act_open_req()
2030 return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t); in send_fw_act_open_req()
2159 &ep->com.cm_id->m_local_addr; in c4iw_reconnect()
2161 &ep->com.cm_id->m_remote_addr; in c4iw_reconnect()
2163 &ep->com.cm_id->m_local_addr; in c4iw_reconnect()
2165 &ep->com.cm_id->m_remote_addr; in c4iw_reconnect()
2169 pr_debug("qp %p cm_id %p\n", ep->com.qp, ep->com.cm_id); in c4iw_reconnect()
2170 c4iw_init_wr_wait(ep->com.wr_waitp); in c4iw_reconnect()
2181 size = (CN_MAX_CON_BUF - skb_queue_len(&ep->com.ep_skb_list)); in c4iw_reconnect()
2182 if (alloc_ep_skb_list(&ep->com.ep_skb_list, size)) { in c4iw_reconnect()
2190 ep->atid = cxgb4_alloc_atid(ep->com.dev->rdev.lldi.tids, ep); in c4iw_reconnect()
2196 err = xa_insert_irq(&ep->com.dev->atids, ep->atid, ep, GFP_KERNEL); in c4iw_reconnect()
2201 if (ep->com.cm_id->m_local_addr.ss_family == AF_INET) { in c4iw_reconnect()
2202 ep->dst = cxgb_find_route(&ep->com.dev->rdev.lldi, get_real_dev, in c4iw_reconnect()
2206 raddr->sin_port, ep->com.cm_id->tos); in c4iw_reconnect()
2210 ep->dst = cxgb_find_route6(&ep->com.dev->rdev.lldi, in c4iw_reconnect()
2216 ep->com.cm_id->tos, in c4iw_reconnect()
2226 err = import_ep(ep, iptype, ra, ep->dst, ep->com.dev, false, in c4iw_reconnect()
2227 ep->com.dev->rdev.lldi.adapter_type, in c4iw_reconnect()
2228 ep->com.cm_id->tos); in c4iw_reconnect()
2238 state_set(&ep->com, CONNECTING); in c4iw_reconnect()
2239 ep->tos = ep->com.cm_id->tos; in c4iw_reconnect()
2250 xa_erase_irq(&ep->com.dev->atids, ep->atid); in c4iw_reconnect()
2252 cxgb4_free_atid(ep->com.dev->rdev.lldi.tids, ep->atid); in c4iw_reconnect()
2262 c4iw_put_ep(&ep->com); in c4iw_reconnect()
2282 la = (struct sockaddr_in *)&ep->com.local_addr; in act_open_rpl()
2283 ra = (struct sockaddr_in *)&ep->com.remote_addr; in act_open_rpl()
2284 la6 = (struct sockaddr_in6 *)&ep->com.local_addr; in act_open_rpl()
2285 ra6 = (struct sockaddr_in6 *)&ep->com.remote_addr; in act_open_rpl()
2300 set_bit(ACT_OPEN_RPL, &ep->com.history); in act_open_rpl()
2313 if (ep->com.local_addr.ss_family == AF_INET && in act_open_rpl()
2324 set_bit(ACT_RETRY_INUSE, &ep->com.history); in act_open_rpl()
2325 if (ep->com.remote_addr.ss_family == AF_INET6) { in act_open_rpl()
2328 &ep->com.local_addr; in act_open_rpl()
2330 ep->com.dev->rdev.lldi.ports[0], in act_open_rpl()
2334 xa_erase_irq(&ep->com.dev->atids, atid); in act_open_rpl()
2343 if (ep->com.local_addr.ss_family == AF_INET) { in act_open_rpl()
2359 state_set(&ep->com, DEAD); in act_open_rpl()
2361 if (ep->com.remote_addr.ss_family == AF_INET6) { in act_open_rpl()
2363 (struct sockaddr_in6 *)&ep->com.local_addr; in act_open_rpl()
2364 cxgb4_clip_release(ep->com.dev->rdev.lldi.ports[0], in act_open_rpl()
2368 cxgb4_remove_tid(ep->com.dev->rdev.lldi.tids, 0, GET_TID(rpl), in act_open_rpl()
2369 ep->com.local_addr.ss_family); in act_open_rpl()
2371 xa_erase_irq(&ep->com.dev->atids, atid); in act_open_rpl()
2375 c4iw_put_ep(&ep->com); in act_open_rpl()
2392 c4iw_wake_up_noref(ep->com.wr_waitp, status2errno(rpl->status)); in pass_open_rpl()
2393 c4iw_put_ep(&ep->com); in pass_open_rpl()
2409 c4iw_wake_up_noref(ep->com.wr_waitp, status2errno(rpl->status)); in close_listsrv_rpl()
2410 c4iw_put_ep(&ep->com); in close_listsrv_rpl()
2425 enum chip_type adapter_type = ep->com.dev->rdev.lldi.adapter_type; in accept_cr()
2428 cxgb_best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx, in accept_cr()
2430 (ep->com.remote_addr.ss_family == AF_INET) ? 0 : 1); in accept_cr()
2505 return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t); in accept_cr()
2540 if (state_read(&parent_ep->com) != LISTEN) { in pass_accept_req()
2545 if (parent_ep->com.cm_id->tos_set) in pass_accept_req()
2546 tos = parent_ep->com.cm_id->tos; in pass_accept_req()
2550 cxgb_get_4tuple(req, parent_ep->com.dev->rdev.lldi.adapter_type, in pass_accept_req()
2571 &parent_ep->com.local_addr)->sin6_scope_id); in pass_accept_req()
2586 parent_ep->com.dev->rdev.lldi.adapter_type, tos); in pass_accept_req()
2600 skb_queue_head_init(&child_ep->com.ep_skb_list); in pass_accept_req()
2601 if (alloc_ep_skb_list(&child_ep->com.ep_skb_list, CN_MAX_CON_BUF)) in pass_accept_req()
2604 state_set(&child_ep->com, CONNECTING); in pass_accept_req()
2605 child_ep->com.dev = dev; in pass_accept_req()
2606 child_ep->com.cm_id = NULL; in pass_accept_req()
2610 &child_ep->com.local_addr; in pass_accept_req()
2616 sin = (struct sockaddr_in *)&child_ep->com.local_addr; in pass_accept_req()
2619 &parent_ep->com.local_addr)->sin_port; in pass_accept_req()
2622 sin = (struct sockaddr_in *)&child_ep->com.remote_addr; in pass_accept_req()
2627 sin6 = (struct sockaddr_in6 *)&child_ep->com.local_addr; in pass_accept_req()
2632 sin6 = (struct sockaddr_in6 *)&child_ep->com.local_addr; in pass_accept_req()
2635 &parent_ep->com.local_addr)->sin6_port; in pass_accept_req()
2638 sin6 = (struct sockaddr_in6 *)&child_ep->com.remote_addr; in pass_accept_req()
2644 c4iw_get_ep(&parent_ep->com); in pass_accept_req()
2655 child_ep->com.local_addr.ss_family); in pass_accept_req()
2658 c4iw_put_ep(&parent_ep->com); in pass_accept_req()
2661 set_bit(PASS_ACCEPT_REQ, &child_ep->com.history); in pass_accept_req()
2664 sin6 = (struct sockaddr_in6 *)&child_ep->com.local_addr; in pass_accept_req()
2665 cxgb4_clip_get(child_ep->com.dev->rdev.lldi.ports[0], in pass_accept_req()
2670 c4iw_put_ep(&child_ep->com); in pass_accept_req()
2675 c4iw_put_ep(&parent_ep->com); in pass_accept_req()
2701 mutex_lock(&ep->com.mutex); in pass_establish()
2702 ep->com.state = MPA_REQ_WAIT; in pass_establish()
2704 set_bit(PASS_ESTAB, &ep->com.history); in pass_establish()
2706 mutex_unlock(&ep->com.mutex); in pass_establish()
2709 c4iw_put_ep(&ep->com); in pass_establish()
2731 set_bit(PEER_CLOSE, &ep->com.history); in peer_close()
2732 mutex_lock(&ep->com.mutex); in peer_close()
2733 switch (ep->com.state) { in peer_close()
2735 __state_set(&ep->com, CLOSING); in peer_close()
2738 __state_set(&ep->com, CLOSING); in peer_close()
2749 __state_set(&ep->com, CLOSING); in peer_close()
2751 c4iw_wake_up_noref(ep->com.wr_waitp, -ECONNRESET); in peer_close()
2754 __state_set(&ep->com, CLOSING); in peer_close()
2756 c4iw_wake_up_noref(ep->com.wr_waitp, -ECONNRESET); in peer_close()
2760 __state_set(&ep->com, CLOSING); in peer_close()
2762 ret = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in peer_close()
2773 __state_set(&ep->com, MORIBUND); in peer_close()
2778 if (ep->com.cm_id && ep->com.qp) { in peer_close()
2780 c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in peer_close()
2784 __state_set(&ep->com, DEAD); in peer_close()
2792 WARN_ONCE(1, "Bad endpoint state %u\n", ep->com.state); in peer_close()
2794 mutex_unlock(&ep->com.mutex); in peer_close()
2799 c4iw_put_ep(&ep->com); in peer_close()
2806 if (ep->com.cm_id && ep->com.qp) { in finish_peer_abort()
2810 c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in finish_peer_abort()
2815 c4iw_put_ep(&ep->com); in finish_peer_abort()
2849 ep->com.state); in peer_abort()
2850 set_bit(PEER_ABORT, &ep->com.history); in peer_abort()
2857 if (ep->com.state != MPA_REQ_SENT) in peer_abort()
2858 c4iw_wake_up_noref(ep->com.wr_waitp, -ECONNRESET); in peer_abort()
2860 mutex_lock(&ep->com.mutex); in peer_abort()
2861 switch (ep->com.state) { in peer_abort()
2863 c4iw_put_ep(&ep->parent_ep->com); in peer_abort()
2896 if (ep->com.qp && ep->com.qp->srq) { in peer_abort()
2903 c4iw_get_ep(&ep->com); in peer_abort()
2904 __state_set(&ep->com, ABORTING); in peer_abort()
2905 set_bit(PEER_ABORT_IN_PROGRESS, &ep->com.flags); in peer_abort()
2912 if (ep->com.cm_id && ep->com.qp) { in peer_abort()
2914 ret = c4iw_modify_qp(ep->com.qp->rhp, in peer_abort()
2915 ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, in peer_abort()
2926 mutex_unlock(&ep->com.mutex); in peer_abort()
2929 WARN_ONCE(1, "Bad endpoint state %u\n", ep->com.state); in peer_abort()
2933 if (ep->com.state != ABORTING) { in peer_abort()
2934 __state_set(&ep->com, DEAD); in peer_abort()
2939 mutex_unlock(&ep->com.mutex); in peer_abort()
2941 rpl_skb = skb_dequeue(&ep->com.ep_skb_list); in peer_abort()
2949 c4iw_ofld_send(&ep->com.dev->rdev, rpl_skb); in peer_abort()
2954 if (ep->com.remote_addr.ss_family == AF_INET6) { in peer_abort()
2957 &ep->com.local_addr; in peer_abort()
2959 ep->com.dev->rdev.lldi.ports[0], in peer_abort()
2963 xa_erase_irq(&ep->com.dev->hwtids, ep->hwtid); in peer_abort()
2964 cxgb4_remove_tid(ep->com.dev->rdev.lldi.tids, 0, ep->hwtid, in peer_abort()
2965 ep->com.local_addr.ss_family); in peer_abort()
2972 c4iw_put_ep(&ep->com); in peer_abort()
2974 c4iw_put_ep(&ep->com); in peer_abort()
2993 mutex_lock(&ep->com.mutex); in close_con_rpl()
2994 set_bit(CLOSE_CON_RPL, &ep->com.history); in close_con_rpl()
2995 switch (ep->com.state) { in close_con_rpl()
2997 __state_set(&ep->com, MORIBUND); in close_con_rpl()
3001 if ((ep->com.cm_id) && (ep->com.qp)) { in close_con_rpl()
3003 c4iw_modify_qp(ep->com.qp->rhp, in close_con_rpl()
3004 ep->com.qp, in close_con_rpl()
3009 __state_set(&ep->com, DEAD); in close_con_rpl()
3016 WARN_ONCE(1, "Bad endpoint state %u\n", ep->com.state); in close_con_rpl()
3019 mutex_unlock(&ep->com.mutex); in close_con_rpl()
3022 c4iw_put_ep(&ep->com); in close_con_rpl()
3036 if (ep->com.qp) { in terminate()
3038 ep->com.qp->wq.sq.qid); in terminate()
3040 c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, in terminate()
3048 c4iw_put_ep(&ep->com); in terminate()
3075 ep, ep->hwtid, state_read(&ep->com)); in fw4_ack()
3082 ep, ep->hwtid, state_read(&ep->com), in fw4_ack()
3084 mutex_lock(&ep->com.mutex); in fw4_ack()
3087 if (test_bit(STOP_MPA_TIMER, &ep->com.flags)) in fw4_ack()
3089 mutex_unlock(&ep->com.mutex); in fw4_ack()
3092 c4iw_put_ep(&ep->com); in fw4_ack()
3103 mutex_lock(&ep->com.mutex); in c4iw_reject_cr()
3104 if (ep->com.state != MPA_REQ_RCVD) { in c4iw_reject_cr()
3105 mutex_unlock(&ep->com.mutex); in c4iw_reject_cr()
3106 c4iw_put_ep(&ep->com); in c4iw_reject_cr()
3109 set_bit(ULP_REJECT, &ep->com.history); in c4iw_reject_cr()
3114 mutex_unlock(&ep->com.mutex); in c4iw_reject_cr()
3118 c4iw_put_ep(&ep->com); in c4iw_reject_cr()
3134 mutex_lock(&ep->com.mutex); in c4iw_accept_cr()
3135 if (ep->com.state != MPA_REQ_RCVD) { in c4iw_accept_cr()
3145 set_bit(ULP_ACCEPT, &ep->com.history); in c4iw_accept_cr()
3146 if ((conn_param->ord > cur_max_read_depth(ep->com.dev)) || in c4iw_accept_cr()
3147 (conn_param->ird > cur_max_read_depth(ep->com.dev))) { in c4iw_accept_cr()
3190 ep->com.cm_id = cm_id; in c4iw_accept_cr()
3191 ref_cm_id(&ep->com); in c4iw_accept_cr()
3192 ep->com.qp = qp; in c4iw_accept_cr()
3209 err = c4iw_modify_qp(ep->com.qp->rhp, in c4iw_accept_cr()
3210 ep->com.qp, mask, &attrs, 1); in c4iw_accept_cr()
3214 set_bit(STOP_MPA_TIMER, &ep->com.flags); in c4iw_accept_cr()
3220 __state_set(&ep->com, FPDU_MODE); in c4iw_accept_cr()
3222 mutex_unlock(&ep->com.mutex); in c4iw_accept_cr()
3223 c4iw_put_ep(&ep->com); in c4iw_accept_cr()
3226 deref_cm_id(&ep->com); in c4iw_accept_cr()
3230 mutex_unlock(&ep->com.mutex); in c4iw_accept_cr()
3233 c4iw_put_ep(&ep->com); in c4iw_accept_cr()
3327 skb_queue_head_init(&ep->com.ep_skb_list); in c4iw_connect()
3328 if (alloc_ep_skb_list(&ep->com.ep_skb_list, CN_MAX_CON_BUF)) { in c4iw_connect()
3344 ep->com.cm_id = cm_id; in c4iw_connect()
3345 ref_cm_id(&ep->com); in c4iw_connect()
3347 ep->com.dev = dev; in c4iw_connect()
3348 ep->com.qp = get_qhp(dev, conn_param->qpn); in c4iw_connect()
3349 if (!ep->com.qp) { in c4iw_connect()
3356 ep->com.qp, cm_id); in c4iw_connect()
3371 memcpy(&ep->com.local_addr, &cm_id->m_local_addr, in c4iw_connect()
3372 sizeof(ep->com.local_addr)); in c4iw_connect()
3373 memcpy(&ep->com.remote_addr, &cm_id->m_remote_addr, in c4iw_connect()
3374 sizeof(ep->com.remote_addr)); in c4iw_connect()
3376 laddr = (struct sockaddr_in *)&ep->com.local_addr; in c4iw_connect()
3377 raddr = (struct sockaddr_in *)&ep->com.remote_addr; in c4iw_connect()
3378 laddr6 = (struct sockaddr_in6 *)&ep->com.local_addr; in c4iw_connect()
3379 raddr6 = (struct sockaddr_in6 *) &ep->com.remote_addr; in c4iw_connect()
3434 err = import_ep(ep, iptype, ra, ep->dst, ep->com.dev, true, in c4iw_connect()
3435 ep->com.dev->rdev.lldi.adapter_type, cm_id->tos); in c4iw_connect()
3445 state_set(&ep->com, CONNECTING); in c4iw_connect()
3457 xa_erase_irq(&ep->com.dev->atids, ep->atid); in c4iw_connect()
3459 cxgb4_free_atid(ep->com.dev->rdev.lldi.tids, ep->atid); in c4iw_connect()
3461 skb_queue_purge(&ep->com.ep_skb_list); in c4iw_connect()
3462 deref_cm_id(&ep->com); in c4iw_connect()
3464 c4iw_put_ep(&ep->com); in c4iw_connect()
3473 &ep->com.local_addr; in create_server6()
3476 err = cxgb4_clip_get(ep->com.dev->rdev.lldi.ports[0], in create_server6()
3481 c4iw_init_wr_wait(ep->com.wr_waitp); in create_server6()
3482 err = cxgb4_create_server6(ep->com.dev->rdev.lldi.ports[0], in create_server6()
3485 ep->com.dev->rdev.lldi.rxq_ids[0]); in create_server6()
3487 err = c4iw_wait_for_reply(&ep->com.dev->rdev, in create_server6()
3488 ep->com.wr_waitp, in create_server6()
3493 cxgb4_clip_release(ep->com.dev->rdev.lldi.ports[0], in create_server6()
3506 &ep->com.local_addr; in create_server4()
3511 ep->com.dev->rdev.lldi.ports[0], ep->stid, in create_server4()
3513 ep->com.dev->rdev.lldi.rxq_ids[0], 0, 0); in create_server4()
3515 if (c4iw_fatal_error(&ep->com.dev->rdev)) { in create_server4()
3524 c4iw_init_wr_wait(ep->com.wr_waitp); in create_server4()
3525 err = cxgb4_create_server(ep->com.dev->rdev.lldi.ports[0], in create_server4()
3527 0, ep->com.dev->rdev.lldi.rxq_ids[0]); in create_server4()
3529 err = c4iw_wait_for_reply(&ep->com.dev->rdev, in create_server4()
3530 ep->com.wr_waitp, in create_server4()
3556 skb_queue_head_init(&ep->com.ep_skb_list); in c4iw_create_listen()
3558 ep->com.cm_id = cm_id; in c4iw_create_listen()
3559 ref_cm_id(&ep->com); in c4iw_create_listen()
3560 ep->com.dev = dev; in c4iw_create_listen()
3562 memcpy(&ep->com.local_addr, &cm_id->m_local_addr, in c4iw_create_listen()
3563 sizeof(ep->com.local_addr)); in c4iw_create_listen()
3569 ep->com.local_addr.ss_family == AF_INET) in c4iw_create_listen()
3585 state_set(&ep->com, LISTEN); in c4iw_create_listen()
3586 if (ep->com.local_addr.ss_family == AF_INET) in c4iw_create_listen()
3594 xa_erase_irq(&ep->com.dev->stids, ep->stid); in c4iw_create_listen()
3596 cxgb4_free_stid(ep->com.dev->rdev.lldi.tids, ep->stid, in c4iw_create_listen()
3597 ep->com.local_addr.ss_family); in c4iw_create_listen()
3599 deref_cm_id(&ep->com); in c4iw_create_listen()
3600 c4iw_put_ep(&ep->com); in c4iw_create_listen()
3614 state_set(&ep->com, DEAD); in c4iw_destroy_listen()
3615 if (ep->com.dev->rdev.lldi.enable_fw_ofld_conn && in c4iw_destroy_listen()
3616 ep->com.local_addr.ss_family == AF_INET) { in c4iw_destroy_listen()
3618 ep->com.dev->rdev.lldi.ports[0], ep->stid, in c4iw_destroy_listen()
3619 ep->com.dev->rdev.lldi.rxq_ids[0], false); in c4iw_destroy_listen()
3622 c4iw_init_wr_wait(ep->com.wr_waitp); in c4iw_destroy_listen()
3624 ep->com.dev->rdev.lldi.ports[0], ep->stid, in c4iw_destroy_listen()
3625 ep->com.dev->rdev.lldi.rxq_ids[0], in c4iw_destroy_listen()
3626 ep->com.local_addr.ss_family == AF_INET6); in c4iw_destroy_listen()
3629 err = c4iw_wait_for_reply(&ep->com.dev->rdev, ep->com.wr_waitp, in c4iw_destroy_listen()
3631 sin6 = (struct sockaddr_in6 *)&ep->com.local_addr; in c4iw_destroy_listen()
3632 cxgb4_clip_release(ep->com.dev->rdev.lldi.ports[0], in c4iw_destroy_listen()
3635 xa_erase_irq(&ep->com.dev->stids, ep->stid); in c4iw_destroy_listen()
3636 cxgb4_free_stid(ep->com.dev->rdev.lldi.tids, ep->stid, in c4iw_destroy_listen()
3637 ep->com.local_addr.ss_family); in c4iw_destroy_listen()
3639 deref_cm_id(&ep->com); in c4iw_destroy_listen()
3640 c4iw_put_ep(&ep->com); in c4iw_destroy_listen()
3651 mutex_lock(&ep->com.mutex); in c4iw_ep_disconnect()
3654 states[ep->com.state], abrupt); in c4iw_ep_disconnect()
3660 c4iw_get_ep(&ep->com); in c4iw_ep_disconnect()
3662 rdev = &ep->com.dev->rdev; in c4iw_ep_disconnect()
3666 ep->com.state = DEAD; in c4iw_ep_disconnect()
3668 switch (ep->com.state) { in c4iw_ep_disconnect()
3677 ep->com.state = ABORTING; in c4iw_ep_disconnect()
3679 ep->com.state = CLOSING; in c4iw_ep_disconnect()
3686 test_bit(STOP_MPA_TIMER, &ep->com.flags)) { in c4iw_ep_disconnect()
3687 clear_bit(STOP_MPA_TIMER, &ep->com.flags); in c4iw_ep_disconnect()
3692 set_bit(CLOSE_SENT, &ep->com.flags); in c4iw_ep_disconnect()
3695 if (!test_and_set_bit(CLOSE_SENT, &ep->com.flags)) { in c4iw_ep_disconnect()
3699 ep->com.state = ABORTING; in c4iw_ep_disconnect()
3701 ep->com.state = MORIBUND; in c4iw_ep_disconnect()
3708 ep, ep->com.state); in c4iw_ep_disconnect()
3711 WARN_ONCE(1, "Bad endpoint state %u\n", ep->com.state); in c4iw_ep_disconnect()
3717 set_bit(EP_DISC_ABORT, &ep->com.history); in c4iw_ep_disconnect()
3720 set_bit(EP_DISC_CLOSE, &ep->com.history); in c4iw_ep_disconnect()
3724 set_bit(EP_DISC_FAIL, &ep->com.history); in c4iw_ep_disconnect()
3729 if (ep->com.qp) { in c4iw_ep_disconnect()
3733 ret = c4iw_modify_qp(ep->com.qp->rhp, in c4iw_ep_disconnect()
3734 ep->com.qp, in c4iw_ep_disconnect()
3744 mutex_unlock(&ep->com.mutex); in c4iw_ep_disconnect()
3745 c4iw_put_ep(&ep->com); in c4iw_ep_disconnect()
3764 set_bit(ACT_RETRY_NOMEM, &ep->com.history); in active_ofld_conn_reply()
3771 set_bit(ACT_RETRY_INUSE, &ep->com.history); in active_ofld_conn_reply()
3788 state_set(&ep->com, DEAD); in active_ofld_conn_reply()
3789 if (ep->com.remote_addr.ss_family == AF_INET6) { in active_ofld_conn_reply()
3791 (struct sockaddr_in6 *)&ep->com.local_addr; in active_ofld_conn_reply()
3792 cxgb4_clip_release(ep->com.dev->rdev.lldi.ports[0], in active_ofld_conn_reply()
3799 c4iw_put_ep(&ep->com); in active_ofld_conn_reply()
3874 c4iw_put_ep(&ep->com); /* from get_ep_from_tid() */ in read_tcb_rpl()
3875 c4iw_put_ep(&ep->com); /* from read_tcb() */ in read_tcb_rpl()
3892 if (test_bit(PEER_ABORT_IN_PROGRESS, &ep->com.flags)) in read_tcb_rpl()
3894 else if (test_bit(ABORT_REQ_IN_PROGRESS, &ep->com.flags)) in read_tcb_rpl()
4203 c4iw_put_ep(&lep->com); in rx_pkt()
4238 mutex_lock(&ep->com.mutex); in process_timeout()
4239 pr_debug("ep %p tid %u state %d\n", ep, ep->hwtid, ep->com.state); in process_timeout()
4240 set_bit(TIMEDOUT, &ep->com.history); in process_timeout()
4241 switch (ep->com.state) { in process_timeout()
4252 if (ep->com.cm_id && ep->com.qp) { in process_timeout()
4254 c4iw_modify_qp(ep->com.qp->rhp, in process_timeout()
4255 ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, in process_timeout()
4272 __func__, ep, ep->hwtid, ep->com.state); in process_timeout()
4275 mutex_unlock(&ep->com.mutex); in process_timeout()
4278 c4iw_put_ep(&ep->com); in process_timeout()
4336 if (!test_and_set_bit(TIMEOUT, &ep->com.flags)) { in ep_timeout()
4430 pr_debug("ep %p tid %u state %u\n", ep, ep->hwtid, ep->com.state); in peer_abort_intr()
4432 c4iw_wake_up_noref(ep->com.wr_waitp, -ECONNRESET); in peer_abort_intr()