svn commit: r254386 - user/np/cxl_tuning/sys/dev/cxgbe
Navdeep Parhar
np at FreeBSD.org
Thu Aug 15 21:48:30 UTC 2013
Author: np
Date: Thu Aug 15 21:48:29 2013
New Revision: 254386
URL: http://svnweb.freebsd.org/changeset/base/254386
Log:
Flush inactive LRO entries periodically.
Modified:
user/np/cxl_tuning/sys/dev/cxgbe/adapter.h
user/np/cxl_tuning/sys/dev/cxgbe/t4_main.c
user/np/cxl_tuning/sys/dev/cxgbe/t4_sge.c
Modified: user/np/cxl_tuning/sys/dev/cxgbe/adapter.h
==============================================================================
--- user/np/cxl_tuning/sys/dev/cxgbe/adapter.h Thu Aug 15 21:24:43 2013 (r254385)
+++ user/np/cxl_tuning/sys/dev/cxgbe/adapter.h Thu Aug 15 21:48:29 2013 (r254386)
@@ -559,6 +559,7 @@ struct adapter {
bus_dma_tag_t dmat; /* Parent DMA tag */
struct sge sge;
+ int lro_timeout;
struct taskqueue *tq[NCHAN]; /* taskqueues that flush data out */
struct port_info *port[MAX_NPORTS];
Modified: user/np/cxl_tuning/sys/dev/cxgbe/t4_main.c
==============================================================================
--- user/np/cxl_tuning/sys/dev/cxgbe/t4_main.c Thu Aug 15 21:24:43 2013 (r254385)
+++ user/np/cxl_tuning/sys/dev/cxgbe/t4_main.c Thu Aug 15 21:48:29 2013 (r254386)
@@ -4230,6 +4230,10 @@ t4_sysctls(struct adapter *sc)
t4_sge_sysctls(sc, ctx, children);
+ sc->lro_timeout = 100;
+ SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lro_timeout", CTLFLAG_RW,
+ &sc->lro_timeout, 0, "lro inactive-flush timeout (in us)");
+
#ifdef SBUF_DRAIN
/*
* dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload.
Modified: user/np/cxl_tuning/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- user/np/cxl_tuning/sys/dev/cxgbe/t4_sge.c Thu Aug 15 21:24:43 2013 (r254385)
+++ user/np/cxl_tuning/sys/dev/cxgbe/t4_sge.c Thu Aug 15 21:48:29 2013 (r254386)
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/queue.h>
#include <sys/taskqueue.h>
+#include <sys/time.h>
#include <sys/sysctl.h>
#include <sys/smp.h>
#include <net/bpf.h>
@@ -1006,6 +1007,7 @@ service_iq(struct sge_iq *iq, int budget
uint32_t lq;
struct mbuf *m0;
STAILQ_HEAD(, sge_iq) iql = STAILQ_HEAD_INITIALIZER(iql);
+ const struct timeval lro_timeout = {0, sc->lro_timeout};
limit = budget ? budget : iq->qsize / 8;
@@ -1095,6 +1097,14 @@ service_iq(struct sge_iq *iq, int budget
V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX)));
ndescs = 0;
+#if defined(INET) || defined(INET6)
+ if (iq->flags & IQ_LRO_ENABLED &&
+ sc->lro_timeout != 0) {
+ tcp_lro_flush_inactive(&rxq->lro,
+ &lro_timeout);
+ }
+#endif
+
if (fl_bufs_used > 0) {
FL_LOCK(fl);
fl->needed += fl_bufs_used;
More information about the svn-src-user
mailing list