diff options
author | np <np@FreeBSD.org> | 2014-05-06 04:22:06 +0000 |
---|---|---|
committer | np <np@FreeBSD.org> | 2014-05-06 04:22:06 +0000 |
commit | c4599dcf4454fdbbe5a70d7dc29c5ee3efa6a415 (patch) | |
tree | 9e52b5d9ec646c6eaa0cac167c290ab282597f6d | |
parent | 7174ef8bb75f38064cdd7a201205bdcb453dcd9a (diff) | |
download | FreeBSD-src-c4599dcf4454fdbbe5a70d7dc29c5ee3efa6a415.zip FreeBSD-src-c4599dcf4454fdbbe5a70d7dc29c5ee3efa6a415.tar.gz |
MFC r260210 (by adrian@):
Add an option to enable or disable the small RX packet copying that
is done to improve performance of small frames.
When doing RX packing, the RX copying isn't necessarily required.
-rw-r--r-- | sys/dev/cxgbe/adapter.h | 2 | ||||
-rw-r--r-- | sys/dev/cxgbe/t4_main.c | 4 | ||||
-rw-r--r-- | sys/dev/cxgbe/t4_sge.c | 4 |
3 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index b7a9cce..29e139b 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -643,6 +643,8 @@ struct adapter { const char *last_op; const void *last_op_thr; #endif + + int sc_do_rxcopy; }; #define ADAPTER_LOCK(sc) mtx_lock(&(sc)->sc_lock) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index f7563fa..3211c5d 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -4207,6 +4207,10 @@ t4_sysctls(struct adapter *sc) oid = device_get_sysctl_tree(sc->dev); c0 = children = SYSCTL_CHILDREN(oid); + sc->sc_do_rxcopy = 1; + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "do_rx_copy", CTLFLAG_RW, + &sc->sc_do_rxcopy, 1, "Do RX copy of small frames"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nports", CTLFLAG_RD, NULL, sc->params.nports, "# of ports"); diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index f4662b3..a9bdb0e 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -1450,7 +1450,7 @@ get_fl_payload1(struct adapter *sc, struct sge_fl *fl, uint32_t len_newbuf, bus_dmamap_sync(fl->tag[sd->tag_idx], sd->map, BUS_DMASYNC_POSTREAD); - if (len < RX_COPY_THRESHOLD) { + if (sc->sc_do_rxcopy && (len < RX_COPY_THRESHOLD)) { #ifdef T4_PKT_TIMESTAMP /* Leave room for a timestamp */ m0->m_data += 8; @@ -1601,7 +1601,7 @@ get_fl_payload2(struct adapter *sc, struct sge_fl *fl, uint32_t len_newbuf, bus_dmamap_sync(fl->tag[sd->tag_idx], sd->map, BUS_DMASYNC_POSTREAD); - if (len < RX_COPY_THRESHOLD) { + if (sc->sc_do_rxcopy && (len < RX_COPY_THRESHOLD)) { #ifdef T4_PKT_TIMESTAMP /* Leave room for a timestamp */ m0->m_data += 8; |