Add sysctl for disabling/enabling mbuf chain collapsing

remove map creation before calling bus_dmamap_load_mvec_sg
This commit is contained in:
Kip Macy 2007-04-15 05:45:10 +00:00
parent 52c81add3c
commit d43f50b93a
2 changed files with 8 additions and 11 deletions

View File

@ -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;

View File

@ -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");
}
/**