git: 2a27dd0076c5 - main - ena: Reinit RSS components during queue count change flow

From: Arthur Kiyanovski <akiyano_at_FreeBSD.org>
Date: Thu, 29 Oct 2026 03:29:40 UTC
The branch main has been updated by akiyano:

URL: https://cgit.FreeBSD.org/src/commit/?id=2a27dd0076c55789a43415559906f795fd10c2da

commit 2a27dd0076c55789a43415559906f795fd10c2da
Author:     Gilad Ben Yakov <giladben@amazon.com>
AuthorDate: 2026-05-31 08:28:48 +0000
Commit:     Arthur Kiyanovski <akiyano@FreeBSD.org>
CommitDate: 2026-10-29 03:25:51 +0000

    ena: Reinit RSS components during queue count change flow
    
    The io_queues_nb sysctl is writable while the interface is down, and
    setting it destroys the RSS components. When the interface is not UP
    nothing reinitialises them, so the indirection table is left referencing
    queues that no longer exist until the next ifconfig up.
    
    Call ena_rss_configure() after the queue count changes when the
    interface is down. When it is up, this happens through ena_up().
    
    This can configure RSS twice if the interface is brought up afterwards,
    costing three redundant admin commands. That is preferred over changing
    ena_up(), which the reset path also uses.
    
    Reviewed by: cperciva
    Fixes: 56d41ad5fe9c ("Add sysctl node for ENA IO queues number adjustment")
    MFC after: 3 days
    Sponsored by: Amazon, Inc.
---
 sys/dev/ena/ena.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c
index 74594fdb1496..63743cbc9db2 100644
--- a/sys/dev/ena/ena.c
+++ b/sys/dev/ena/ena.c
@@ -1437,6 +1437,11 @@ ena_update_io_queue_nb(struct ena_adapter *adapter, uint32_t new_num)
 				    ENA_REGS_RESET_OS_TRIGGER);
 			}
 		}
+	} else {
+		/* Reconfigure RSS to reflect the new queue count.
+		 * When dev_was_up, this happens through ena_up().
+		 */
+		rc = ena_rss_configure(adapter);
 	}
 
 	return (rc);