aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/chip.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/hfi1/chip.c')
-rw-r--r--drivers/infiniband/hw/hfi1/chip.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c
index 81619fbb5842..f5de85178055 100644
--- a/drivers/infiniband/hw/hfi1/chip.c
+++ b/drivers/infiniband/hw/hfi1/chip.c
@@ -1037,7 +1037,7 @@ static void dc_shutdown(struct hfi1_devdata *);
1037static void dc_start(struct hfi1_devdata *); 1037static void dc_start(struct hfi1_devdata *);
1038static int qos_rmt_entries(struct hfi1_devdata *dd, unsigned int *mp, 1038static int qos_rmt_entries(struct hfi1_devdata *dd, unsigned int *mp,
1039 unsigned int *np); 1039 unsigned int *np);
1040static void remove_full_mgmt_pkey(struct hfi1_pportdata *ppd); 1040static void clear_full_mgmt_pkey(struct hfi1_pportdata *ppd);
1041 1041
1042/* 1042/*
1043 * Error interrupt table entry. This is used as input to the interrupt 1043 * 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 } 6962 }
6963 6963
6964 reset_neighbor_info(ppd); 6964 reset_neighbor_info(ppd);
6965 if (ppd->mgmt_allowed)
6966 remove_full_mgmt_pkey(ppd);
6967 6965
6968 /* disable the port */ 6966 /* disable the port */
6969 clear_rcvctrl(ppd->dd, RCV_CTRL_RCV_PORT_ENABLE_SMASK); 6967 clear_rcvctrl(ppd->dd, RCV_CTRL_RCV_PORT_ENABLE_SMASK);
@@ -7070,12 +7068,16 @@ static void add_full_mgmt_pkey(struct hfi1_pportdata *ppd)
7070 __func__, ppd->pkeys[2], FULL_MGMT_P_KEY); 7068 __func__, ppd->pkeys[2], FULL_MGMT_P_KEY);
7071 ppd->pkeys[2] = FULL_MGMT_P_KEY; 7069 ppd->pkeys[2] = FULL_MGMT_P_KEY;
7072 (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_PKEYS, 0); 7070 (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_PKEYS, 0);
7071 hfi1_event_pkey_change(ppd->dd, ppd->port);
7073} 7072}
7074 7073
7075static void remove_full_mgmt_pkey(struct hfi1_pportdata *ppd) 7074static void clear_full_mgmt_pkey(struct hfi1_pportdata *ppd)
7076{ 7075{
7077 ppd->pkeys[2] = 0; 7076 if (ppd->pkeys[2] != 0) {
7078 (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_PKEYS, 0); 7077 ppd->pkeys[2] = 0;
7078 (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_PKEYS, 0);
7079 hfi1_event_pkey_change(ppd->dd, ppd->port);
7080 }
7079} 7081}
7080 7082
7081/* 7083/*
@@ -9168,6 +9170,13 @@ int start_link(struct hfi1_pportdata *ppd)
9168 return 0; 9170 return 0;
9169 } 9171 }
9170 9172
9173 /*
9174 * FULL_MGMT_P_KEY is cleared from the pkey table, so that the
9175 * pkey table can be configured properly if the HFI unit is connected
9176 * to switch port with MgmtAllowed=NO
9177 */
9178 clear_full_mgmt_pkey(ppd);
9179
9171 return set_link_state(ppd, HLS_DN_POLL); 9180 return set_link_state(ppd, HLS_DN_POLL);
9172} 9181}
9173 9182
@@ -9777,7 +9786,7 @@ static void set_send_length(struct hfi1_pportdata *ppd)
9777 u64 len1 = 0, len2 = (((dd->vld[15].mtu + max_hb) >> 2) 9786 u64 len1 = 0, len2 = (((dd->vld[15].mtu + max_hb) >> 2)
9778 & SEND_LEN_CHECK1_LEN_VL15_MASK) << 9787 & SEND_LEN_CHECK1_LEN_VL15_MASK) <<
9779 SEND_LEN_CHECK1_LEN_VL15_SHIFT; 9788 SEND_LEN_CHECK1_LEN_VL15_SHIFT;
9780 int i; 9789 int i, j;
9781 u32 thres; 9790 u32 thres;
9782 9791
9783 for (i = 0; i < ppd->vls_supported; i++) { 9792 for (i = 0; i < ppd->vls_supported; i++) {
@@ -9801,7 +9810,10 @@ static void set_send_length(struct hfi1_pportdata *ppd)
9801 sc_mtu_to_threshold(dd->vld[i].sc, 9810 sc_mtu_to_threshold(dd->vld[i].sc,
9802 dd->vld[i].mtu, 9811 dd->vld[i].mtu,
9803 dd->rcd[0]->rcvhdrqentsize)); 9812 dd->rcd[0]->rcvhdrqentsize));
9804 sc_set_cr_threshold(dd->vld[i].sc, thres); 9813 for (j = 0; j < INIT_SC_PER_VL; j++)
9814 sc_set_cr_threshold(
9815 pio_select_send_context_vl(dd, j, i),
9816 thres);
9805 } 9817 }
9806 thres = min(sc_percent_to_threshold(dd->vld[15].sc, 50), 9818 thres = min(sc_percent_to_threshold(dd->vld[15].sc, 50),
9807 sc_mtu_to_threshold(dd->vld[15].sc, 9819 sc_mtu_to_threshold(dd->vld[15].sc,