summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rdma/hfi1/mad.c
diff options
context:
space:
mode:
authorKaike Wan2016-02-14 21:10:20 +0100
committerDoug Ledford2016-03-11 02:38:08 +0100
commit0ec79e875ada58bd6598d8965f9079fe1a662950 (patch)
tree3cd22a969148a1dbb8b8187ce2210c6772025def /drivers/staging/rdma/hfi1/mad.c
parentIB/rdmavt: Add trace and error print statements in post_one_wr (diff)
downloadkernel-qcow2-linux-0ec79e875ada58bd6598d8965f9079fe1a662950.tar.gz
kernel-qcow2-linux-0ec79e875ada58bd6598d8965f9079fe1a662950.tar.xz
kernel-qcow2-linux-0ec79e875ada58bd6598d8965f9079fe1a662950.zip
staging/rdma/hfi1: Put QPs into error state after SL->SC table changes
If an SL->SC mapping table change occurs after an RC/UC QP is created, there is no mechanism to change the SC nor the VL for that QP. The fix is to place the QP into error state so that ULP can recreate the QP with the new SL->SC mapping. Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Kaike Wan <kaike.wan@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/staging/rdma/hfi1/mad.c')
-rw-r--r--drivers/staging/rdma/hfi1/mad.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/staging/rdma/hfi1/mad.c b/drivers/staging/rdma/hfi1/mad.c
index 2fcc9f3290d7..d9efe223328b 100644
--- a/drivers/staging/rdma/hfi1/mad.c
+++ b/drivers/staging/rdma/hfi1/mad.c
@@ -55,6 +55,7 @@
#include "hfi.h"
#include "mad.h"
#include "trace.h"
+#include "qp.h"
/* the reset value from the FM is supposed to be 0xffff, handle both */
#define OPA_LINK_WIDTH_RESET_OLD 0x0fff
@@ -1517,14 +1518,22 @@ static int __subn_set_opa_sl_to_sc(struct opa_smp *smp, u32 am, u8 *data,
struct hfi1_ibport *ibp = to_iport(ibdev, port);
u8 *p = data;
int i;
+ u8 sc;
if (am) {
smp->status |= IB_SMP_INVALID_FIELD;
return reply((struct ib_mad_hdr *)smp);
}
- for (i = 0; i < ARRAY_SIZE(ibp->sl_to_sc); i++)
- ibp->sl_to_sc[i] = *p++;
+ for (i = 0; i < ARRAY_SIZE(ibp->sl_to_sc); i++) {
+ sc = *p++;
+ if (ibp->sl_to_sc[i] != sc) {
+ ibp->sl_to_sc[i] = sc;
+
+ /* Put all stale qps into error state */
+ hfi1_error_port_qps(ibp, i);
+ }
+ }
return __subn_get_opa_sl_to_sc(smp, am, data, ibdev, port, resp_len);
}