From cb1c3491190fe021daca42a87ad76212f2f9ad59 Mon Sep 17 00:00:00 2001 From: Knut Omang Date: Tue, 28 Jun 2016 09:24:45 +0200 Subject: [PATCH] sif: Add a feature mask to allow internal vlink state to follow ext.links SIF implements an internal IB switch for each port - all HCA vPorts are connected to this switch, which again has a single external port associated with the actual state of the physical port. Some of the current management software assumes that a failed external port of an HCA can be observed by looking at the local port, which is not the case with SIF, where the local virtual port will not go down if the external link goes down. Firmware implements a mode to logically "wire" the vPort to the corresponding physical port to mimic the legacy behaviour. This mode can be enabled by OR'ing in 0x10000 in the module parameter feature_mask. This is a temporary fix until management software can handle this topology better. Orabug: 23509653 Signed-off-by: Knut Omang --- drivers/infiniband/hw/sif/sif_dev.h | 11 +++++++---- drivers/infiniband/hw/sif/sif_epsc.c | 5 +++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/sif/sif_dev.h b/drivers/infiniband/hw/sif/sif_dev.h index e07869ce3c76..b767004191c7 100644 --- a/drivers/infiniband/hw/sif/sif_dev.h +++ b/drivers/infiniband/hw/sif/sif_dev.h @@ -599,7 +599,7 @@ extern ulong sif_feature_mask; #define SIFF_no_huge_pages 0x80 /* Use stencil pqp for invalidation of FMR keys */ -#define SIFF_disable_stencil_invalidate 0x100 +#define SIFF_disable_stencil_invalidate 0x100 /* Force disable vpci iommu trapping (to operate as on real hardware..) */ #define SIFF_disable_vpci_iommu 0x400 @@ -616,11 +616,14 @@ extern ulong sif_feature_mask; /* Check all event queues on all interrupts */ #define SIFF_check_all_eqs_on_intr 0x8000 +/* Make all vlinks behave in sync with the correspondinding external port */ +#define SIFF_vlink_connect 0x10000 + /* Don't allocate vcbs in a round robin fashion */ -#define SIFF_alloc_cb_round_robin 0x20000 +#define SIFF_alloc_cb_round_robin 0x20000 /* Don't allocate from all other queues (except cb and qp) in a round robin fashion */ -#define SIFF_disable_alloc_round_robin 0x40000 +#define SIFF_disable_alloc_round_robin 0x40000 /* Default on rev1 is to force rnr_retry_init to 0 - this feature * forces it to 7 (infinite retry) instead: @@ -668,7 +671,7 @@ extern ulong sif_feature_mask; /* Configure PSIF to use the opposite base page size (e.g. 8K on x86 and 4K on sparc) */ #define SIFF_toggle_page_size 0x40000000 -#define SIFF_all_features 0x7ffeddfb +#define SIFF_all_features 0x7fffddfb #define sif_feature(x) (sif_feature_mask & (SIFF_##x)) diff --git a/drivers/infiniband/hw/sif/sif_epsc.c b/drivers/infiniband/hw/sif/sif_epsc.c index 70286d97ff83..01f79c87114e 100644 --- a/drivers/infiniband/hw/sif/sif_epsc.c +++ b/drivers/infiniband/hw/sif/sif_epsc.c @@ -717,6 +717,11 @@ int sif_eps_init(struct sif_dev *sdev, enum sif_tab_type type) sif_log(sdev, SIF_INFO, "Configure for big endian host"); lconfig.big_endian = 1; #endif + if (!sdev->is_vf && sif_feature(vlink_connect)) { + sif_log(sdev, SIF_INIT, "Associate all vlink state info with state of external port"); + lconfig.vlink_connect = 1; + } + lconfig.sparc_pages = (sdev->mi.page_size == 0x2000) ? 1 : 0; if (rsp_tp->mem->mem_type != SIFMT_BYPASS) { sif_log(sdev, SIF_INFO, -- 2.50.1