diff options
Diffstat (limited to 'drivers/infiniband/hw/cxgb4/cm.c')
| -rw-r--r-- | drivers/infiniband/hw/cxgb4/cm.c | 87 |
1 files changed, 71 insertions, 16 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index 57176ddd4c50..3ad8dc798f52 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c | |||
| @@ -583,6 +583,22 @@ static void c4iw_record_pm_msg(struct c4iw_ep *ep, | |||
| 583 | sizeof(ep->com.mapped_remote_addr)); | 583 | sizeof(ep->com.mapped_remote_addr)); |
| 584 | } | 584 | } |
| 585 | 585 | ||
| 586 | static int get_remote_addr(struct c4iw_ep *parent_ep, struct c4iw_ep *child_ep) | ||
| 587 | { | ||
| 588 | int ret; | ||
| 589 | |||
| 590 | print_addr(&parent_ep->com, __func__, "get_remote_addr parent_ep "); | ||
| 591 | print_addr(&child_ep->com, __func__, "get_remote_addr child_ep "); | ||
| 592 | |||
| 593 | ret = iwpm_get_remote_info(&parent_ep->com.mapped_local_addr, | ||
| 594 | &child_ep->com.mapped_remote_addr, | ||
| 595 | &child_ep->com.remote_addr, RDMA_NL_C4IW); | ||
| 596 | if (ret) | ||
| 597 | PDBG("Unable to find remote peer addr info - err %d\n", ret); | ||
| 598 | |||
| 599 | return ret; | ||
| 600 | } | ||
| 601 | |||
| 586 | static void best_mtu(const unsigned short *mtus, unsigned short mtu, | 602 | static void best_mtu(const unsigned short *mtus, unsigned short mtu, |
| 587 | unsigned int *idx, int use_ts, int ipv6) | 603 | unsigned int *idx, int use_ts, int ipv6) |
| 588 | { | 604 | { |
| @@ -675,7 +691,7 @@ static int send_connect(struct c4iw_ep *ep) | |||
| 675 | if (is_t5(ep->com.dev->rdev.lldi.adapter_type)) { | 691 | if (is_t5(ep->com.dev->rdev.lldi.adapter_type)) { |
| 676 | opt2 |= T5_OPT_2_VALID_F; | 692 | opt2 |= T5_OPT_2_VALID_F; |
| 677 | opt2 |= CONG_CNTRL_V(CONG_ALG_TAHOE); | 693 | opt2 |= CONG_CNTRL_V(CONG_ALG_TAHOE); |
| 678 | opt2 |= CONG_CNTRL_VALID; /* OPT_2_ISS for T5 */ | 694 | opt2 |= T5_ISS_F; |
| 679 | } | 695 | } |
| 680 | t4_set_arp_err_handler(skb, ep, act_open_req_arp_failure); | 696 | t4_set_arp_err_handler(skb, ep, act_open_req_arp_failure); |
| 681 | 697 | ||
| @@ -2042,9 +2058,12 @@ static int act_open_rpl(struct c4iw_dev *dev, struct sk_buff *skb) | |||
| 2042 | status, status2errno(status)); | 2058 | status, status2errno(status)); |
| 2043 | 2059 | ||
| 2044 | if (is_neg_adv(status)) { | 2060 | if (is_neg_adv(status)) { |
| 2045 | dev_warn(&dev->rdev.lldi.pdev->dev, | 2061 | PDBG("%s Connection problems for atid %u status %u (%s)\n", |
| 2046 | "Connection problems for atid %u status %u (%s)\n", | 2062 | __func__, atid, status, neg_adv_str(status)); |
| 2047 | atid, status, neg_adv_str(status)); | 2063 | ep->stats.connect_neg_adv++; |
| 2064 | mutex_lock(&dev->rdev.stats.lock); | ||
| 2065 | dev->rdev.stats.neg_adv++; | ||
| 2066 | mutex_unlock(&dev->rdev.stats.lock); | ||
| 2048 | return 0; | 2067 | return 0; |
| 2049 | } | 2068 | } |
| 2050 | 2069 | ||
| @@ -2214,7 +2233,7 @@ static void accept_cr(struct c4iw_ep *ep, struct sk_buff *skb, | |||
| 2214 | u32 isn = (prandom_u32() & ~7UL) - 1; | 2233 | u32 isn = (prandom_u32() & ~7UL) - 1; |
| 2215 | opt2 |= T5_OPT_2_VALID_F; | 2234 | opt2 |= T5_OPT_2_VALID_F; |
| 2216 | opt2 |= CONG_CNTRL_V(CONG_ALG_TAHOE); | 2235 | opt2 |= CONG_CNTRL_V(CONG_ALG_TAHOE); |
| 2217 | opt2 |= CONG_CNTRL_VALID; /* OPT_2_ISS for T5 */ | 2236 | opt2 |= T5_ISS_F; |
| 2218 | rpl5 = (void *)rpl; | 2237 | rpl5 = (void *)rpl; |
| 2219 | memset(&rpl5->iss, 0, roundup(sizeof(*rpl5)-sizeof(*rpl), 16)); | 2238 | memset(&rpl5->iss, 0, roundup(sizeof(*rpl5)-sizeof(*rpl), 16)); |
| 2220 | if (peer2peer) | 2239 | if (peer2peer) |
| @@ -2352,27 +2371,57 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb) | |||
| 2352 | state_set(&child_ep->com, CONNECTING); | 2371 | state_set(&child_ep->com, CONNECTING); |
| 2353 | child_ep->com.dev = dev; | 2372 | child_ep->com.dev = dev; |
| 2354 | child_ep->com.cm_id = NULL; | 2373 | child_ep->com.cm_id = NULL; |
| 2374 | |||
| 2375 | /* | ||
| 2376 | * The mapped_local and mapped_remote addresses get setup with | ||
| 2377 | * the actual 4-tuple. The local address will be based on the | ||
| 2378 | * actual local address of the connection, but on the port number | ||
| 2379 | * of the parent listening endpoint. The remote address is | ||
| 2380 | * setup based on a query to the IWPM since we don't know what it | ||
| 2381 | * originally was before mapping. If no mapping was done, then | ||
| 2382 | * mapped_remote == remote, and mapped_local == local. | ||
| 2383 | */ | ||
| 2355 | if (iptype == 4) { | 2384 | if (iptype == 4) { |
| 2356 | struct sockaddr_in *sin = (struct sockaddr_in *) | 2385 | struct sockaddr_in *sin = (struct sockaddr_in *) |
| 2357 | &child_ep->com.local_addr; | 2386 | &child_ep->com.mapped_local_addr; |
| 2387 | |||
| 2358 | sin->sin_family = PF_INET; | 2388 | sin->sin_family = PF_INET; |
| 2359 | sin->sin_port = local_port; | 2389 | sin->sin_port = local_port; |
| 2360 | sin->sin_addr.s_addr = *(__be32 *)local_ip; | 2390 | sin->sin_addr.s_addr = *(__be32 *)local_ip; |
| 2361 | sin = (struct sockaddr_in *)&child_ep->com.remote_addr; | 2391 | |
| 2392 | sin = (struct sockaddr_in *)&child_ep->com.local_addr; | ||
| 2393 | sin->sin_family = PF_INET; | ||
| 2394 | sin->sin_port = ((struct sockaddr_in *) | ||
| 2395 | &parent_ep->com.local_addr)->sin_port; | ||
| 2396 | sin->sin_addr.s_addr = *(__be32 *)local_ip; | ||
| 2397 | |||
| 2398 | sin = (struct sockaddr_in *)&child_ep->com.mapped_remote_addr; | ||
| 2362 | sin->sin_family = PF_INET; | 2399 | sin->sin_family = PF_INET; |
| 2363 | sin->sin_port = peer_port; | 2400 | sin->sin_port = peer_port; |
| 2364 | sin->sin_addr.s_addr = *(__be32 *)peer_ip; | 2401 | sin->sin_addr.s_addr = *(__be32 *)peer_ip; |
| 2365 | } else { | 2402 | } else { |
| 2366 | struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) | 2403 | struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) |
| 2367 | &child_ep->com.local_addr; | 2404 | &child_ep->com.mapped_local_addr; |
| 2405 | |||
| 2368 | sin6->sin6_family = PF_INET6; | 2406 | sin6->sin6_family = PF_INET6; |
| 2369 | sin6->sin6_port = local_port; | 2407 | sin6->sin6_port = local_port; |
| 2370 | memcpy(sin6->sin6_addr.s6_addr, local_ip, 16); | 2408 | memcpy(sin6->sin6_addr.s6_addr, local_ip, 16); |
| 2371 | sin6 = (struct sockaddr_in6 *)&child_ep->com.remote_addr; | 2409 | |
| 2410 | sin6 = (struct sockaddr_in6 *)&child_ep->com.local_addr; | ||
| 2411 | sin6->sin6_family = PF_INET6; | ||
| 2412 | sin6->sin6_port = ((struct sockaddr_in6 *) | ||
| 2413 | &parent_ep->com.local_addr)->sin6_port; | ||
| 2414 | memcpy(sin6->sin6_addr.s6_addr, local_ip, 16); | ||
| 2415 | |||
| 2416 | sin6 = (struct sockaddr_in6 *)&child_ep->com.mapped_remote_addr; | ||
| 2372 | sin6->sin6_family = PF_INET6; | 2417 | sin6->sin6_family = PF_INET6; |
| 2373 | sin6->sin6_port = peer_port; | 2418 | sin6->sin6_port = peer_port; |
| 2374 | memcpy(sin6->sin6_addr.s6_addr, peer_ip, 16); | 2419 | memcpy(sin6->sin6_addr.s6_addr, peer_ip, 16); |
| 2375 | } | 2420 | } |
| 2421 | memcpy(&child_ep->com.remote_addr, &child_ep->com.mapped_remote_addr, | ||
| 2422 | sizeof(child_ep->com.remote_addr)); | ||
| 2423 | get_remote_addr(parent_ep, child_ep); | ||
| 2424 | |||
| 2376 | c4iw_get_ep(&parent_ep->com); | 2425 | c4iw_get_ep(&parent_ep->com); |
| 2377 | child_ep->parent_ep = parent_ep; | 2426 | child_ep->parent_ep = parent_ep; |
| 2378 | child_ep->tos = PASS_OPEN_TOS_G(ntohl(req->tos_stid)); | 2427 | child_ep->tos = PASS_OPEN_TOS_G(ntohl(req->tos_stid)); |
| @@ -2520,9 +2569,13 @@ static int peer_abort(struct c4iw_dev *dev, struct sk_buff *skb) | |||
| 2520 | 2569 | ||
| 2521 | ep = lookup_tid(t, tid); | 2570 | ep = lookup_tid(t, tid); |
| 2522 | if (is_neg_adv(req->status)) { | 2571 | if (is_neg_adv(req->status)) { |
| 2523 | dev_warn(&dev->rdev.lldi.pdev->dev, | 2572 | PDBG("%s Negative advice on abort- tid %u status %d (%s)\n", |
| 2524 | "Negative advice on abort - tid %u status %d (%s)\n", | 2573 | __func__, ep->hwtid, req->status, |
| 2525 | ep->hwtid, req->status, neg_adv_str(req->status)); | 2574 | neg_adv_str(req->status)); |
| 2575 | ep->stats.abort_neg_adv++; | ||
| 2576 | mutex_lock(&dev->rdev.stats.lock); | ||
| 2577 | dev->rdev.stats.neg_adv++; | ||
| 2578 | mutex_unlock(&dev->rdev.stats.lock); | ||
| 2526 | return 0; | 2579 | return 0; |
| 2527 | } | 2580 | } |
| 2528 | PDBG("%s ep %p tid %u state %u\n", __func__, ep, ep->hwtid, | 2581 | PDBG("%s ep %p tid %u state %u\n", __func__, ep, ep->hwtid, |
| @@ -3571,7 +3624,7 @@ static void send_fw_pass_open_req(struct c4iw_dev *dev, struct sk_buff *skb, | |||
| 3571 | * TP will ignore any value > 0 for MSS index. | 3624 | * TP will ignore any value > 0 for MSS index. |
| 3572 | */ | 3625 | */ |
| 3573 | req->tcb.opt0 = cpu_to_be64(MSS_IDX_V(0xF)); | 3626 | req->tcb.opt0 = cpu_to_be64(MSS_IDX_V(0xF)); |
| 3574 | req->cookie = (unsigned long)skb; | 3627 | req->cookie = (uintptr_t)skb; |
| 3575 | 3628 | ||
| 3576 | set_wr_txq(req_skb, CPL_PRIORITY_CONTROL, port_id); | 3629 | set_wr_txq(req_skb, CPL_PRIORITY_CONTROL, port_id); |
| 3577 | ret = cxgb4_ofld_send(dev->rdev.lldi.ports[0], req_skb); | 3630 | ret = cxgb4_ofld_send(dev->rdev.lldi.ports[0], req_skb); |
| @@ -3931,9 +3984,11 @@ static int peer_abort_intr(struct c4iw_dev *dev, struct sk_buff *skb) | |||
| 3931 | return 0; | 3984 | return 0; |
| 3932 | } | 3985 | } |
| 3933 | if (is_neg_adv(req->status)) { | 3986 | if (is_neg_adv(req->status)) { |
| 3934 | dev_warn(&dev->rdev.lldi.pdev->dev, | 3987 | PDBG("%s Negative advice on abort- tid %u status %d (%s)\n", |
| 3935 | "Negative advice on abort - tid %u status %d (%s)\n", | 3988 | __func__, ep->hwtid, req->status, |
| 3936 | ep->hwtid, req->status, neg_adv_str(req->status)); | 3989 | neg_adv_str(req->status)); |
| 3990 | ep->stats.abort_neg_adv++; | ||
| 3991 | dev->rdev.stats.neg_adv++; | ||
| 3937 | kfree_skb(skb); | 3992 | kfree_skb(skb); |
| 3938 | return 0; | 3993 | return 0; |
| 3939 | } | 3994 | } |
