Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jul 2007 20:09:15 -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:  <09BFF2FA5EAB4A45B6655E151BBDD9030483F5D2@NT-IRVA-0750.brcm.ad.broadcom.com>
In-Reply-To: <20070719002218.GA42405@cdnetworks.co.kr>
References:  <09BFF2FA5EAB4A45B6655E151BBDD9030483F161@NT-IRVA-0750.brcm.ad.broadcom.com> <20070718021839.GA37935@cdnetworks.co.kr> <09BFF2FA5EAB4A45B6655E151BBDD9030483F437@NT-IRVA-0750.brcm.ad.broadcom.com> <20070719002218.GA42405@cdnetworks.co.kr>

next in thread | previous in thread | raw e-mail | index | archive | help
>  > Thanks Pyun but I'm really just looking for a way to test=20
> that I can
>  > handle the number of segments I've advertised that I can=20
> 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=20
> a utility
>  > such as "stress" would help fragment memory and force more variable
>  > responses but that hasn't happened yet.
>  >=20
>=20
> It seems you've used the following code to create jumbo dma tag.
>         /*
>          * Create a DMA tag for RX mbufs.
>          */
>         if (bus_dma_tag_create(sc->parent_tag,
>                         1,
>                         BCE_DMA_BOUNDARY,
>                         sc->max_bus_addr,
>                         BUS_SPACE_MAXADDR,
>                         NULL, NULL,
>                         MJUM9BYTES,
>                         BCE_MAX_SEGMENTS,
>                         MJUM9BYTES,
>                         ^^^^^^^^^^
>                         0,
>                         NULL, NULL,
>                 &sc->rx_mbuf_tag)) {
>                 BCE_PRINTF("%s(%d): Could not allocate RX=20
> mbuf DMA tag!\n",
>                         __FILE__, __LINE__);
>                 rc =3D ENOMEM;
>                 goto bce_dma_alloc_exit;
>         }
> If you want to have > 9 dma segements change maxsegsz(MJUM9BYTES) to
> 1024. bus_dma honors maxsegsz argument so you wouldn't get a dma
> segments larger than maxsegsz. With MJUM9BYTES maxsegsz you would get
> up to 4 dma segments on systems with 4K PAGE_SIZE.(You would have
> got up to 3 dma segements if you used PAGE_SIZE alignment argument.)

I don't want more segments, I just want to get a distribution of
segments
up to the max size I specified.  For example, since my BCE_MAX_SEGMENTS=20
size is 8, I want to make sure I get mbufs that are spread over 1, 2, 3,
4, 5, 6, 7, and 8 segments. =20

It turns out if I reduce the amount of memory in the system (from 8GB to
2GB) I will get more mbufs coalesced into 2 segments, rather than the
more typical 3 segments, but that's good enough for my testing now.

Dave




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?09BFF2FA5EAB4A45B6655E151BBDD9030483F5D2>