From nobody Wed Sep 16 17:12:40 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hlQS864Rpz6s369 for ; Wed, 16 Sep 2026 17:12:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hlQS82rM8z3Gqd for ; Wed, 16 Sep 2026 17:12:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789578760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gZlYO0PL9SvApc3ybWa9grEPnfr7fUTwcVMdjKnqCAU=; b=m41Qq/gTXvHI2ZE8q34/LeJwSmVSw7EMUU2QTJnPBhEfnqRhsXK2hEUM4glr6J7d2YTpqm GvKym+1+LkStu5hbeUmZpLcgNsAp3ccQR5E3q0X0xBeP9Rg1vc/TeFaepao9UXA80NxsmG pIICmM4U0LYut0jOtdqjYvZ5HqBRHhdoHM+M7E3HKgRldGkfxdIkwIb4ROKZIkNu+SxHtZ ICGh1UuWBqrpYp3QORQrGRXRFiGLPUZ71GErGOZkc6IVTeosoAG/fI/nQ2n8FnDb14VXRT Gum3HOkVGRvqYYKwsujSqJoIj6RpAXY659SXndI/k9hlbRevPI2gEb2i2M5ltA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789578760; b=mLumRbzp86rju6kGboAWl1s2StD4MTr/jiKe+LGvrn6fMeIK6cKLshYKW1IYtbB0MsdU7W sFAOxjhXGlB5pshS5Uv89DEkflmzepnc95i7pa6+VNBRhrIaPWZG1PtIG7rNjft4Vo61jU FOWBp90SD6bZNTmxwM86KS9FcsKlljCQlnvoXNZL+sd7EcbzqVfTyI+FKe6oqn5i86XaF/ boAb5yCCBI92EPSvg1KoStmRzYtbqAm8+b8FmTCf0rc3FEaE2N1rN3vSxSyPL6eth71Y9Y L318j6q2y9kXJagcYAzh48iOG2dIg81JoqAXttpiHVae1q7YjRlx89+blnqYCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789578760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gZlYO0PL9SvApc3ybWa9grEPnfr7fUTwcVMdjKnqCAU=; b=lSJefUOxDHER+fQuphb68s2calmYX7XlZFSvK3M7nrcR59+j/5wClEmHYvjKrmFnsAxS9C 8NAgs/SkGLNBCA0Q0tkwLErLHpMQkMVpUNWI83EJtx0rINb0lBGsttDzMCmhJpiYlNIm/9 HDU8Nz9+WxELFT1Ru4w9yyL72sjI4HaxIoHV5JkK+2V4EciyX72pv7XvMkqkU54xBRzvh5 6d8ObNgCtpHpeFakDy0JqXap8kbb6+tPyjlp5KOp21ruRkMC5HC9BG8FqA9cXW9zP4ID8j Jhy/h29pG2Do3Y87+FIZpDFxX1W/3FQPiyHUSh+10WRia8iCf1CM/8iXXwuHbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hlQS81cljzwHy for ; Wed, 16 Sep 2026 17:12:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 229ab by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 16 Sep 2026 17:12:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 29fcb8556681 - main - iflib: add a new global tunable "prefer_mpring" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29fcb8556681a8920d6b61ade35e4d1a238ea443 Auto-Submitted: auto-generated Date: Wed, 16 Sep 2026 17:12:40 +0000 Message-Id: <6aaace08.229ab.60e7dd00@gitrepo.freebsd.org> The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=29fcb8556681a8920d6b61ade35e4d1a238ea443 commit 29fcb8556681a8920d6b61ade35e4d1a238ea443 Author: Andrew Gallatin AuthorDate: 2026-09-16 16:08:17 +0000 Commit: Andrew Gallatin CommitDate: 2026-09-16 17:11:19 +0000 iflib: add a new global tunable "prefer_mpring" net.iflib.prefer_mpring can be used to control whether or not all iflib driver instances default to mp_ring or simple_tx. This is intended to be temporary, to allow easy testing (now) of simple_tx, and to allow an easy fallback to the legacy path (later) once the default is switched to simple_tx --- share/man/man4/iflib.4 | 17 +++++++++++++++-- sys/net/iflib.c | 5 +++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/share/man/man4/iflib.4 b/share/man/man4/iflib.4 index ca1b7918412e..2a752871d9a8 100644 --- a/share/man/man4/iflib.4 +++ b/share/man/man4/iflib.4 @@ -1,4 +1,4 @@ -.Dd September 14, 2026 +.Dd September 16, 2026 .Dt IFLIB 4 .Os .Sh NAME @@ -79,7 +79,9 @@ resource contention is not a problem (well behaved applications on systems where there are as many NIC queues as CPU cores). Note that when this is enabled, the tx_abdicate sysctl is no longer applicable and is ignored. -Defaults to zero. +By default, this is the inverse of +.Va net.iflib.prefer_mpring . +An explicitly configured value takes precedence over that global default. .El .Pp These @@ -144,6 +146,17 @@ Some NICs allow processing completed transmit descriptors in batches. Doing so usually increases the transmit throughput by reducing the number of transmit interrupts. Setting this to a non-zero value will disable the use of this feature. +.It Va net.iflib.prefer_mpring +When set, use the +.Va mp_ring +transmit path by default instead of the simple transmit path. +This is a read-only tunable that must be set before +.Nm +is loaded. +An explicitly configured per-device +.Va simple_tx +value takes precedence. +The default is one. .It Va net.iflib.simple_drain_quota Sets the maximum number of packets that the transmit task may remove from a simple transmit deferral ring in one drain operation. diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 2257e64a5a8e..1c43792c9857 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -704,6 +704,10 @@ static int iflib_simple_txbr_size = IFLIB_SIMPLE_TXBR_SIZE; SYSCTL_INT(_net_iflib, OID_AUTO, simple_txbr_size, CTLFLAG_RDTUN, &iflib_simple_txbr_size, 0, "number of entries in the simple tx deferral ring"); +static bool iflib_prefer_mpring = true; +SYSCTL_BOOL(_net_iflib, OID_AUTO, prefer_mpring, CTLFLAG_RDTUN, + &iflib_prefer_mpring, 0, + "prefer the mp_ring transmit path by default"); static u_int iflib_simple_drain_quota = 8; SYSCTL_UINT(_net_iflib, OID_AUTO, simple_drain_quota, CTLFLAG_RWTUN, &iflib_simple_drain_quota, 0, @@ -7641,6 +7645,7 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) "tx_watchdog_events", CTLFLAG_RD, &ctx->ifc_tx_watchdog_events, 0, "TX watchdog resets initiated by iflib"); + ctx->ifc_sysctl_simple_tx = !iflib_prefer_mpring; SYSCTL_ADD_BOOL(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "simple_tx", CTLFLAG_RDTUN, &ctx->ifc_sysctl_simple_tx, 0, "use simple tx ring");