Date: Wed, 18 Jul 2007 11:50:02 -0700 From: "David Christensen" <davidch@broadcom.com> To: pyunyh@gmail.com Cc: current@freebsd.org Subject: RE: Getting/Forcing Greater than 4KB Buffer Allocations Message-ID: <09BFF2FA5EAB4A45B6655E151BBDD9030483F437@NT-IRVA-0750.brcm.ad.broadcom.com> In-Reply-To: <20070718021839.GA37935@cdnetworks.co.kr> References: <09BFF2FA5EAB4A45B6655E151BBDD9030483F161@NT-IRVA-0750.brcm.ad.broadcom.com> <20070718021839.GA37935@cdnetworks.co.kr>
next in thread | previous in thread | raw e-mail | index | archive | help
> On Tue, Jul 17, 2007 at 04:54:31PM -0700, David Christensen wrote: > > I'm investigating a problem with my bce driver which=20 > occurs when I ask > > for a jumbo > > mbuf cluster (through m_cljget()). When I map the memory for DMA I > > normally=20 > > get 3 memory segments (4KB + 4KB + 1KB) on my system, but=20 > on another > > user's=20 > > system he's seeing 2 memory segments (8KB + 1KB). Is there a > > configuration > > option that allows this or some other tuning variable=20 > involved? The > > system is a=20 > > Xeon dual-core processor and has 8GB of RAM, running an=20 > AMD64 version of > > the kernel. > > =20 >=20 > I've briefly looked over bus_dma usage on bce(4). It seems that you > told bus_dma the the dma map could be made up of BCE_MAX_SEGMENTS > segments, where a dma segment could be MJUM9BYTES bytes. If you want > just two segments you may have to use 2 instead of BCE_MAX_SEGMENTS. > If the hardware can support up to BCE_MAX_SEGMENTS dma segments on Rx > descriptors you should be prepared to handle that number of dma > segments too(e.g. You don't know how may dma segments would be > returned by bus_dma, you just know the upper bound as you specified > in bus_dma_tag_create()). > If the hardware can handle just up to 4KB for a dma segment you > should tell bus_dma the restriction of the dma segment. > If you have to get a single dma segment that covers MJUM9BYTES bytes > due to the limitation of the hardware you may have to use local > allocator. >=20 Thanks Pyun but I'm really just looking for a way to test that I can handle the number of segments I've advertised that I can support. I=20 believe my code is correct but when all I see are allocations of 3=20 segments I just can't prove it. I was hoping that running a utility such as "stress" would help fragment memory and force more variable responses but that hasn't happened yet. Dave
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?09BFF2FA5EAB4A45B6655E151BBDD9030483F437>