1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-14 14:55:41 +00:00

Make the maximum number of pages for external mbufs configurable in

the kernel environment and accessible as a RO sysctl.

Explain that the HE155 will not work in 64-bit/66MHz slots, but may work
in 64-bit/33MHz slots.
This commit is contained in:
Hartmut Brandt 2003-10-29 15:07:10 +00:00
parent 59dfcba4aa
commit 278bc3c3a9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121685
4 changed files with 13 additions and 4 deletions

View File

@ -201,11 +201,15 @@ Maximum number of active TPDs per connection. This controls the maximum
number of outstanding packet chunks per connection and thus the maximum
delay packets can have because of queueing on the adapter. If set to 0,
a connection can eat up all available TPDs.
.It Cm hw.hatmN.mbuf_max_pages
Maximum number of memory pages allocated to small external mbufs.
This must not be zero and not larger than 65536.
.El
.Sh CAVEATS
When putting a HE155 into a 64-bit 66MHz PCI slot the machine may hang.
This occures very early in the POST so that even the display does not
turn on. HE622 cards work just fine in 64-bit slots.
This occures very early in the POST so that even the display does not turn on.
The HE155 runs only in 33MHz slots (either 32 or 64-bit).
HE622 cards work just fine in 64-bit slots.
.Pp
The driver may not work with bounce buffer, because of
.Fn bus_dma_sync

View File

@ -329,7 +329,7 @@ static void
hatm_init_smbufs(struct hatm_softc *sc)
{
sc->mbuf_pages = malloc(sizeof(sc->mbuf_pages[0]) *
HE_CONFIG_MAX_MBUF_PAGES, M_DEVBUF, M_WAITOK);
sc->mbuf_max_pages, M_DEVBUF, M_WAITOK);
sc->mbuf_npages = 0;
}
@ -1388,6 +1388,10 @@ hatm_configure(struct hatm_softc *sc)
kenv_getuint(sc, "tpdmax", &sc->max_tpd,
HE_CONFIG_TPD_MAXCC, 0);
/* external mbuf pages */
kenv_getuint(sc, "max_mbuf_pages", &sc->mbuf_max_pages,
HE_CONFIG_MAX_MBUF_PAGES, 0);
return (0);
}

View File

@ -175,7 +175,7 @@ hatm_mbuf_page_alloc(struct hatm_softc *sc, u_int group)
int err;
u_int i;
if (sc->mbuf_npages == HE_CONFIG_MAX_MBUF_PAGES)
if (sc->mbuf_npages == sc->mbuf_max_pages))
return;
if ((pg = malloc(MBUF_ALLOC_SIZE, M_DEVBUF, M_NOWAIT)) == NULL)
return;

View File

@ -422,6 +422,7 @@ struct hatm_softc {
bus_dma_tag_t mbuf_tag;
struct mbuf_page **mbuf_pages;
u_int mbuf_npages;
u_int mbuf_max_pages;
struct mbufx_free *mbuf_list[2];
/* mbuf cluster tracking and mapping for group 0 */