summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/mad.c
diff options
context:
space:
mode:
authorSebastian Sanchez2016-06-09 16:52:03 +0200
committerDoug Ledford2016-06-18 02:11:27 +0200
commit34d351f8ddf6dee24d739c4b00a4404e48089a04 (patch)
tree015ccc0cc4c2a1e3063d440915d5523d0b514646 /drivers/infiniband/hw/hfi1/mad.c
parentIB/hfi1: Remove FULL_MGMT_P_KEY from pkey table at link up (diff)
downloadkernel-qcow2-linux-34d351f8ddf6dee24d739c4b00a4404e48089a04.tar.gz
kernel-qcow2-linux-34d351f8ddf6dee24d739c4b00a4404e48089a04.tar.xz
kernel-qcow2-linux-34d351f8ddf6dee24d739c4b00a4404e48089a04.zip
IB/hfi1: Send a pkey change event on driver pkey update
Swapping a cable from a "Mgmt Allowed=No" switch port to a "Mgmt Allowed=Yes" switch port doesn't send a pkey change notification. Therefore, the link doesn't become active as the oib_utils layer uses an old pkey table cache. Fix by ensuring the pkey change notification is sent when the table is changed both explicitly by the FM and implicitly by the driver via a cable swap. Reviewed-by: Mike Marciniszyn <mike.marciniszyn@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.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/infiniband/hw/hfi1/mad.c b/drivers/infiniband/hw/hfi1/mad.c
index 219029576ba0..fca07a1d6c28 100644
--- a/drivers/infiniband/hw/hfi1/mad.c
+++ b/drivers/infiniband/hw/hfi1/mad.c
@@ -78,6 +78,16 @@ static inline void clear_opa_smp_data(struct opa_smp *smp)
memset(data, 0, size);
}
+void hfi1_event_pkey_change(struct hfi1_devdata *dd, u8 port)
+{
+ struct ib_event event;
+
+ event.event = IB_EVENT_PKEY_CHANGE;
+ event.device = &dd->verbs_dev.rdi.ibdev;
+ event.element.port_num = port;
+ ib_dispatch_event(&event);
+}
+
static void send_trap(struct hfi1_ibport *ibp, void *data, unsigned len)
{
struct ib_mad_send_buf *send_buf;
@@ -1418,15 +1428,10 @@ static int set_pkeys(struct hfi1_devdata *dd, u8 port, u16 *pkeys)
}
if (changed) {
- struct ib_event event;
-
(void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_PKEYS, 0);
-
- event.event = IB_EVENT_PKEY_CHANGE;
- event.device = &dd->verbs_dev.rdi.ibdev;
- event.element.port_num = port;
- ib_dispatch_event(&event);
+ hfi1_event_pkey_change(dd, port);
}
+
return 0;
}