Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Jan 2014 23:23:33 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r260210 - head/sys/dev/cxgbe
Message-ID:  <201401022323.s02NNXrd041931@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Thu Jan  2 23:23:33 2014
New Revision: 260210
URL: http://svnweb.freebsd.org/changeset/base/260210

Log:
  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.
  
  Reviewed by:	np

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/adapter.h
==============================================================================
--- head/sys/dev/cxgbe/adapter.h	Thu Jan  2 23:17:48 2014	(r260209)
+++ head/sys/dev/cxgbe/adapter.h	Thu Jan  2 23:23:33 2014	(r260210)
@@ -646,6 +646,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)

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Thu Jan  2 23:17:48 2014	(r260209)
+++ head/sys/dev/cxgbe/t4_main.c	Thu Jan  2 23:23:33 2014	(r260210)
@@ -4239,6 +4239,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");
 

Modified: head/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- head/sys/dev/cxgbe/t4_sge.c	Thu Jan  2 23:17:48 2014	(r260209)
+++ head/sys/dev/cxgbe/t4_sge.c	Thu Jan  2 23:23:33 2014	(r260210)
@@ -1447,7 +1447,7 @@ get_fl_payload1(struct adapter *sc, stru
 
 		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;
@@ -1598,7 +1598,7 @@ get_fl_payload2(struct adapter *sc, stru
 
 	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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401022323.s02NNXrd041931>