diff options
Diffstat (limited to 'drivers/infiniband/hw/cxgb4/cm.c')
-rw-r--r-- | drivers/infiniband/hw/cxgb4/cm.c | 78 |
1 files changed, 20 insertions, 58 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index 12fef76c791c..45126879ad28 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c | |||
@@ -524,50 +524,6 @@ static int send_abort(struct c4iw_ep *ep, struct sk_buff *skb, gfp_t gfp) | |||
524 | return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t); | 524 | return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t); |
525 | } | 525 | } |
526 | 526 | ||
527 | #define VLAN_NONE 0xfff | ||
528 | #define FILTER_SEL_VLAN_NONE 0xffff | ||
529 | #define FILTER_SEL_WIDTH_P_FC (3+1) /* port uses 3 bits, FCoE one bit */ | ||
530 | #define FILTER_SEL_WIDTH_VIN_P_FC \ | ||
531 | (6 + 7 + FILTER_SEL_WIDTH_P_FC) /* 6 bits are unused, VF uses 7 bits*/ | ||
532 | #define FILTER_SEL_WIDTH_TAG_P_FC \ | ||
533 | (3 + FILTER_SEL_WIDTH_VIN_P_FC) /* PF uses 3 bits */ | ||
534 | #define FILTER_SEL_WIDTH_VLD_TAG_P_FC (1 + FILTER_SEL_WIDTH_TAG_P_FC) | ||
535 | |||
536 | static unsigned int select_ntuple(struct c4iw_dev *dev, struct dst_entry *dst, | ||
537 | struct l2t_entry *l2t) | ||
538 | { | ||
539 | unsigned int ntuple = 0; | ||
540 | u32 viid; | ||
541 | |||
542 | switch (dev->rdev.lldi.filt_mode) { | ||
543 | |||
544 | /* default filter mode */ | ||
545 | case HW_TPL_FR_MT_PR_IV_P_FC: | ||
546 | if (l2t->vlan == VLAN_NONE) | ||
547 | ntuple |= FILTER_SEL_VLAN_NONE << FILTER_SEL_WIDTH_P_FC; | ||
548 | else { | ||
549 | ntuple |= l2t->vlan << FILTER_SEL_WIDTH_P_FC; | ||
550 | ntuple |= 1 << FILTER_SEL_WIDTH_TAG_P_FC; | ||
551 | } | ||
552 | ntuple |= l2t->lport << S_PORT | IPPROTO_TCP << | ||
553 | FILTER_SEL_WIDTH_VLD_TAG_P_FC; | ||
554 | break; | ||
555 | case HW_TPL_FR_MT_PR_OV_P_FC: { | ||
556 | viid = cxgb4_port_viid(l2t->neigh->dev); | ||
557 | |||
558 | ntuple |= FW_VIID_VIN_GET(viid) << FILTER_SEL_WIDTH_P_FC; | ||
559 | ntuple |= FW_VIID_PFN_GET(viid) << FILTER_SEL_WIDTH_VIN_P_FC; | ||
560 | ntuple |= FW_VIID_VIVLD_GET(viid) << FILTER_SEL_WIDTH_TAG_P_FC; | ||
561 | ntuple |= l2t->lport << S_PORT | IPPROTO_TCP << | ||
562 | FILTER_SEL_WIDTH_VLD_TAG_P_FC; | ||
563 | break; | ||
564 | } | ||
565 | default: | ||
566 | break; | ||
567 | } | ||
568 | return ntuple; | ||
569 | } | ||
570 | |||
571 | static int send_connect(struct c4iw_ep *ep) | 527 | static int send_connect(struct c4iw_ep *ep) |
572 | { | 528 | { |
573 | struct cpl_act_open_req *req; | 529 | struct cpl_act_open_req *req; |
@@ -641,8 +597,9 @@ static int send_connect(struct c4iw_ep *ep) | |||
641 | req->local_ip = la->sin_addr.s_addr; | 597 | req->local_ip = la->sin_addr.s_addr; |
642 | req->peer_ip = ra->sin_addr.s_addr; | 598 | req->peer_ip = ra->sin_addr.s_addr; |
643 | req->opt0 = cpu_to_be64(opt0); | 599 | req->opt0 = cpu_to_be64(opt0); |
644 | req->params = cpu_to_be32(select_ntuple(ep->com.dev, | 600 | req->params = cpu_to_be32(cxgb4_select_ntuple( |
645 | ep->dst, ep->l2t)); | 601 | ep->com.dev->rdev.lldi.ports[0], |
602 | ep->l2t)); | ||
646 | req->opt2 = cpu_to_be32(opt2); | 603 | req->opt2 = cpu_to_be32(opt2); |
647 | } else { | 604 | } else { |
648 | req6 = (struct cpl_act_open_req6 *)skb_put(skb, wrlen); | 605 | req6 = (struct cpl_act_open_req6 *)skb_put(skb, wrlen); |
@@ -662,9 +619,9 @@ static int send_connect(struct c4iw_ep *ep) | |||
662 | req6->peer_ip_lo = *((__be64 *) | 619 | req6->peer_ip_lo = *((__be64 *) |
663 | (ra6->sin6_addr.s6_addr + 8)); | 620 | (ra6->sin6_addr.s6_addr + 8)); |
664 | req6->opt0 = cpu_to_be64(opt0); | 621 | req6->opt0 = cpu_to_be64(opt0); |
665 | req6->params = cpu_to_be32( | 622 | req6->params = cpu_to_be32(cxgb4_select_ntuple( |
666 | select_ntuple(ep->com.dev, ep->dst, | 623 | ep->com.dev->rdev.lldi.ports[0], |
667 | ep->l2t)); | 624 | ep->l2t)); |
668 | req6->opt2 = cpu_to_be32(opt2); | 625 | req6->opt2 = cpu_to_be32(opt2); |
669 | } | 626 | } |
670 | } else { | 627 | } else { |
@@ -681,8 +638,9 @@ static int send_connect(struct c4iw_ep *ep) | |||
681 | t5_req->peer_ip = ra->sin_addr.s_addr; | 638 | t5_req->peer_ip = ra->sin_addr.s_addr; |
682 | t5_req->opt0 = cpu_to_be64(opt0); | 639 | t5_req->opt0 = cpu_to_be64(opt0); |
683 | t5_req->params = cpu_to_be64(V_FILTER_TUPLE( | 640 | t5_req->params = cpu_to_be64(V_FILTER_TUPLE( |
684 | select_ntuple(ep->com.dev, | 641 | cxgb4_select_ntuple( |
685 | ep->dst, ep->l2t))); | 642 | ep->com.dev->rdev.lldi.ports[0], |
643 | ep->l2t))); | ||
686 | t5_req->opt2 = cpu_to_be32(opt2); | 644 | t5_req->opt2 = cpu_to_be32(opt2); |
687 | } else { | 645 | } else { |
688 | t5_req6 = (struct cpl_t5_act_open_req6 *) | 646 | t5_req6 = (struct cpl_t5_act_open_req6 *) |
@@ -703,7 +661,9 @@ static int send_connect(struct c4iw_ep *ep) | |||
703 | (ra6->sin6_addr.s6_addr + 8)); | 661 | (ra6->sin6_addr.s6_addr + 8)); |
704 | t5_req6->opt0 = cpu_to_be64(opt0); | 662 | t5_req6->opt0 = cpu_to_be64(opt0); |
705 | t5_req6->params = (__force __be64)cpu_to_be32( | 663 | t5_req6->params = (__force __be64)cpu_to_be32( |
706 | select_ntuple(ep->com.dev, ep->dst, ep->l2t)); | 664 | cxgb4_select_ntuple( |
665 | ep->com.dev->rdev.lldi.ports[0], | ||
666 | ep->l2t)); | ||
707 | t5_req6->opt2 = cpu_to_be32(opt2); | 667 | t5_req6->opt2 = cpu_to_be32(opt2); |
708 | } | 668 | } |
709 | } | 669 | } |
@@ -1630,7 +1590,8 @@ static void send_fw_act_open_req(struct c4iw_ep *ep, unsigned int atid) | |||
1630 | memset(req, 0, sizeof(*req)); | 1590 | memset(req, 0, sizeof(*req)); |
1631 | req->op_compl = htonl(V_WR_OP(FW_OFLD_CONNECTION_WR)); | 1591 | req->op_compl = htonl(V_WR_OP(FW_OFLD_CONNECTION_WR)); |
1632 | req->len16_pkd = htonl(FW_WR_LEN16(DIV_ROUND_UP(sizeof(*req), 16))); | 1592 | req->len16_pkd = htonl(FW_WR_LEN16(DIV_ROUND_UP(sizeof(*req), 16))); |
1633 | req->le.filter = cpu_to_be32(select_ntuple(ep->com.dev, ep->dst, | 1593 | req->le.filter = cpu_to_be32(cxgb4_select_ntuple( |
1594 | ep->com.dev->rdev.lldi.ports[0], | ||
1634 | ep->l2t)); | 1595 | ep->l2t)); |
1635 | sin = (struct sockaddr_in *)&ep->com.local_addr; | 1596 | sin = (struct sockaddr_in *)&ep->com.local_addr; |
1636 | req->le.lport = sin->sin_port; | 1597 | req->le.lport = sin->sin_port; |
@@ -2938,7 +2899,8 @@ int c4iw_create_listen(struct iw_cm_id *cm_id, int backlog) | |||
2938 | /* | 2899 | /* |
2939 | * Allocate a server TID. | 2900 | * Allocate a server TID. |
2940 | */ | 2901 | */ |
2941 | if (dev->rdev.lldi.enable_fw_ofld_conn) | 2902 | if (dev->rdev.lldi.enable_fw_ofld_conn && |
2903 | ep->com.local_addr.ss_family == AF_INET) | ||
2942 | ep->stid = cxgb4_alloc_sftid(dev->rdev.lldi.tids, | 2904 | ep->stid = cxgb4_alloc_sftid(dev->rdev.lldi.tids, |
2943 | cm_id->local_addr.ss_family, ep); | 2905 | cm_id->local_addr.ss_family, ep); |
2944 | else | 2906 | else |
@@ -3323,9 +3285,7 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb) | |||
3323 | /* | 3285 | /* |
3324 | * Calculate the server tid from filter hit index from cpl_rx_pkt. | 3286 | * Calculate the server tid from filter hit index from cpl_rx_pkt. |
3325 | */ | 3287 | */ |
3326 | stid = (__force int) cpu_to_be32((__force u32) rss->hash_val) | 3288 | stid = (__force int) cpu_to_be32((__force u32) rss->hash_val); |
3327 | - dev->rdev.lldi.tids->sftid_base | ||
3328 | + dev->rdev.lldi.tids->nstids; | ||
3329 | 3289 | ||
3330 | lep = (struct c4iw_ep *)lookup_stid(dev->rdev.lldi.tids, stid); | 3290 | lep = (struct c4iw_ep *)lookup_stid(dev->rdev.lldi.tids, stid); |
3331 | if (!lep) { | 3291 | if (!lep) { |
@@ -3397,7 +3357,9 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb) | |||
3397 | window = (__force u16) htons((__force u16)tcph->window); | 3357 | window = (__force u16) htons((__force u16)tcph->window); |
3398 | 3358 | ||
3399 | /* Calcuate filter portion for LE region. */ | 3359 | /* Calcuate filter portion for LE region. */ |
3400 | filter = (__force unsigned int) cpu_to_be32(select_ntuple(dev, dst, e)); | 3360 | filter = (__force unsigned int) cpu_to_be32(cxgb4_select_ntuple( |
3361 | dev->rdev.lldi.ports[0], | ||
3362 | e)); | ||
3401 | 3363 | ||
3402 | /* | 3364 | /* |
3403 | * Synthesize the cpl_pass_accept_req. We have everything except the | 3365 | * Synthesize the cpl_pass_accept_req. We have everything except the |