From owner-p4-projects@FreeBSD.ORG Wed Dec 9 15:19:11 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BE27110656AA; Wed, 9 Dec 2009 15:19:10 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81A7C10656A7; Wed, 9 Dec 2009 15:19:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 53FDF8FC30; Wed, 9 Dec 2009 15:19:10 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 03CDD46B8B; Wed, 9 Dec 2009 10:19:10 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 51E718A021; Wed, 9 Dec 2009 10:19:09 -0500 (EST) From: John Baldwin To: Alexander Motin Date: Wed, 9 Dec 2009 10:16:26 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912091121.nB9BL0Rn082784@repoman.freebsd.org> In-Reply-To: <200912091121.nB9BL0Rn082784@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <200912091016.26737.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 09 Dec 2009 10:19:09 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Perforce Change Reviews Subject: Re: PERFORCE change 171561 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 15:19:11 -0000 On Wednesday 09 December 2009 6:21:00 am Alexander Motin wrote: > http://p4web.freebsd.org/chv.cgi?CH=171561 > > Change 171561 by mav@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