summaryrefslogtreecommitdiffstats
path: root/sys/dev/bge
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2008-04-26 10:54:17 +0000
committermarius <marius@FreeBSD.org>2008-04-26 10:54:17 +0000
commit2381edc5468ff27df84fcf44a3cf35b65691e9d7 (patch)
treeb27d17501e9aafdad1a65a208a9939b233ad94bf /sys/dev/bge
parent48f71015801f296e0d4a8ee0406339e0e17daf9f (diff)
downloadFreeBSD-src-2381edc5468ff27df84fcf44a3cf35b65691e9d7.zip
FreeBSD-src-2381edc5468ff27df84fcf44a3cf35b65691e9d7.tar.gz
- Use more appropriate maxsize, nsegments and maxsegsize parameters
when creating the parent bus DMA tag. While at it correct the style and a nearby comment. - Take advantage of m_collapse(9) for performance reasons. MFC after: 2 weeks
Diffstat (limited to 'sys/dev/bge')
-rw-r--r--sys/dev/bge/if_bge.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index b0238f7..8d31cfb 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -1894,16 +1894,10 @@ bge_dma_alloc(device_t dev)
/*
* Allocate the parent bus DMA tag appropriate for PCI.
*/
- error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), /* parent */
- 1, 0, /* alignment, boundary */
- BUS_SPACE_MAXADDR, /* lowaddr */
- BUS_SPACE_MAXADDR, /* highaddr */
- NULL, NULL, /* filter, filterarg */
- MAXBSIZE, BGE_NSEG_NEW, /* maxsize, nsegments */
- BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */
- 0, /* flags */
- NULL, NULL, /* lockfunc, lockarg */
- &sc->bge_cdata.bge_parent_tag);
+ error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev),
+ 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL,
+ NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT,
+ 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag);
if (error != 0) {
device_printf(sc->bge_dev,
@@ -1912,7 +1906,7 @@ bge_dma_alloc(device_t dev)
}
/*
- * Create tag for RX mbufs.
+ * Create tag for mbufs.
*/
error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1,
0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL,
@@ -3402,7 +3396,7 @@ bge_encap(struct bge_softc *sc, struct mbuf **m_head, uint32_t *txidx)
error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_mtag, map, m, segs,
&nsegs, BUS_DMA_NOWAIT);
if (error == EFBIG) {
- m = m_defrag(m, M_DONTWAIT);
+ m = m_collapse(m, M_DONTWAIT, BGE_NSEG_NEW);
if (m == NULL) {
m_freem(*m_head);
*m_head = NULL;
OpenPOWER on IntegriCloud