IB/hfi1: Update pkey table properly after link down or FM start
authorSebastian Sanchez <sebastian.sanchez@intel.com>
Tue, 24 May 2016 19:50:47 +0000 (12:50 -0700)
committerDoug Ledford <dledford@redhat.com>
Thu, 26 May 2016 16:21:10 +0000 (12:21 -0400)
commitce8b2fd0950ccc14440b02f05d2c7023608cfa76
tree39498bb1df0c7bbe446400197c31a54ab00232fb
parent8b103e9cdee5f381bc20a8a9f9bb5be11de8e68f
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>
drivers/infiniband/hw/hfi1/chip.c
drivers/infiniband/hw/hfi1/mad.c