[ofa-general] Re: [PATCH v2] RDMA/nes: Mitigate compatibility issue regarding PCI write credits
Roland Dreier
rdreier at cisco.com
Tue Oct 28 18:13:48 PDT 2008
> 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.
OK.
> +module_param(limit_maxrdreqsz, int, 0644);
type can be bool instead of int here?
> + if ((limit_maxrdreqsz) ||
> + ((nesdev->nesadapter->phy_type[0] == NES_PHY_TYPE_GLADIUS) &&
> + (hw_rev == NE020_REV1))) {
> + nes_debug(NES_DBG_INIT,
This indentation is hard to read, because the then clause visually runs
into the condition being tested. I generally align the follow-on lines
to be just inside the opening ( of "if (". And there's no reason to put
parentheses around limit_maxrdreqsz...
> + 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);
I would write this as below, using the standard pcie interfaces and also
being defensive so as not to set the max read req to 256 if the
BIOS/kernel had limited it to 128 already:
if (pcie_get_readrq(pcidev) > 256)
if (pcie_set_readrq(pcidev, 256)) {
/* report error */
}
- R.
More information about the general
mailing list