aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Longros <chris.longros@gmail.com>2026-03-25 01:27:14 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2026-03-25 01:27:14 +0000
commit930a790c2abb3680a3449a1f9ce2eff2be7acc36 (patch)
treeae3653d01d8631ff9fea3c5434f0598d320fc9a6
parent8f36a012d65f1a3c4e071c3396ecc7a963485637 (diff)
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
-rw-r--r--share/man/man4/rge.45
-rw-r--r--sys/dev/rge/if_rge.c3
-rw-r--r--sys/dev/rge/if_rge_sysctl.c5
-rw-r--r--sys/dev/rge/if_rgevar.h2
4 files changed, 14 insertions, 1 deletions
diff --git a/share/man/man4/rge.4 b/share/man/man4/rge.4
index eea49e12af78..2b781e287e3c 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 5ae0b98f95a1..0007b07e0fa6 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 a7d6e1572168..16001b4c1d94 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 d516537e6524..89d02e8acb72 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;