diff options
author | kmacy <kmacy@FreeBSD.org> | 2007-04-15 05:45:10 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2007-04-15 05:45:10 +0000 |
commit | 8d122756a538d65bca202fd865424562835413ec (patch) | |
tree | 0549405bc7b17e50dc2d206e9e3914b1f72194c4 /sys/dev | |
parent | f6d283a04eaf5e94c6cafcce7175750d0ac4b105 (diff) | |
download | FreeBSD-src-8d122756a538d65bca202fd865424562835413ec.zip FreeBSD-src-8d122756a538d65bca202fd865424562835413ec.tar.gz |
Add sysctl for disabling/enabling mbuf chain collapsing
remove map creation before calling bus_dmamap_load_mvec_sg
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/cxgb/cxgb_main.c | 5 | ||||
-rw-r--r-- | sys/dev/cxgb/cxgb_sge.c | 14 |
2 files changed, 8 insertions, 11 deletions
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index 26bfdd3..0345a79 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -167,6 +167,7 @@ DRIVER_MODULE(cxgb, cxgbc, cxgb_port_driver, cxgb_port_devclass, 0, 0); #define SGE_MSIX_COUNT (SGE_QSETS + 1) +extern int collapse_mbufs; /* * The driver uses the best interrupt scheme available on a platform in the * order MSI-X, MSI, legacy pin interrupts. This parameter determines which @@ -1339,8 +1340,8 @@ cxgb_start_tx(struct ifnet *ifp, uint32_t txmax) } m_sanity(m0, 0); m0 = m; -#endif - if (m->m_pkthdr.len > MCLBYTES && +#endif + if (collapse_mbufs && m->m_pkthdr.len > MCLBYTES && m_collapse(m, TX_MAX_SEGS, &m0) == EFBIG) { if ((m0 = m_defrag(m, M_NOWAIT)) != NULL) { m = m0; diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 8524fbf..d95c4ca 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); uint32_t collapse_free = 0; uint32_t mb_free_vec_free = 0; - +int collapse_mbufs = 1; #define USE_GTS 0 @@ -837,13 +837,6 @@ busdma_map_mbufs(struct mbuf **m, struct sge_txq *txq, m0 = *m; pktlen = m0->m_pkthdr.len; - if ((stx->flags & TX_SW_DESC_MAP_CREATED) == 0) { - if ((err = bus_dmamap_create(txq->entry_tag, 0, &stx->map))) { - log(LOG_WARNING, "bus_dmamap_create failed %d\n", err); - return (err); - } - stx->flags |= TX_SW_DESC_MAP_CREATED; - } err = bus_dmamap_load_mvec_sg(txq->entry_tag, stx->map, m0, segs, nsegs, 0); #ifdef DEBUG if (err) { @@ -2264,7 +2257,10 @@ t3_add_sysctls(adapter_t *sc) "mb_free_vec_free", CTLFLAG_RD, &mb_free_vec_free, 0, "frees during mb_free_vec"); - + SYSCTL_ADD_INT(ctx, children, OID_AUTO, + "collapse_mbufs", + CTLFLAG_RW, &collapse_mbufs, + 0, "collapse mbuf chains into iovecs"); } /** |