aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/mad.c
diff options
context:
space:
mode:
authorSebastian Sanchez <sebastian.sanchez@intel.com>2016-05-24 12:50:47 -0700
committerDoug Ledford <dledford@redhat.com>2016-05-26 12:21:10 -0400
commitce8b2fd0950ccc14440b02f05d2c7023608cfa76 (patch)
tree39498bb1df0c7bbe446400197c31a54ab00232fb /drivers/infiniband/hw/hfi1/mad.c
parentIB/rdamvt: Fix rdmavt s_ack_queue sizing (diff)
downloadlinux-dev-ce8b2fd0950ccc14440b02f05d2c7023608cfa76.tar.xz
linux-dev-ce8b2fd0950ccc14440b02f05d2c7023608cfa76.zip
IB/hfi1: Update pkey table properly after link down or FM start
When FM is disabled, and the HFI port on the switch is changed from MgmtAllowed=YES to MgmtAllowed=NO and the link is bounced, FULL_MGMT_P_KEY doesn't get cleared from the pkey table. This also occurs when the QSFP cable is moved from a switch port with MgmtAllowed=YES to a MgmtAllowed=NO port. Clear pkey entry properly. Also, when the driver is loaded and the switch port is set to MgmtAllowed=NO, FULL_MGMT_P_KEY shouldn't be added to pkey table after FM is started. Only set FULL_MGMT_P_KEY in the pkey table if switch port is configured to MgmtAllowed=YES. Reviewed-by: Dean Luick <dean.luick@intel.com> Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/mad.c')
-rw-r--r--drivers/infiniband/hw/hfi1/mad.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hfi1/mad.c b/drivers/infiniband/hw/hfi1/mad.c
index 17882dc8650e..219029576ba0 100644
--- a/drivers/infiniband/hw/hfi1/mad.c
+++ b/drivers/infiniband/hw/hfi1/mad.c
@@ -1403,6 +1403,12 @@ static int set_pkeys(struct hfi1_devdata *dd, u8 port, u16 *pkeys)
if (key == okey)
continue;
/*
+ * Don't update pkeys[2], if an HFI port without MgmtAllowed
+ * by neighbor is a switch.
+ */
+ if (i == 2 && !ppd->mgmt_allowed && ppd->neighbor_type == 1)
+ continue;
+ /*
* The SM gives us the complete PKey table. We have
* to ensure that we put the PKeys in the matching
* slots.