rge: make rx_process_limit a sysctl tunable

The number of packets processed per interrupt was hardcoded to 16.
Add a per-interface sysctl dev.rge.%d.rx_process_limit tunable so
users can adjust this value at runtime.

Signed-off-by: Christos Longros <chris.longros@gmail.com>

Reviewed by:	ziaee, adrian
Differential Revision:	https://reviews.freebsd.org/D56014
This commit is contained in:
Christos Longros
2026-03-24 18:27:14 -07:00
committed by Adrian Chadd
parent 8f36a012d6
commit 930a790c2a
4 changed files with 14 additions and 1 deletions
+5
View File
@@ -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
+2 -1
View File
@@ -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);
+5
View File
@@ -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);
+2
View File
@@ -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;