git: 8aea65565291 - main - ena: Set ENA_FLAG_RSS_ACTIVE only when RSS is really configured
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 02 Nov 2026 18:42:25 UTC
The branch main has been updated by akiyano:
URL: https://cgit.FreeBSD.org/src/commit/?id=8aea6556529159d133aba66f25a2ec26aa47dc4c
commit 8aea6556529159d133aba66f25a2ec26aa47dc4c
Author: Arthur Kiyanovski <akiyano@amazon.com>
AuthorDate: 2026-10-30 01:38:44 +0000
Commit: Arthur Kiyanovski <akiyano@FreeBSD.org>
CommitDate: 2026-11-02 18:31:51 +0000
ena: Set ENA_FLAG_RSS_ACTIVE only when RSS is really configured
If the device does not report support for the RSS indirection table,
ena_rss_init_default() destroys the RSS state and returns EOPNOTSUPP.
ena_rss_configure() treats EOPNOTSUPP as success and returns 0, and
ena_up_complete() sets ENA_FLAG_RSS_ACTIVE on any 0 return.
Reading dev.ena.N.rss.key at this point causes kernel panic.
Every current device reports the indirection table, so reaching this
needs a device that is broken or misreporting.
The SYSINIT removed by a6205766b300 called ena_rss_init_default()
directly, saw the EOPNOTSUPP and cleared the flag. Routing the decision
through ena_rss_configure(), which hides EOPNOTSUPP, lost that.
Move the flag set into ena_rss_configure(), which can see whether a
table exists, and clear it when tbl_log_size is 0.
Reviewed by: cperciva
Fixes: a6205766b300 ("ena: Fix RSS not working after driver reload")
MFC after: 3 days
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D61058
---
sys/dev/ena/ena.c | 1 -
sys/dev/ena/ena_rss.c | 7 +++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c
index 2d43456f3e74..952281f87983 100644
--- a/sys/dev/ena/ena.c
+++ b/sys/dev/ena/ena.c
@@ -2140,7 +2140,6 @@ ena_up_complete(struct ena_adapter *adapter)
"Failed to configure RSS\n");
return (rc);
}
- ENA_FLAG_SET_ATOMIC(ENA_FLAG_RSS_ACTIVE, adapter);
rc = ena_change_mtu(adapter->ifp, if_getmtu(adapter->ifp));
if (unlikely(rc != 0))
diff --git a/sys/dev/ena/ena_rss.c b/sys/dev/ena/ena_rss.c
index 746db69970ca..2e95797ea54c 100644
--- a/sys/dev/ena/ena_rss.c
+++ b/sys/dev/ena/ena_rss.c
@@ -180,6 +180,11 @@ ena_rss_configure(struct ena_adapter *adapter)
}
}
+ if (ena_dev->rss.tbl_log_size == 0) {
+ ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_RSS_ACTIVE, adapter);
+ return (0);
+ }
+
/* Set indirect table */
rc = ena_com_indirect_table_set(ena_dev);
if (unlikely((rc != 0) && (rc != EOPNOTSUPP)))
@@ -195,6 +200,8 @@ ena_rss_configure(struct ena_adapter *adapter)
if (unlikely((rc != 0) && (rc != EOPNOTSUPP)))
return (rc);
+ ENA_FLAG_SET_ATOMIC(ENA_FLAG_RSS_ACTIVE, adapter);
+
return (0);
}