diff --git a/share/man/man4/rge.4 b/share/man/man4/rge.4 index eea49e12af7..2b781e287e3 100644 --- a/share/man/man4/rge.4 +++ b/share/man/man4/rge.4 @@ -147,6 +147,11 @@ tunables: .Bl -tag -width "xxxxxx" .It Va dev.rge.%d.debug Configure runtime debug output. This is a 32 bit bitmask. +.It Va dev.rge.%d.rx_process_limit +Maximum number of RX packets to process per interrupt. +The default value is 16. +Increasing this value may improve throughput on high-speed links at the +cost of increased interrupt latency. .El .Sh DIAGNOSTICS .Bl -diag diff --git a/sys/dev/rge/if_rge.c b/sys/dev/rge/if_rge.c index 5ae0b98f95a..0007b07e0fa 100644 --- a/sys/dev/rge/if_rge.c +++ b/sys/dev/rge/if_rge.c @@ -2099,9 +2099,10 @@ rge_rxeof(struct rge_queues *q, struct mbufq *mq) uint32_t rxstat, extsts; int i, mlen, rx = 0; int cons, prod; - int maxpkt = 16; /* XXX TODO: make this a tunable */ + int maxpkt; bool check_hwcsum; + maxpkt = sc->sc_rx_process_limit; check_hwcsum = ((if_getcapenable(sc->sc_ifp) & IFCAP_RXCSUM) != 0); RGE_ASSERT_LOCKED(sc); diff --git a/sys/dev/rge/if_rge_sysctl.c b/sys/dev/rge/if_rge_sysctl.c index a7d6e157216..16001b4c1d9 100644 --- a/sys/dev/rge/if_rge_sysctl.c +++ b/sys/dev/rge/if_rge_sysctl.c @@ -232,6 +232,11 @@ rge_sysctl_attach(struct rge_softc *sc) "debug", CTLFLAG_RW, &sc->sc_debug, 0, "control debugging printfs"); + sc->sc_rx_process_limit = 16; + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "rx_process_limit", CTLFLAG_RW, &sc->sc_rx_process_limit, 0, + "max number of RX packets to process per interrupt"); + /* Stats */ rge_sysctl_drv_stats_attach(sc); rge_sysctl_mac_stats_attach(sc); diff --git a/sys/dev/rge/if_rgevar.h b/sys/dev/rge/if_rgevar.h index d516537e652..89d02e8acb7 100644 --- a/sys/dev/rge/if_rgevar.h +++ b/sys/dev/rge/if_rgevar.h @@ -204,6 +204,8 @@ struct rge_softc { uint32_t sc_debug; + int sc_rx_process_limit; + struct rge_drv_stats sc_drv_stats; struct rge_mac_stats sc_mac_stats;