PERFORCE change 171561 for review
John Baldwin
jhb at freebsd.org
Wed Dec 9 15:19:11 UTC 2009
On Wednesday 09 December 2009 6:21:00 am Alexander Motin wrote:
> http://p4web.freebsd.org/chv.cgi?CH=171561
>
> Change 171561 by mav at mav_mavtest on 2009/12/09 11:20:05
>
> Increase Max Read Request Size for PCIe chips to 1024 bytes.
> It gives those slow beasts additional 10% of write bandwidth.
We should probably add a method in pci.c to do this ala
pci_enable_busmaster(). Several drivers have cut and pasted similar versions
of this code that I think it warrants having a common function now.
> Affected files ...
>
> .. //depot/projects/scottl-camlock/src/sys/dev/siis/siis.c#30 edit
>
> Differences ...
>
> ==== //depot/projects/scottl-camlock/src/sys/dev/siis/siis.c#30 (text+ko)
====
>
> @@ -231,7 +231,20 @@
> siis_resume(device_t dev)
> {
> struct siis_controller *ctlr = device_get_softc(dev);
> + int cap;
> + uint16_t val;
>
> + /* Set PCIe max read request size to at least 1024 bytes */
> + if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) == 0) {
> + val = pci_read_config(dev,
> + cap + PCIR_EXPRESS_DEVICE_CTL, 2);
> + if ((val & PCIM_EXP_CTL_MAX_READ_REQUEST) < 0x3000) {
> + val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST;
> + val |= 0x3000;
> + pci_write_config(dev,
> + cap + PCIR_EXPRESS_DEVICE_CTL, val, 2);
> + }
> + }
> /* Put controller into reset state. */
> ctlr->gctl |= SIIS_GCTL_GRESET;
> ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, ctlr->gctl);
>
--
John Baldwin
More information about the p4-projects
mailing list