diff options
author | harti <harti@FreeBSD.org> | 2003-10-29 13:21:38 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2003-10-29 13:21:38 +0000 |
commit | bba7295376b2141ebdef24d4c7d958c4b5a4d4a7 (patch) | |
tree | 5f1a0d67a9cff35cb179f16fc412ff6a16126299 /sys/dev/hatm | |
parent | e0d0a97b8fc62bbf8d84b4ea74d6bf8673dfa51c (diff) | |
download | FreeBSD-src-bba7295376b2141ebdef24d4c7d958c4b5a4d4a7.zip FreeBSD-src-bba7295376b2141ebdef24d4c7d958c4b5a4d4a7.tar.gz |
We have some space in the external mbufs so use this space for
the external buffer reference count. This saves us a malloc() + free()
per small receive mbuf.
Diffstat (limited to 'sys/dev/hatm')
-rw-r--r-- | sys/dev/hatm/if_hatm_intr.c | 6 | ||||
-rw-r--r-- | sys/dev/hatm/if_hatmvar.h | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/hatm/if_hatm_intr.c b/sys/dev/hatm/if_hatm_intr.c index cf2bfd3..97c4e20 100644 --- a/sys/dev/hatm/if_hatm_intr.c +++ b/sys/dev/hatm/if_hatm_intr.c @@ -426,8 +426,9 @@ hatm_rx_buffer(struct hatm_softc *sc, u_int group, u_int handle) c0->hdr.chunkno, chunkno)); if (m != NULL) { + m->m_ext.ref_cnt = &c0->hdr.ref_cnt; m_extadd(m, (void *)c0, MBUF0_SIZE, - hatm_mbuf0_free, sc, M_PKTHDR, EXT_NET_DRV); + hatm_mbuf0_free, sc, M_PKTHDR, EXT_EXTREF); m->m_data += MBUF0_OFFSET; } else hatm_mbuf0_free(c0, sc); @@ -442,8 +443,9 @@ hatm_rx_buffer(struct hatm_softc *sc, u_int group, u_int handle) c1->hdr.chunkno, chunkno)); if (m != NULL) { + m->m_ext.ref_cnt = &c1->hdr.ref_cnt; m_extadd(m, (void *)c1, MBUF1_SIZE, - hatm_mbuf1_free, sc, M_PKTHDR, EXT_NET_DRV); + hatm_mbuf1_free, sc, M_PKTHDR, EXT_EXTREF); m->m_data += MBUF1_OFFSET; } else hatm_mbuf1_free(c1, sc); diff --git a/sys/dev/hatm/if_hatmvar.h b/sys/dev/hatm/if_hatmvar.h index d821923..7686e48 100644 --- a/sys/dev/hatm/if_hatmvar.h +++ b/sys/dev/hatm/if_hatmvar.h @@ -275,6 +275,7 @@ struct mbuf_page { struct mbuf_chunk_hdr { uint16_t pageno; uint16_t chunkno; + u_int ref_cnt; }; #define MBUFX_STORAGE_SIZE(X) (MBUF##X##_CHUNK \ |