git: c2a0dc16118c - stable/15 - iflib: Add optional RSS configuration queries
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 Oct 2026 06:03:25 UTC
The branch stable/15 has been updated by kbowling:
URL: https://cgit.FreeBSD.org/src/commit/?id=c2a0dc16118ca89cc577fa8e9df33bb5675a38b3
commit c2a0dc16118ca89cc577fa8e9df33bb5675a38b3
Author: Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-09-15 00:15:12 +0000
Commit: Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-10-29 05:42:08 +0000
iflib: Add optional RSS configuration queries
Dispatch SIOCGIFRSSKEY and SIOCGIFRSSHASH through typed get_rss_key and
get_rss_hash methods under the context lock. Drivers can report their
programmed key and hash selections. The default methods return EOPNOTSUPP.
The common RSS key does not describe which hash selections a particular
device actually programs. hn(4) needs the effective VF configuration when
synchronizing RSS between its synthetic and VF receive paths.
Reviewed by: iflib (gallatin)
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D59691
(cherry picked from commit a3880af465e617e5ed6f1a6e49645e6a8299e3c0)
---
sys/net/ifdi_if.m | 26 ++++++++++++++++++++++++++
sys/net/iflib.c | 10 ++++++++++
2 files changed, 36 insertions(+)
diff --git a/sys/net/ifdi_if.m b/sys/net/ifdi_if.m
index 3fa48f7a9e97..a03eed0a6045 100644
--- a/sys/net/ifdi_if.m
+++ b/sys/net/ifdi_if.m
@@ -125,6 +125,18 @@ CODE {
return (ENOTSUP);
}
+ static int
+ null_get_rss_key(if_ctx_t _ctx __unused, struct ifrsskey *_key __unused)
+ {
+ return (EOPNOTSUPP);
+ }
+
+ static int
+ null_get_rss_hash(if_ctx_t _ctx __unused, struct ifrsshash *_hash __unused)
+ {
+ return (EOPNOTSUPP);
+ }
+
static bool
null_needs_restart(if_ctx_t _ctx __unused, enum iflib_restart_event _event __unused)
{
@@ -341,6 +353,20 @@ METHOD int priv_ioctl {
# optional methods
#
+#
+# Report the programmed RSS key and hash selections under the context lock.
+# Unsupported queries return EOPNOTSUPP; unavailable state returns an error.
+#
+METHOD int get_rss_key {
+ if_ctx_t _ctx;
+ struct ifrsskey *_key;
+} DEFAULT null_get_rss_key;
+
+METHOD int get_rss_hash {
+ if_ctx_t _ctx;
+ struct ifrsshash *_hash;
+} DEFAULT null_get_rss_hash;
+
METHOD int i2c_req {
if_ctx_t _ctx;
struct ifi2creq *_req;
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index 6c59d12c4fbb..a954011660e1 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -4984,6 +4984,16 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data)
if_vlancap(ifp);
break;
}
+ case SIOCGIFRSSKEY:
+ CTX_LOCK(ctx);
+ err = IFDI_GET_RSS_KEY(ctx, (struct ifrsskey *)data);
+ CTX_UNLOCK(ctx);
+ break;
+ case SIOCGIFRSSHASH:
+ CTX_LOCK(ctx);
+ err = IFDI_GET_RSS_HASH(ctx, (struct ifrsshash *)data);
+ CTX_UNLOCK(ctx);
+ break;
case SIOCGPRIVATE_0:
case SIOCSDRVSPEC:
case SIOCGDRVSPEC: