[ofa-general] [PATCH v2] RDMA/nes: Mitigate compatibility issue regarding PCI write credits

Chien Tung chien.tin.tung at intel.com
Tue Oct 28 17:28:53 PDT 2008


From: Chien Tung <chien.tin.tung at intel.com>

RDMA/nes: Mitigate compatibility issue regarding PCI write credits.

Under heavy load, there is an compatibility issue regarding PCI write
credits with certain chipsets.  It can be mitigated by limiting read
requests to 256 Bytes.

This workaround is always enabled for Tbird2 on Gladius.  Add a driver 
parameter to enable workaround for non-Gladius cards.

Signed-off-by: Chien Tung <chien.tin.tung at intel.com>
--
Roland,

Sorry, redirected the wrong patch in my mail script.
:wq
 drivers/infiniband/hw/nes/nes.c    |   17 +++++++++++++++++
 drivers/infiniband/hw/nes/nes_hw.h |    1 +
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
index a2b04d6..a2eb84b 100644
--- a/drivers/infiniband/hw/nes/nes.c
+++ b/drivers/infiniband/hw/nes/nes.c
@@ -95,6 +95,10 @@ unsigned int wqm_quanta = 0x10000;
 module_param(wqm_quanta, int, 0644);
 MODULE_PARM_DESC(wqm_quanta, "WQM quanta");
 
+static unsigned int limit_maxrdreqsz;
+module_param(limit_maxrdreqsz, int, 0644);
+MODULE_PARM_DESC(limit_maxrdreqsz, "Limit max read request size to 256B");
+
 LIST_HEAD(nes_adapter_list);
 static LIST_HEAD(nes_dev_list);
 
@@ -445,6 +449,7 @@ static int __devinit nes_probe(struct pci_dev *pcidev, const struct pci_device_i
 	struct nes_vnic *nesvnic = NULL;
 	void __iomem *mmio_regs = NULL;
 	u8 hw_rev;
+	u16 maxrdreqword;
 
 	assert(pcidev != NULL);
 	assert(ent != NULL);
@@ -588,6 +593,18 @@ static int __devinit nes_probe(struct pci_dev *pcidev, const struct pci_device_i
 						nesdev->nesadapter->port_count;
 	}
 
+	if ((limit_maxrdreqsz) ||
+		((nesdev->nesadapter->phy_type[0] == NES_PHY_TYPE_GLADIUS) &&
+		(hw_rev == NE020_REV1))) {
+		nes_debug(NES_DBG_INIT,
+			"Set max Read Request Size to 256 bytes\n");
+		pci_read_config_word(pcidev, 0x68, &maxrdreqword);
+		/* set bits 12-14 to 001b = 256 bytes */
+		maxrdreqword &= 0x8fff;
+		maxrdreqword |= 0x1000;
+		pci_write_config_word(pcidev, 0x68, maxrdreqword);
+	}
+
 	tasklet_init(&nesdev->dpc_tasklet, nes_dpc, (unsigned long)nesdev);
 
 	/* bring up the Control QP */
diff --git a/drivers/infiniband/hw/nes/nes_hw.h b/drivers/infiniband/hw/nes/nes_hw.h
index 610b9d8..bc0b4de 100644
--- a/drivers/infiniband/hw/nes/nes_hw.h
+++ b/drivers/infiniband/hw/nes/nes_hw.h
@@ -40,6 +40,7 @@
 #define NES_PHY_TYPE_ARGUS     4
 #define NES_PHY_TYPE_PUMA_1G   5
 #define NES_PHY_TYPE_PUMA_10G  6
+#define NES_PHY_TYPE_GLADIUS   7
 
 #define NES_MULTICAST_PF_MAX 8
 



More information about the general mailing list