diff options
Diffstat (limited to 'drivers/infiniband/hw/cxgb3/iwch_cm.c')
-rw-r--r-- | drivers/infiniband/hw/cxgb3/iwch_cm.c | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c index 13c88871dc3b..0a5008fbebac 100644 --- a/drivers/infiniband/hw/cxgb3/iwch_cm.c +++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c | |||
@@ -338,23 +338,12 @@ static struct rtable *find_route(struct t3cdev *dev, __be32 local_ip, | |||
338 | __be16 peer_port, u8 tos) | 338 | __be16 peer_port, u8 tos) |
339 | { | 339 | { |
340 | struct rtable *rt; | 340 | struct rtable *rt; |
341 | struct flowi fl = { | 341 | struct flowi4 fl4; |
342 | .oif = 0, | 342 | |
343 | .nl_u = { | 343 | rt = ip_route_output_ports(&init_net, &fl4, NULL, peer_ip, local_ip, |
344 | .ip4_u = { | 344 | peer_port, local_port, IPPROTO_TCP, |
345 | .daddr = peer_ip, | 345 | tos, 0); |
346 | .saddr = local_ip, | 346 | if (IS_ERR(rt)) |
347 | .tos = tos} | ||
348 | }, | ||
349 | .proto = IPPROTO_TCP, | ||
350 | .uli_u = { | ||
351 | .ports = { | ||
352 | .sport = local_port, | ||
353 | .dport = peer_port} | ||
354 | } | ||
355 | }; | ||
356 | |||
357 | if (ip_route_output_flow(&init_net, &rt, &fl, NULL, 0)) | ||
358 | return NULL; | 347 | return NULL; |
359 | return rt; | 348 | return rt; |
360 | } | 349 | } |
@@ -925,7 +914,7 @@ static void process_mpa_reply(struct iwch_ep *ep, struct sk_buff *skb) | |||
925 | goto err; | 914 | goto err; |
926 | 915 | ||
927 | if (peer2peer && iwch_rqes_posted(ep->com.qp) == 0) { | 916 | if (peer2peer && iwch_rqes_posted(ep->com.qp) == 0) { |
928 | iwch_post_zb_read(ep->com.qp); | 917 | iwch_post_zb_read(ep); |
929 | } | 918 | } |
930 | 919 | ||
931 | goto out; | 920 | goto out; |
@@ -1089,37 +1078,45 @@ static int tx_ack(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) | |||
1089 | struct iwch_ep *ep = ctx; | 1078 | struct iwch_ep *ep = ctx; |
1090 | struct cpl_wr_ack *hdr = cplhdr(skb); | 1079 | struct cpl_wr_ack *hdr = cplhdr(skb); |
1091 | unsigned int credits = ntohs(hdr->credits); | 1080 | unsigned int credits = ntohs(hdr->credits); |
1081 | unsigned long flags; | ||
1082 | int post_zb = 0; | ||
1092 | 1083 | ||
1093 | PDBG("%s ep %p credits %u\n", __func__, ep, credits); | 1084 | PDBG("%s ep %p credits %u\n", __func__, ep, credits); |
1094 | 1085 | ||
1095 | if (credits == 0) { | 1086 | if (credits == 0) { |
1096 | PDBG(KERN_ERR "%s 0 credit ack ep %p state %u\n", | 1087 | PDBG("%s 0 credit ack ep %p state %u\n", |
1097 | __func__, ep, state_read(&ep->com)); | 1088 | __func__, ep, state_read(&ep->com)); |
1098 | return CPL_RET_BUF_DONE; | 1089 | return CPL_RET_BUF_DONE; |
1099 | } | 1090 | } |
1100 | 1091 | ||
1092 | spin_lock_irqsave(&ep->com.lock, flags); | ||
1101 | BUG_ON(credits != 1); | 1093 | BUG_ON(credits != 1); |
1102 | dst_confirm(ep->dst); | 1094 | dst_confirm(ep->dst); |
1103 | if (!ep->mpa_skb) { | 1095 | if (!ep->mpa_skb) { |
1104 | PDBG("%s rdma_init wr_ack ep %p state %u\n", | 1096 | PDBG("%s rdma_init wr_ack ep %p state %u\n", |
1105 | __func__, ep, state_read(&ep->com)); | 1097 | __func__, ep, ep->com.state); |
1106 | if (ep->mpa_attr.initiator) { | 1098 | if (ep->mpa_attr.initiator) { |
1107 | PDBG("%s initiator ep %p state %u\n", | 1099 | PDBG("%s initiator ep %p state %u\n", |
1108 | __func__, ep, state_read(&ep->com)); | 1100 | __func__, ep, ep->com.state); |
1109 | if (peer2peer) | 1101 | if (peer2peer && ep->com.state == FPDU_MODE) |
1110 | iwch_post_zb_read(ep->com.qp); | 1102 | post_zb = 1; |
1111 | } else { | 1103 | } else { |
1112 | PDBG("%s responder ep %p state %u\n", | 1104 | PDBG("%s responder ep %p state %u\n", |
1113 | __func__, ep, state_read(&ep->com)); | 1105 | __func__, ep, ep->com.state); |
1114 | ep->com.rpl_done = 1; | 1106 | if (ep->com.state == MPA_REQ_RCVD) { |
1115 | wake_up(&ep->com.waitq); | 1107 | ep->com.rpl_done = 1; |
1108 | wake_up(&ep->com.waitq); | ||
1109 | } | ||
1116 | } | 1110 | } |
1117 | } else { | 1111 | } else { |
1118 | PDBG("%s lsm ack ep %p state %u freeing skb\n", | 1112 | PDBG("%s lsm ack ep %p state %u freeing skb\n", |
1119 | __func__, ep, state_read(&ep->com)); | 1113 | __func__, ep, ep->com.state); |
1120 | kfree_skb(ep->mpa_skb); | 1114 | kfree_skb(ep->mpa_skb); |
1121 | ep->mpa_skb = NULL; | 1115 | ep->mpa_skb = NULL; |
1122 | } | 1116 | } |
1117 | spin_unlock_irqrestore(&ep->com.lock, flags); | ||
1118 | if (post_zb) | ||
1119 | iwch_post_zb_read(ep); | ||
1123 | return CPL_RET_BUF_DONE; | 1120 | return CPL_RET_BUF_DONE; |
1124 | } | 1121 | } |
1125 | 1122 | ||