Commit 3ec5fa28 authored by Sebastian Sanchez's avatar Sebastian Sanchez Committed by Doug Ledford

IB/hfi1: Remove FULL_MGMT_P_KEY from pkey table at link up

FULL_MGMT_P_KEY doesn't get cleared from the pkey table at link bounce
because the link down and link bounce code paths are different when
moving a QSFP cable on a switch. This causes an HFI unit connected to a
switch to try to be initialized to an FM node when the QSFP cable is
moved from a MgmtAllowed=NO port to a MgmtAllowed=YES port and back to a
MgmtAllowed=NO port. Remove FULL_MGMT_P_KEY from pkey table at link up.
Reviewed-by: default avatarDean Luick <dean.luick@intel.com>
Signed-off-by: default avatarSebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent c078f0dd
...@@ -1037,7 +1037,7 @@ static void dc_shutdown(struct hfi1_devdata *); ...@@ -1037,7 +1037,7 @@ static void dc_shutdown(struct hfi1_devdata *);
static void dc_start(struct hfi1_devdata *); static void dc_start(struct hfi1_devdata *);
static int qos_rmt_entries(struct hfi1_devdata *dd, unsigned int *mp, static int qos_rmt_entries(struct hfi1_devdata *dd, unsigned int *mp,
unsigned int *np); unsigned int *np);
static void remove_full_mgmt_pkey(struct hfi1_pportdata *ppd); static void clear_full_mgmt_pkey(struct hfi1_pportdata *ppd);
/* /*
* Error interrupt table entry. This is used as input to the interrupt * Error interrupt table entry. This is used as input to the interrupt
...@@ -6962,8 +6962,6 @@ void handle_link_down(struct work_struct *work) ...@@ -6962,8 +6962,6 @@ void handle_link_down(struct work_struct *work)
} }
reset_neighbor_info(ppd); reset_neighbor_info(ppd);
if (ppd->mgmt_allowed)
remove_full_mgmt_pkey(ppd);
/* disable the port */ /* disable the port */
clear_rcvctrl(ppd->dd, RCV_CTRL_RCV_PORT_ENABLE_SMASK); clear_rcvctrl(ppd->dd, RCV_CTRL_RCV_PORT_ENABLE_SMASK);
...@@ -7072,10 +7070,12 @@ static void add_full_mgmt_pkey(struct hfi1_pportdata *ppd) ...@@ -7072,10 +7070,12 @@ static void add_full_mgmt_pkey(struct hfi1_pportdata *ppd)
(void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_PKEYS, 0); (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_PKEYS, 0);
} }
static void remove_full_mgmt_pkey(struct hfi1_pportdata *ppd) static void clear_full_mgmt_pkey(struct hfi1_pportdata *ppd)
{ {
ppd->pkeys[2] = 0; if (ppd->pkeys[2] != 0) {
(void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_PKEYS, 0); ppd->pkeys[2] = 0;
(void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_PKEYS, 0);
}
} }
/* /*
...@@ -9168,6 +9168,13 @@ int start_link(struct hfi1_pportdata *ppd) ...@@ -9168,6 +9168,13 @@ int start_link(struct hfi1_pportdata *ppd)
return 0; return 0;
} }
/*
* FULL_MGMT_P_KEY is cleared from the pkey table, so that the
* pkey table can be configured properly if the HFI unit is connected
* to switch port with MgmtAllowed=NO
*/
clear_full_mgmt_pkey(ppd);
return set_link_state(ppd, HLS_DN_POLL); return set_link_state(ppd, HLS_DN_POLL);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment