32 #include <linux/module.h>
33 #include <linux/list.h>
40 #include <linux/tcp.h>
48 static char *states[] = {
64 static int dack_mode = 1;
72 static int enable_tcp_timestamps;
74 MODULE_PARM_DESC(enable_tcp_timestamps,
"Enable tcp timestamps (default=0)");
76 static int enable_tcp_sack;
80 static int enable_tcp_window_scaling = 1;
83 "Enable tcp window scaling (default=1)");
96 "1=RDMA_READ 0=RDMA_WRITE (default 1)");
98 static int ep_timeout_secs = 60;
101 "in seconds (default=60)");
103 static int mpa_rev = 1;
106 "1 is RFC0544 spec compliant, 2 is IETF MPA Peer Connect Draft"
107 " compliant (default=1)");
109 static int markers_enabled;
111 MODULE_PARM_DESC(markers_enabled,
"Enable MPA MARKERS (default(0)=disabled)");
113 static int crc_enabled = 1;
117 static int rcv_win = 256 * 1024;
121 static int snd_win = 128 * 1024;
130 static void ep_timeout(
unsigned long arg);
131 static void connect_reply_upcall(
struct c4iw_ep *ep,
int status);
136 static void start_ep_timer(
struct c4iw_ep *ep)
138 PDBG(
"%s ep %p\n", __func__, ep);
139 if (timer_pending(&ep->
timer)) {
140 PDBG(
"%s stopped / restarted timer ep %p\n", __func__, ep);
146 ep->
timer.function = ep_timeout;
150 static void stop_ep_timer(
struct c4iw_ep *ep)
152 PDBG(
"%s ep %p\n", __func__, ep);
153 if (!timer_pending(&ep->
timer)) {
155 "ep %p state %u\n", __func__, ep, ep->
com.state);
168 if (c4iw_fatal_error(rdev)) {
170 PDBG(
"%s - device in error state - dropping\n", __func__);
176 return error < 0 ? error : 0;
183 if (c4iw_fatal_error(rdev)) {
185 PDBG(
"%s - device in error state - dropping\n", __func__);
191 return error < 0 ? error : 0;
239 PDBG(
"%s - %s -> %s\n", __func__, states[epc->
state], states[
new]);
240 __state_set(epc,
new);
245 static void *alloc_ep(
int size,
gfp_t gfp)
249 epc = kzalloc(size, gfp);
251 kref_init(&epc->
kref);
253 c4iw_init_wr_wait(&epc->
wr_wait);
255 PDBG(
"%s alloc ep %p\n", __func__, epc);
273 static void release_ep_resources(
struct c4iw_ep *ep)
279 static int status2errno(
int status)
304 if (skb && !skb_is_nonlinear(skb) && !skb_cloned(skb)) {
307 skb_reset_transport_header(skb);
309 skb = alloc_skb(len, gfp);
321 rt = ip_route_output_ports(&
init_net, &fl4,
NULL, peer_ip, local_ip,
329 static void arp_failure_discard(
void *
handle,
struct sk_buff *skb)
331 PDBG(
"%s c4iw_dev %p\n", __func__, handle);
338 static void act_open_req_arp_failure(
void *
handle,
struct sk_buff *skb)
348 static void abort_arp_failure(
void *
handle,
struct sk_buff *skb)
353 PDBG(
"%s rdev %p\n", __func__, rdev);
360 unsigned int flowclen = 80;
365 flowc = (
struct fw_flowc_wr *)__skb_put(skb, flowclen);
389 flowc->
mnemval[8].mnemonic = 0;
391 for (i = 0; i < 9; i++) {
401 static int send_halfclose(
struct c4iw_ep *ep,
gfp_t gfp)
405 int wrlen =
roundup(
sizeof *req, 16);
407 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
408 skb = get_skb(
NULL, wrlen, gfp);
414 t4_set_arp_err_handler(skb,
NULL, arp_failure_discard);
420 return c4iw_l2t_send(&ep->
com.dev->rdev, skb, ep->
l2t);
426 int wrlen =
roundup(
sizeof *req, 16);
428 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
429 skb = get_skb(skb, wrlen, gfp);
436 t4_set_arp_err_handler(skb, &ep->
com.dev->rdev, abort_arp_failure);
442 return c4iw_l2t_send(&ep->
com.dev->rdev, skb, ep->
l2t);
445 static int send_connect(
struct c4iw_ep *ep)
451 unsigned int mtu_idx;
453 int wrlen =
roundup(
sizeof *req, 16);
455 PDBG(
"%s ep %p atid %u\n", __func__, ep, ep->
atid);
466 wscale = compute_wscale(rcv_win);
479 if (enable_tcp_timestamps)
483 if (wscale && enable_tcp_window_scaling)
485 t4_set_arp_err_handler(skb,
NULL, act_open_req_arp_failure);
493 req->
local_ip = ep->
com.local_addr.sin_addr.s_addr;
494 req->
peer_ip = ep->
com.remote_addr.sin_addr.s_addr;
498 return c4iw_l2t_send(&ep->
com.dev->rdev, skb, ep->
l2t);
509 PDBG(
"%s ep %p tid %u pd_len %d\n", __func__, ep, ep->
hwtid, ep->
plen);
513 mpalen =
sizeof(*mpa) + ep->
plen;
514 if (mpa_rev_to_use == 2)
516 wrlen =
roundup(mpalen +
sizeof *req, 16);
519 connect_reply_upcall(ep, -
ENOMEM);
545 if (mpa_rev_to_use == 1) {
550 if (mpa_rev_to_use == 2) {
583 t4_set_arp_err_handler(skb,
NULL, arp_failure_discard);
586 c4iw_l2t_send(&ep->
com.dev->rdev, skb, ep->
l2t);
601 PDBG(
"%s ep %p tid %u pd_len %d\n", __func__, ep, ep->
hwtid, ep->
plen);
603 mpalen =
sizeof(*mpa) +
plen;
606 wrlen =
roundup(mpalen +
sizeof *req, 16);
630 memset(mpa, 0,
sizeof(*mpa));
666 t4_set_arp_err_handler(skb,
NULL, arp_failure_discard);
669 return c4iw_l2t_send(&ep->
com.dev->rdev, skb, ep->
l2t);
672 static int send_mpa_reply(
struct c4iw_ep *ep,
const void *pdata,
u8 plen)
680 PDBG(
"%s ep %p tid %u pd_len %d\n", __func__, ep, ep->
hwtid, ep->
plen);
682 mpalen =
sizeof(*mpa) +
plen;
685 wrlen =
roundup(mpalen +
sizeof *req, 16);
709 memset(mpa, 0,
sizeof(*mpa));
712 (markers_enabled ? MPA_MARKERS : 0);
750 t4_set_arp_err_handler(skb,
NULL, arp_failure_discard);
753 return c4iw_l2t_send(&ep->
com.dev->rdev, skb, ep->
l2t);
764 ep = lookup_atid(t, atid);
766 PDBG(
"%s ep %p tid %u snd_isn %u rcv_isn %u\n", __func__, ep, tid,
769 dst_confirm(ep->
dst);
773 cxgb4_insert_tid(t, ep, tid);
784 send_flowc(ep,
NULL);
786 send_mpa_req(ep, skb, 1);
788 send_mpa_req(ep, skb, mpa_rev);
793 static void close_complete_upcall(
struct c4iw_ep *ep)
797 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
801 PDBG(
"close complete delivered ep %p cm_id %p tid %u\n",
803 ep->
com.cm_id->event_handler(ep->
com.cm_id, &
event);
804 ep->
com.cm_id->rem_ref(ep->
com.cm_id);
812 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
813 close_complete_upcall(ep);
815 return send_abort(ep, skb, gfp);
818 static void peer_close_upcall(
struct c4iw_ep *ep)
822 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
826 PDBG(
"peer close delivered ep %p cm_id %p tid %u\n",
828 ep->
com.cm_id->event_handler(ep->
com.cm_id, &
event);
832 static void peer_abort_upcall(
struct c4iw_ep *ep)
836 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
841 PDBG(
"abort delivered ep %p cm_id %p tid %u\n", ep,
843 ep->
com.cm_id->event_handler(ep->
com.cm_id, &
event);
844 ep->
com.cm_id->rem_ref(ep->
com.cm_id);
850 static void connect_reply_upcall(
struct c4iw_ep *ep,
int status)
854 PDBG(
"%s ep %p tid %u status %d\n", __func__, ep, ep->
hwtid, status);
858 event.local_addr = ep->
com.local_addr;
859 event.remote_addr = ep->
com.remote_addr;
864 event.private_data_len = ep->
plen -
866 event.private_data = ep->
mpa_pkt +
871 event.private_data_len = ep->
plen;
872 event.private_data = ep->
mpa_pkt +
877 PDBG(
"%s ep %p tid %u status %d\n", __func__, ep,
879 ep->
com.cm_id->event_handler(ep->
com.cm_id, &
event);
882 ep->
com.cm_id->rem_ref(ep->
com.cm_id);
888 static void connect_request_upcall(
struct c4iw_ep *ep)
892 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
895 event.local_addr = ep->
com.local_addr;
896 event.remote_addr = ep->
com.remote_addr;
897 event.provider_data = ep;
902 event.private_data_len = ep->
plen -
910 event.private_data_len = ep->
plen;
923 static void established_upcall(
struct c4iw_ep *ep)
927 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
933 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
934 ep->
com.cm_id->event_handler(ep->
com.cm_id, &
event);
938 static int update_rx_credits(
struct c4iw_ep *ep,
u32 credits)
942 int wrlen =
roundup(
sizeof *req, 16);
944 PDBG(
"%s ep %p tid %u credits %u\n", __func__, ep, ep->
hwtid, credits);
964 static void process_mpa_reply(
struct c4iw_ep *ep,
struct sk_buff *skb)
969 u16 resp_ird, resp_ord;
970 u8 rtr_mismatch = 0, insuff_ird = 0;
975 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
1012 " Received = %d\n", __func__, mpa_rev, mpa->
revision);
1060 ep->
mpa_attr.recv_marker_enabled = markers_enabled;
1061 ep->
mpa_attr.xmit_marker_enabled = mpa->
flags & MPA_MARKERS ? 1 : 0;
1068 if (ep->
mpa_attr.enhanced_rdma_conn) {
1071 resp_ird =
ntohs(mpa_v2_params->
ird) &
1073 resp_ord =
ntohs(mpa_v2_params->
ord) &
1081 if ((ep->
ird < resp_ord) || (ep->
ord > resp_ird)) {
1094 else if (
ntohs(mpa_v2_params->
ord) &
1104 PDBG(
"%s - crc_enabled=%d, recv_marker_enabled=%d, "
1105 "xmit_marker_enabled=%d, version=%d p2p_type=%d local-p2p_type = "
1106 "%d\n", __func__, ep->
mpa_attr.crc_enabled,
1118 (ep->
mpa_attr.p2p_type != p2p_type)) {
1124 attrs.max_ird = ep->
ird;
1125 attrs.max_ord = ep->
ord;
1126 attrs.llp_stream_handle = ep;
1135 ep->
com.qp, mask, &attrs, 1);
1176 connect_reply_upcall(ep, err);
1180 static void process_mpa_request(
struct c4iw_ep *ep,
struct sk_buff *skb)
1186 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
1201 PDBG(
"%s enter (%s line %u)\n", __func__, __FILE__, __LINE__);
1217 PDBG(
"%s enter (%s line %u)\n", __func__, __FILE__, __LINE__);
1226 " Received = %d\n", __func__, mpa_rev, mpa->
revision);
1267 ep->
mpa_attr.recv_marker_enabled = markers_enabled;
1268 ep->
mpa_attr.xmit_marker_enabled = mpa->
flags & MPA_MARKERS ? 1 : 0;
1277 if (ep->
mpa_attr.enhanced_rdma_conn) {
1290 else if (
ntohs(mpa_v2_params->
ord) &
1300 PDBG(
"%s - crc_enabled=%d, recv_marker_enabled=%d, "
1301 "xmit_marker_enabled=%d, version=%d p2p_type=%d\n", __func__,
1309 connect_request_upcall(ep);
1318 unsigned int tid =
GET_TID(hdr);
1321 ep = lookup_tid(t, tid);
1322 PDBG(
"%s ep %p tid %u dlen %u\n", __func__, ep, ep->
hwtid, dlen);
1330 update_rx_credits(ep, dlen);
1334 process_mpa_reply(ep, skb);
1337 process_mpa_request(ep, skb);
1343 " ep %p state %d tid %u\n",
1360 unsigned int tid =
GET_TID(rpl);
1363 ep = lookup_tid(t, tid);
1368 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
1370 switch (ep->
com.state) {
1377 __func__, ep, ep->
com.state);
1383 release_ep_resources(ep);
1390 static inline int act_open_has_tid(
int status)
1405 ep = lookup_atid(t, atid);
1407 PDBG(
"%s ep %p atid %u status %u errno %d\n", __func__, ep, atid,
1408 status, status2errno(status));
1425 "atid %u status %u errno %d %pI4:%u->%pI4:%u\n",
1426 atid, status, status2errno(status),
1427 &ep->
com.local_addr.sin_addr.s_addr,
1428 ntohs(ep->
com.local_addr.sin_port),
1429 &ep->
com.remote_addr.sin_addr.s_addr,
1430 ntohs(ep->
com.remote_addr.sin_port));
1434 connect_reply_upcall(ep, status2errno(status));
1437 if (status && act_open_has_tid(status))
1452 unsigned int stid =
GET_TID(rpl);
1459 PDBG(
"%s ep %p status %d error %d\n", __func__, ep,
1461 c4iw_wake_up(&ep->
com.wr_wait, status2errno(rpl->
status));
1471 PDBG(
"%s ep %p\n", __func__, ep);
1487 static int close_listsrv_rpl(
struct c4iw_dev *dev,
struct sk_buff *skb)
1491 unsigned int stid =
GET_TID(rpl);
1494 PDBG(
"%s ep %p\n", __func__, ep);
1495 c4iw_wake_up(&ep->
com.wr_wait, status2errno(rpl->
status));
1503 unsigned int mtu_idx;
1508 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
1513 wscale = compute_wscale(rcv_win);
1527 if (enable_tcp_timestamps && req->
tcpopt.tstamp)
1529 if (enable_tcp_sack && req->
tcpopt.sack)
1531 if (wscale && enable_tcp_window_scaling)
1541 c4iw_l2t_send(&ep->
com.dev->rdev, skb, ep->
l2t);
1549 PDBG(
"%s c4iw_dev %p tid %u peer_ip %x\n", __func__, dev, hwtid,
1554 release_tid(&dev->
rdev, hwtid, skb);
1566 ((
u8 *)(req + 1) + eth_len + ip_len);
1568 PDBG(
"%s saddr 0x%x daddr 0x%x sport %u dport %u\n", __func__,
1572 *peer_ip = ip->
saddr;
1573 *local_ip = ip->
daddr;
1574 *peer_port = tcp->
source;
1575 *local_port = tcp->
dest;
1586 n = dst_neigh_lookup(dst, &peer_ip);
1595 pdev = ip_dev_find(&
init_net, peer_ip);
1607 step = cdev->
rdev.lldi.ntxq /
1608 cdev->
rdev.lldi.nchan;
1610 step = cdev->
rdev.lldi.nrxq /
1611 cdev->
rdev.lldi.nchan;
1621 ep->
mtu = dst_mtu(dst);
1624 step = cdev->
rdev.lldi.ntxq /
1625 cdev->
rdev.lldi.nchan;
1628 step = cdev->
rdev.lldi.nrxq /
1629 cdev->
rdev.lldi.nchan;
1653 unsigned int hwtid =
GET_TID(req);
1656 __be32 local_ip, peer_ip;
1660 parent_ep = lookup_stid(t, stid);
1661 PDBG(
"%s parent ep %p tid %u\n", __func__, parent_ep, hwtid);
1663 get_4tuple(req, &local_ip, &peer_ip, &local_port, &peer_port);
1672 rt = find_route(dev, local_ip, peer_ip, local_port, peer_port,
1681 child_ep = alloc_ep(
sizeof(*child_ep),
GFP_KERNEL);
1689 err = import_ep(child_ep, peer_ip, dst, dev,
false);
1701 child_ep->
com.local_addr.sin_family =
PF_INET;
1703 child_ep->
com.local_addr.sin_addr.s_addr = local_ip;
1704 child_ep->
com.remote_addr.sin_family =
PF_INET;
1706 child_ep->
com.remote_addr.sin_addr.s_addr = peer_ip;
1711 child_ep->
hwtid = hwtid;
1713 PDBG(
"%s tx_chan %u smac_idx %u rss_qid %u\n", __func__,
1717 cxgb4_insert_tid(t, child_ep, hwtid);
1718 accept_cr(child_ep, peer_ip, skb, req);
1721 reject_cr(dev, hwtid, peer_ip, skb);
1731 unsigned int tid =
GET_TID(req);
1733 ep = lookup_tid(t, tid);
1734 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
1740 dst_confirm(ep->
dst);
1743 send_flowc(ep, skb);
1756 unsigned int tid =
GET_TID(hdr);
1759 ep = lookup_tid(t, tid);
1760 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
1761 dst_confirm(ep->
dst);
1764 switch (ep->
com.state) {
1781 PDBG(
"waking up ep %p tid %u\n", ep, ep->
hwtid);
1786 PDBG(
"waking up ep %p tid %u\n", ep, ep->
hwtid);
1796 peer_close_upcall(ep);
1809 if (ep->
com.cm_id && ep->
com.qp) {
1814 close_complete_upcall(ep);
1829 release_ep_resources(ep);
1836 static int is_neg_adv_abort(
unsigned int status)
1842 static int c4iw_reconnect(
struct c4iw_ep *ep)
1847 PDBG(
"%s qp %p cm_id %p\n", __func__, ep->
com.qp, ep->
com.cm_id);
1854 if (ep->
atid == -1) {
1861 rt = find_route(ep->
com.dev,
1862 ep->
com.cm_id->local_addr.sin_addr.s_addr,
1863 ep->
com.cm_id->remote_addr.sin_addr.s_addr,
1864 ep->
com.cm_id->local_addr.sin_port,
1865 ep->
com.cm_id->remote_addr.sin_port, 0);
1873 err = import_ep(ep, ep->
com.cm_id->remote_addr.sin_addr.s_addr,
1874 ep->
dst, ep->
com.dev,
false);
1880 PDBG(
"%s txq_idx %u tx_chan %u smac_idx %u rss_qid %u l2t_idx %u\n",
1888 err = send_connect(ep);
1920 unsigned int tid =
GET_TID(req);
1922 ep = lookup_tid(t, tid);
1923 if (is_neg_adv_abort(req->
status)) {
1924 PDBG(
"%s neg_adv_abort ep %p tid %u\n", __func__, ep,
1928 PDBG(
"%s ep %p tid %u state %u\n", __func__, ep, ep->
hwtid,
1940 switch (ep->
com.state) {
1959 PDBG(
"%s: mpa_rev=%d. Retrying with mpav1\n", __func__,
1973 if (ep->
com.cm_id && ep->
com.qp) {
1980 "%s - qp <- error failed!\n",
1983 peer_abort_upcall(ep);
1988 PDBG(
"%s PEER_ABORT IN DEAD STATE!!!!\n", __func__);
1995 dst_confirm(ep->
dst);
2004 rpl_skb = get_skb(skb,
sizeof(*rpl),
GFP_KERNEL);
2019 release_ep_resources(ep);
2039 unsigned int tid =
GET_TID(rpl);
2041 ep = lookup_tid(t, tid);
2043 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
2048 switch (ep->
com.state) {
2054 if ((ep->
com.cm_id) && (ep->
com.qp)) {
2061 close_complete_upcall(ep);
2074 release_ep_resources(ep);
2082 unsigned int tid =
GET_TID(rpl);
2086 ep = lookup_tid(t, tid);
2089 if (ep && ep->com.qp) {
2091 ep->com.qp->wq.sq.qid);
2111 unsigned int tid =
GET_TID(hdr);
2115 ep = lookup_tid(t, tid);
2116 PDBG(
"%s ep %p tid %u credits %u\n", __func__, ep, ep->
hwtid, credits);
2118 PDBG(
"%s 0 credit ack ep %p tid %u state %u\n",
2123 dst_confirm(ep->
dst);
2125 PDBG(
"%s last streaming msg ack ep %p tid %u state %u "
2126 "initiator %u freeing skb\n", __func__, ep, ep->
hwtid,
2137 struct c4iw_ep *ep = to_ep(cm_id);
2138 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
2148 err = send_mpa_reject(ep, pdata, pdata_len);
2160 struct c4iw_ep *ep = to_ep(cm_id);
2162 struct c4iw_qp *qp = get_qhp(h, conn_param->
qpn);
2164 PDBG(
"%s ep %p tid %u\n", __func__, ep, ep->
hwtid);
2181 if (conn_param->
ord > ep->
ird) {
2182 ep->
ird = conn_param->
ird;
2183 ep->
ord = conn_param->
ord;
2190 if (conn_param->
ird > ep->
ord) {
2192 conn_param->
ird = 1;
2201 ep->
ird = conn_param->
ird;
2202 ep->
ord = conn_param->
ord;
2208 PDBG(
"%s %d ird %d ord %d\n", __func__, __LINE__, ep->
ird, ep->
ord);
2211 ep->
com.cm_id = cm_id;
2229 ep->
com.qp, mask, &attrs, 1);
2238 established_upcall(ep);
2273 ep->
ird = conn_param->
ird;
2274 ep->
ord = conn_param->
ord;
2281 ep->
com.cm_id = cm_id;
2282 ep->
com.qp = get_qhp(dev, conn_param->
qpn);
2284 PDBG(
"%s qpn 0x%x qp %p cm_id %p\n", __func__, conn_param->
qpn,
2291 if (ep->
atid == -1) {
2297 PDBG(
"%s saddr 0x%x sport 0x%x raddr 0x%x rport 0x%x\n", __func__,
2304 rt = find_route(dev,
2316 err = import_ep(ep, cm_id->
remote_addr.sin_addr.s_addr,
2317 ep->
dst, ep->
com.dev,
true);
2323 PDBG(
"%s txq_idx %u tx_chan %u smac_idx %u rss_qid %u l2t_idx %u\n",
2333 err = send_connect(ep);
2364 PDBG(
"%s ep %p\n", __func__, ep);
2366 ep->
com.cm_id = cm_id;
2375 if (ep->
stid == -1) {
2382 c4iw_init_wr_wait(&ep->
com.wr_wait);
2384 ep->
com.local_addr.sin_addr.s_addr,
2385 ep->
com.local_addr.sin_port,
2386 ep->
com.dev->rdev.lldi.rxq_ids[0]);
2391 err = c4iw_wait_for_reply(&ep->
com.dev->rdev, &ep->
com.wr_wait, 0, 0,
2412 PDBG(
"%s ep %p\n", __func__, ep);
2416 c4iw_init_wr_wait(&ep->
com.wr_wait);
2417 err = listen_stop(ep);
2420 err = c4iw_wait_for_reply(&ep->
com.dev->rdev, &ep->
com.wr_wait, 0, 0,
2438 PDBG(
"%s ep %p state %s, abrupt %d\n", __func__, ep,
2439 states[ep->
com.state], abrupt);
2441 rdev = &ep->
com.dev->rdev;
2442 if (c4iw_fatal_error(rdev)) {
2444 close_complete_upcall(ep);
2447 switch (ep->
com.state) {
2475 PDBG(
"%s ignoring disconnect ep %p state %u\n",
2476 __func__, ep, ep->
com.state);
2485 close_complete_upcall(ep);
2486 ret = send_abort(ep,
NULL, gfp);
2488 ret = send_halfclose(ep, gfp);
2494 release_ep_resources(ep);
2527 static void process_timeout(
struct c4iw_ep *ep)
2533 PDBG(
"%s ep %p tid %u state %d\n", __func__, ep, ep->
hwtid,
2535 switch (ep->
com.state) {
2545 if (ep->
com.cm_id && ep->
com.qp) {
2555 __func__, ep, ep->
hwtid, ep->
com.state);
2565 static void process_timedout_eps(
void)
2569 spin_lock_irq(&timeout_lock);
2570 while (!list_empty(&timeout_list)) {
2573 tmp = timeout_list.
next;
2575 spin_unlock_irq(&timeout_lock);
2577 process_timeout(ep);
2578 spin_lock_irq(&timeout_lock);
2580 spin_unlock_irq(&timeout_lock);
2593 dev = *((
struct c4iw_dev **) (skb->cb +
sizeof(
void *)));
2596 BUG_ON(!work_handlers[opcode]);
2601 process_timedout_eps();
2606 static void ep_timeout(
unsigned long arg)
2610 spin_lock(&timeout_lock);
2612 spin_unlock(&timeout_lock);
2625 *((
struct c4iw_dev **) (skb->cb +
sizeof(
void *))) =
dev;
2653 PDBG(
"%s type %u\n", __func__, rpl->
type);
2655 switch (rpl->
type) {
2659 PDBG(
"%s wr_waitp %p ret %u\n", __func__, wr_waitp, ret);
2661 c4iw_wake_up(wr_waitp, ret ? -ret : 0);
2681 unsigned int tid =
GET_TID(req);
2683 ep = lookup_tid(t, tid);
2686 "Abort on non-existent endpoint, tid %d\n", tid);
2690 if (is_neg_adv_abort(req->
status)) {
2691 PDBG(
"%s neg_adv_abort ep %p tid %u\n", __func__, ep,
2696 PDBG(
"%s ep %p tid %u state %u\n", __func__, ep, ep->
hwtid,
2733 skb_queue_head_init(&rxq);
2744 WARN_ON(!list_empty(&timeout_list));