aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-07-15 02:42:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-15 02:42:22 -0400
commit0a9cb4815b91378bc7e8a7cda781ee50325bdd54 (patch)
tree7f02d303e114a2e4f6af218c8d9af0950f1c092a
parent1a86f944c7f2b22a81f9a1e6a890be0db5d2444a (diff)
parent8e0e7aedadb877d91a6e66611464165c969bc0a9 (diff)
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma
Pull rdma fixes from Doug Ledford: "Round three of 4.7 rc fixes: - two fixes for hfi1 - two fixes for i40iw - one omission correction in the port table counter arrays" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: i40iw: Enable remote access rights for stag allocation i40iw: do not print unitialized variables in error message IB core: Add port_xmit_wait counter IB/hfi1: Fix sleep inside atomic issue in init_asic_data IB/hfi1: Correct issues with sc5 computation
-rw-r--r--drivers/infiniband/core/sysfs.c4
-rw-r--r--drivers/infiniband/hw/hfi1/chip.c16
-rw-r--r--drivers/infiniband/hw/hfi1/ud.c23
-rw-r--r--drivers/infiniband/hw/i40iw/i40iw_main.c3
-rw-r--r--drivers/infiniband/hw/i40iw/i40iw_verbs.c1
5 files changed, 18 insertions, 29 deletions
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index a5793c8f1590..60df4f8e81be 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -530,6 +530,7 @@ static PORT_PMA_ATTR(port_xmit_data , 12, 32, 192);
530static PORT_PMA_ATTR(port_rcv_data , 13, 32, 224); 530static PORT_PMA_ATTR(port_rcv_data , 13, 32, 224);
531static PORT_PMA_ATTR(port_xmit_packets , 14, 32, 256); 531static PORT_PMA_ATTR(port_xmit_packets , 14, 32, 256);
532static PORT_PMA_ATTR(port_rcv_packets , 15, 32, 288); 532static PORT_PMA_ATTR(port_rcv_packets , 15, 32, 288);
533static PORT_PMA_ATTR(port_xmit_wait , 0, 32, 320);
533 534
534/* 535/*
535 * Counters added by extended set 536 * Counters added by extended set
@@ -560,6 +561,7 @@ static struct attribute *pma_attrs[] = {
560 &port_pma_attr_port_rcv_data.attr.attr, 561 &port_pma_attr_port_rcv_data.attr.attr,
561 &port_pma_attr_port_xmit_packets.attr.attr, 562 &port_pma_attr_port_xmit_packets.attr.attr,
562 &port_pma_attr_port_rcv_packets.attr.attr, 563 &port_pma_attr_port_rcv_packets.attr.attr,
564 &port_pma_attr_port_xmit_wait.attr.attr,
563 NULL 565 NULL
564}; 566};
565 567
@@ -579,6 +581,7 @@ static struct attribute *pma_attrs_ext[] = {
579 &port_pma_attr_ext_port_xmit_data.attr.attr, 581 &port_pma_attr_ext_port_xmit_data.attr.attr,
580 &port_pma_attr_ext_port_rcv_data.attr.attr, 582 &port_pma_attr_ext_port_rcv_data.attr.attr,
581 &port_pma_attr_ext_port_xmit_packets.attr.attr, 583 &port_pma_attr_ext_port_xmit_packets.attr.attr,
584 &port_pma_attr_port_xmit_wait.attr.attr,
582 &port_pma_attr_ext_port_rcv_packets.attr.attr, 585 &port_pma_attr_ext_port_rcv_packets.attr.attr,
583 &port_pma_attr_ext_unicast_rcv_packets.attr.attr, 586 &port_pma_attr_ext_unicast_rcv_packets.attr.attr,
584 &port_pma_attr_ext_unicast_xmit_packets.attr.attr, 587 &port_pma_attr_ext_unicast_xmit_packets.attr.attr,
@@ -604,6 +607,7 @@ static struct attribute *pma_attrs_noietf[] = {
604 &port_pma_attr_ext_port_rcv_data.attr.attr, 607 &port_pma_attr_ext_port_rcv_data.attr.attr,
605 &port_pma_attr_ext_port_xmit_packets.attr.attr, 608 &port_pma_attr_ext_port_xmit_packets.attr.attr,
606 &port_pma_attr_ext_port_rcv_packets.attr.attr, 609 &port_pma_attr_ext_port_rcv_packets.attr.attr,
610 &port_pma_attr_port_xmit_wait.attr.attr,
607 NULL 611 NULL
608}; 612};
609 613
diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c
index f5de85178055..dad4d0ebbdff 100644
--- a/drivers/infiniband/hw/hfi1/chip.c
+++ b/drivers/infiniband/hw/hfi1/chip.c
@@ -14113,8 +14113,14 @@ static int init_asic_data(struct hfi1_devdata *dd)
14113{ 14113{
14114 unsigned long flags; 14114 unsigned long flags;
14115 struct hfi1_devdata *tmp, *peer = NULL; 14115 struct hfi1_devdata *tmp, *peer = NULL;
14116 struct hfi1_asic_data *asic_data;
14116 int ret = 0; 14117 int ret = 0;
14117 14118
14119 /* pre-allocate the asic structure in case we are the first device */
14120 asic_data = kzalloc(sizeof(*dd->asic_data), GFP_KERNEL);
14121 if (!asic_data)
14122 return -ENOMEM;
14123
14118 spin_lock_irqsave(&hfi1_devs_lock, flags); 14124 spin_lock_irqsave(&hfi1_devs_lock, flags);
14119 /* Find our peer device */ 14125 /* Find our peer device */
14120 list_for_each_entry(tmp, &hfi1_dev_list, list) { 14126 list_for_each_entry(tmp, &hfi1_dev_list, list) {
@@ -14126,18 +14132,14 @@ static int init_asic_data(struct hfi1_devdata *dd)
14126 } 14132 }
14127 14133
14128 if (peer) { 14134 if (peer) {
14135 /* use already allocated structure */
14129 dd->asic_data = peer->asic_data; 14136 dd->asic_data = peer->asic_data;
14137 kfree(asic_data);
14130 } else { 14138 } else {
14131 dd->asic_data = kzalloc(sizeof(*dd->asic_data), GFP_KERNEL); 14139 dd->asic_data = asic_data;
14132 if (!dd->asic_data) {
14133 ret = -ENOMEM;
14134 goto done;
14135 }
14136 mutex_init(&dd->asic_data->asic_resource_mutex); 14140 mutex_init(&dd->asic_data->asic_resource_mutex);
14137 } 14141 }
14138 dd->asic_data->dds[dd->hfi1_id] = dd; /* self back-pointer */ 14142 dd->asic_data->dds[dd->hfi1_id] = dd; /* self back-pointer */
14139
14140done:
14141 spin_unlock_irqrestore(&hfi1_devs_lock, flags); 14143 spin_unlock_irqrestore(&hfi1_devs_lock, flags);
14142 return ret; 14144 return ret;
14143} 14145}
diff --git a/drivers/infiniband/hw/hfi1/ud.c b/drivers/infiniband/hw/hfi1/ud.c
index 1e503ad0bebb..be91f6fa1c87 100644
--- a/drivers/infiniband/hw/hfi1/ud.c
+++ b/drivers/infiniband/hw/hfi1/ud.c
@@ -678,8 +678,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
678 u32 tlen = packet->tlen; 678 u32 tlen = packet->tlen;
679 struct rvt_qp *qp = packet->qp; 679 struct rvt_qp *qp = packet->qp;
680 bool has_grh = rcv_flags & HFI1_HAS_GRH; 680 bool has_grh = rcv_flags & HFI1_HAS_GRH;
681 bool sc4_bit = has_sc4_bit(packet); 681 u8 sc5 = hdr2sc((struct hfi1_message_header *)hdr, packet->rhf);
682 u8 sc;
683 u32 bth1; 682 u32 bth1;
684 int is_mcast; 683 int is_mcast;
685 struct ib_grh *grh = NULL; 684 struct ib_grh *grh = NULL;
@@ -697,10 +696,8 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
697 */ 696 */
698 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); 697 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
699 u32 lqpn = be32_to_cpu(ohdr->bth[1]) & RVT_QPN_MASK; 698 u32 lqpn = be32_to_cpu(ohdr->bth[1]) & RVT_QPN_MASK;
700 u8 sl, sc5; 699 u8 sl;
701 700
702 sc5 = (be16_to_cpu(hdr->lrh[0]) >> 12) & 0xf;
703 sc5 |= sc4_bit;
704 sl = ibp->sc_to_sl[sc5]; 701 sl = ibp->sc_to_sl[sc5];
705 702
706 process_becn(ppd, sl, 0, lqpn, 0, IB_CC_SVCTYPE_UD); 703 process_becn(ppd, sl, 0, lqpn, 0, IB_CC_SVCTYPE_UD);
@@ -717,10 +714,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
717 714
718 if (!is_mcast && (opcode != IB_OPCODE_CNP) && bth1 & HFI1_FECN_SMASK) { 715 if (!is_mcast && (opcode != IB_OPCODE_CNP) && bth1 & HFI1_FECN_SMASK) {
719 u16 slid = be16_to_cpu(hdr->lrh[3]); 716 u16 slid = be16_to_cpu(hdr->lrh[3]);
720 u8 sc5;
721
722 sc5 = (be16_to_cpu(hdr->lrh[0]) >> 12) & 0xf;
723 sc5 |= sc4_bit;
724 717
725 return_cnp(ibp, qp, src_qp, pkey, dlid, slid, sc5, grh); 718 return_cnp(ibp, qp, src_qp, pkey, dlid, slid, sc5, grh);
726 } 719 }
@@ -745,10 +738,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
745 if (qp->ibqp.qp_num > 1) { 738 if (qp->ibqp.qp_num > 1) {
746 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); 739 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
747 u16 slid; 740 u16 slid;
748 u8 sc5;
749
750 sc5 = (be16_to_cpu(hdr->lrh[0]) >> 12) & 0xf;
751 sc5 |= sc4_bit;
752 741
753 slid = be16_to_cpu(hdr->lrh[3]); 742 slid = be16_to_cpu(hdr->lrh[3]);
754 if (unlikely(rcv_pkey_check(ppd, pkey, sc5, slid))) { 743 if (unlikely(rcv_pkey_check(ppd, pkey, sc5, slid))) {
@@ -790,10 +779,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
790 /* Received on QP0, and so by definition, this is an SMP */ 779 /* Received on QP0, and so by definition, this is an SMP */
791 struct opa_smp *smp = (struct opa_smp *)data; 780 struct opa_smp *smp = (struct opa_smp *)data;
792 u16 slid = be16_to_cpu(hdr->lrh[3]); 781 u16 slid = be16_to_cpu(hdr->lrh[3]);
793 u8 sc5;
794
795 sc5 = (be16_to_cpu(hdr->lrh[0]) >> 12) & 0xf;
796 sc5 |= sc4_bit;
797 782
798 if (opa_smp_check(ibp, pkey, sc5, qp, slid, smp)) 783 if (opa_smp_check(ibp, pkey, sc5, qp, slid, smp))
799 goto drop; 784 goto drop;
@@ -890,9 +875,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet)
890 } 875 }
891 876
892 wc.slid = be16_to_cpu(hdr->lrh[3]); 877 wc.slid = be16_to_cpu(hdr->lrh[3]);
893 sc = (be16_to_cpu(hdr->lrh[0]) >> 12) & 0xf; 878 wc.sl = ibp->sc_to_sl[sc5];
894 sc |= sc4_bit;
895 wc.sl = ibp->sc_to_sl[sc];
896 879
897 /* 880 /*
898 * Save the LMC lower bits if the destination LID is a unicast LID. 881 * Save the LMC lower bits if the destination LID is a unicast LID.
diff --git a/drivers/infiniband/hw/i40iw/i40iw_main.c b/drivers/infiniband/hw/i40iw/i40iw_main.c
index c963cad92f5a..6e9081380a27 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_main.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_main.c
@@ -600,8 +600,7 @@ static enum i40iw_status_code i40iw_create_cqp(struct i40iw_device *iwdev)
600 cqp_init_info.scratch_array = cqp->scratch_array; 600 cqp_init_info.scratch_array = cqp->scratch_array;
601 status = dev->cqp_ops->cqp_init(dev->cqp, &cqp_init_info); 601 status = dev->cqp_ops->cqp_init(dev->cqp, &cqp_init_info);
602 if (status) { 602 if (status) {
603 i40iw_pr_err("cqp init status %d maj_err %d min_err %d\n", 603 i40iw_pr_err("cqp init status %d\n", status);
604 status, maj_err, min_err);
605 goto exit; 604 goto exit;
606 } 605 }
607 status = dev->cqp_ops->cqp_create(dev->cqp, true, &maj_err, &min_err); 606 status = dev->cqp_ops->cqp_create(dev->cqp, true, &maj_err, &min_err);
diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
index 33959ed14563..283b64c942ee 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
@@ -1474,6 +1474,7 @@ static int i40iw_hw_alloc_stag(struct i40iw_device *iwdev, struct i40iw_mr *iwmr
1474 info->stag_idx = iwmr->stag >> I40IW_CQPSQ_STAG_IDX_SHIFT; 1474 info->stag_idx = iwmr->stag >> I40IW_CQPSQ_STAG_IDX_SHIFT;
1475 info->pd_id = iwpd->sc_pd.pd_id; 1475 info->pd_id = iwpd->sc_pd.pd_id;
1476 info->total_len = iwmr->length; 1476 info->total_len = iwmr->length;
1477 info->remote_access = true;
1477 cqp_info->cqp_cmd = OP_ALLOC_STAG; 1478 cqp_info->cqp_cmd = OP_ALLOC_STAG;
1478 cqp_info->post_sq = 1; 1479 cqp_info->post_sq = 1;
1479 cqp_info->in.u.alloc_stag.dev = &iwdev->sc_dev; 1480 cqp_info->in.u.alloc_stag.dev = &iwdev->sc_dev;