RDMA/nes: Mitigate compatibility issue regarding PCIe write credits

Under heavy load, there is an compatibility issue regarding PCIe 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. We also add
a module parameter to enable workaround for non-Gladius cards.

Signed-off-by: Chien Tung <chien.tin.tung@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

authored by

Chien Tung and committed by
Roland Dreier
63369366 2e369544

+17
+16
drivers/infiniband/hw/nes/nes.c
··· 95 module_param(wqm_quanta, int, 0644); 96 MODULE_PARM_DESC(wqm_quanta, "WQM quanta"); 97 98 LIST_HEAD(nes_adapter_list); 99 static LIST_HEAD(nes_dev_list); 100 ··· 590 } else { 591 nesdev->mac_index = PCI_FUNC(nesdev->pcidev->devfn) % 592 nesdev->nesadapter->port_count; 593 } 594 595 tasklet_init(&nesdev->dpc_tasklet, nes_dpc, (unsigned long)nesdev);
··· 95 module_param(wqm_quanta, int, 0644); 96 MODULE_PARM_DESC(wqm_quanta, "WQM quanta"); 97 98 + static unsigned int limit_maxrdreqsz; 99 + module_param(limit_maxrdreqsz, bool, 0644); 100 + MODULE_PARM_DESC(limit_maxrdreqsz, "Limit max read request size to 256 Bytes"); 101 + 102 LIST_HEAD(nes_adapter_list); 103 static LIST_HEAD(nes_dev_list); 104 ··· 586 } else { 587 nesdev->mac_index = PCI_FUNC(nesdev->pcidev->devfn) % 588 nesdev->nesadapter->port_count; 589 + } 590 + 591 + if ((limit_maxrdreqsz || 592 + ((nesdev->nesadapter->phy_type[0] == NES_PHY_TYPE_GLADIUS) && 593 + (hw_rev == NE020_REV1))) && 594 + (pcie_get_readrq(pcidev) > 256)) { 595 + if (pcie_set_readrq(pcidev, 256)) 596 + printk(KERN_ERR PFX "Unable to set max read request" 597 + " to 256 bytes\n"); 598 + else 599 + nes_debug(NES_DBG_INIT, "Max read request size set" 600 + " to 256 bytes\n"); 601 } 602 603 tasklet_init(&nesdev->dpc_tasklet, nes_dpc, (unsigned long)nesdev);
+1
drivers/infiniband/hw/nes/nes_hw.h
··· 40 #define NES_PHY_TYPE_ARGUS 4 41 #define NES_PHY_TYPE_PUMA_1G 5 42 #define NES_PHY_TYPE_PUMA_10G 6 43 44 #define NES_MULTICAST_PF_MAX 8 45
··· 40 #define NES_PHY_TYPE_ARGUS 4 41 #define NES_PHY_TYPE_PUMA_1G 5 42 #define NES_PHY_TYPE_PUMA_10G 6 43 + #define NES_PHY_TYPE_GLADIUS 7 44 45 #define NES_MULTICAST_PF_MAX 8 46