diff options
author | np <np@FreeBSD.org> | 2013-08-29 06:26:22 +0000 |
---|---|---|
committer | np <np@FreeBSD.org> | 2013-08-29 06:26:22 +0000 |
commit | a52be00b7f7e336eb3883b40cdc6cf73571f0c4e (patch) | |
tree | 8fbb4baf10137866d6f22b77f18d61819c2369b7 /sys/dev/cxgbe | |
parent | a90a8d62c1a18ef01246ea49cb31c8e20d5b52ff (diff) | |
download | FreeBSD-src-a52be00b7f7e336eb3883b40cdc6cf73571f0c4e.zip FreeBSD-src-a52be00b7f7e336eb3883b40cdc6cf73571f0c4e.tar.gz |
Merge r254386 from user/np/cxl_tuning. Add an INET|INET6 check missing
in said revision.
r254386:
Flush inactive LRO entries periodically.
Diffstat (limited to 'sys/dev/cxgbe')
-rw-r--r-- | sys/dev/cxgbe/adapter.h | 1 | ||||
-rw-r--r-- | sys/dev/cxgbe/t4_main.c | 4 | ||||
-rw-r--r-- | sys/dev/cxgbe/t4_sge.c | 12 |
3 files changed, 17 insertions, 0 deletions
diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index f121ec8..ba956c4 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -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]; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index f2d1986..d905cd5 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -4229,6 +4229,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. diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index c5aeff9..34bd27a 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -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,9 @@ service_iq(struct sge_iq *iq, int budget) uint32_t lq; struct mbuf *m0; STAILQ_HEAD(, sge_iq) iql = STAILQ_HEAD_INITIALIZER(iql); +#if defined(INET) || defined(INET6) + const struct timeval lro_timeout = {0, sc->lro_timeout}; +#endif limit = budget ? budget : iq->qsize / 8; @@ -1111,6 +1115,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; |