提交 3ca4fbc8 编写于 作者: S Sebastian Sanchez 提交者: Doug Ledford

IB/hfi1: Return SC2VL mappings to FM with VL15 instead of ILLEGAL_VL

VL15 in the SC2VL table is used to indicate an invalid SC
for the FM, however, internally the driver remaps SCs from
VL15 to ILLEGAL_VL to prevent error counts. This mapping
confuses the FM when performing a sweep, making it return
a table mismatch error. Have SMA convert ILLEGAL_VL
to VL15 entries for the SC2VL table queries.
Reviewed-by: NMichael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: NSebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 db730894
/* /*
* Copyright(c) 2015, 2016 Intel Corporation. * Copyright(c) 2015-2017 Intel Corporation.
* *
* This file is provided under a dual BSD/GPLv2 license. When using or * This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license. * redistributing this file, you may do so under either license.
...@@ -1474,25 +1474,15 @@ static int __subn_set_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data, ...@@ -1474,25 +1474,15 @@ static int __subn_set_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data,
return __subn_get_opa_pkeytable(smp, am, data, ibdev, port, resp_len); return __subn_get_opa_pkeytable(smp, am, data, ibdev, port, resp_len);
} }
static int get_sc2vlt_tables(struct hfi1_devdata *dd, void *data)
{
u64 *val = data;
*val++ = read_csr(dd, SEND_SC2VLT0);
*val++ = read_csr(dd, SEND_SC2VLT1);
*val++ = read_csr(dd, SEND_SC2VLT2);
*val++ = read_csr(dd, SEND_SC2VLT3);
return 0;
}
#define ILLEGAL_VL 12 #define ILLEGAL_VL 12
/* /*
* filter_sc2vlt changes mappings to VL15 to ILLEGAL_VL (except * filter_sc2vlt changes mappings to VL15 to ILLEGAL_VL (except
* for SC15, which must map to VL15). If we don't remap things this * for SC15, which must map to VL15). If we don't remap things this
* way it is possible for VL15 counters to increment when we try to * way it is possible for VL15 counters to increment when we try to
* send on a SC which is mapped to an invalid VL. * send on a SC which is mapped to an invalid VL.
* When getting the table convert ILLEGAL_VL back to VL15.
*/ */
static void filter_sc2vlt(void *data) static void filter_sc2vlt(void *data, bool set)
{ {
int i; int i;
u8 *pd = data; u8 *pd = data;
...@@ -1500,8 +1490,14 @@ static void filter_sc2vlt(void *data) ...@@ -1500,8 +1490,14 @@ static void filter_sc2vlt(void *data)
for (i = 0; i < OPA_MAX_SCS; i++) { for (i = 0; i < OPA_MAX_SCS; i++) {
if (i == 15) if (i == 15)
continue; continue;
if ((pd[i] & 0x1f) == 0xf)
pd[i] = ILLEGAL_VL; if (set) {
if ((pd[i] & 0x1f) == 0xf)
pd[i] = ILLEGAL_VL;
} else {
if ((pd[i] & 0x1f) == ILLEGAL_VL)
pd[i] = 0xf;
}
} }
} }
...@@ -1509,7 +1505,7 @@ static int set_sc2vlt_tables(struct hfi1_devdata *dd, void *data) ...@@ -1509,7 +1505,7 @@ static int set_sc2vlt_tables(struct hfi1_devdata *dd, void *data)
{ {
u64 *val = data; u64 *val = data;
filter_sc2vlt(data); filter_sc2vlt(data, true);
write_csr(dd, SEND_SC2VLT0, *val++); write_csr(dd, SEND_SC2VLT0, *val++);
write_csr(dd, SEND_SC2VLT1, *val++); write_csr(dd, SEND_SC2VLT1, *val++);
...@@ -1521,6 +1517,19 @@ static int set_sc2vlt_tables(struct hfi1_devdata *dd, void *data) ...@@ -1521,6 +1517,19 @@ static int set_sc2vlt_tables(struct hfi1_devdata *dd, void *data)
return 0; return 0;
} }
static int get_sc2vlt_tables(struct hfi1_devdata *dd, void *data)
{
u64 *val = (u64 *)data;
*val++ = read_csr(dd, SEND_SC2VLT0);
*val++ = read_csr(dd, SEND_SC2VLT1);
*val++ = read_csr(dd, SEND_SC2VLT2);
*val++ = read_csr(dd, SEND_SC2VLT3);
filter_sc2vlt((u64 *)data, false);
return 0;
}
static int __subn_get_opa_sl_to_sc(struct opa_smp *smp, u32 am, u8 *data, static int __subn_get_opa_sl_to_sc(struct opa_smp *smp, u32 am, u8 *data,
struct ib_device *ibdev, u8 port, struct ib_device *ibdev, u8 port,
u32 *resp_len) u32 *resp_len)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册