summaryrefslogtreecommitdiffstats
path: root/sys/dev/hatm
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2003-10-29 15:07:10 +0000
committerharti <harti@FreeBSD.org>2003-10-29 15:07:10 +0000
commitaa5acc483c0b0938d52f4204f3801db5b80a63f7 (patch)
tree2d348cd1b7cb29d107b8a8052df21a81c637af3b /sys/dev/hatm
parentb9fecc82d3e55cefb5fd427307272fed377b780a (diff)
downloadFreeBSD-src-aa5acc483c0b0938d52f4204f3801db5b80a63f7.zip
FreeBSD-src-aa5acc483c0b0938d52f4204f3801db5b80a63f7.tar.gz
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.
Diffstat (limited to 'sys/dev/hatm')
-rw-r--r--sys/dev/hatm/if_hatm.c6
-rw-r--r--sys/dev/hatm/if_hatm_intr.c2
-rw-r--r--sys/dev/hatm/if_hatmvar.h1
3 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/hatm/if_hatm.c b/sys/dev/hatm/if_hatm.c
index 24a0488..d2c1222 100644
--- a/sys/dev/hatm/if_hatm.c
+++ b/sys/dev/hatm/if_hatm.c
@@ -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);
}
diff --git a/sys/dev/hatm/if_hatm_intr.c b/sys/dev/hatm/if_hatm_intr.c
index b359ecb..088eef4 100644
--- a/sys/dev/hatm/if_hatm_intr.c
+++ b/sys/dev/hatm/if_hatm_intr.c
@@ -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;
diff --git a/sys/dev/hatm/if_hatmvar.h b/sys/dev/hatm/if_hatmvar.h
index 2f4bfc2..ed1566a 100644
--- a/sys/dev/hatm/if_hatmvar.h
+++ b/sys/dev/hatm/if_hatmvar.h
@@ -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 */
OpenPOWER on IntegriCloud