git: 28236ef569dd - stable/15 - ena: Reinit RSS components during queue count change flow

From: Arthur Kiyanovski <akiyano_at_FreeBSD.org>
Date: Wed, 04 Nov 2026 21:15:21 UTC
The branch stable/15 has been updated by akiyano:

URL: https://cgit.FreeBSD.org/src/commit/?id=28236ef569dd795d266fd3c10606b0d64fc59553

commit 28236ef569dd795d266fd3c10606b0d64fc59553
Author:     Gilad Ben Yakov <giladben@amazon.com>
AuthorDate: 2026-05-31 08:28:48 +0000
Commit:     Arthur Kiyanovski <akiyano@FreeBSD.org>
CommitDate: 2026-11-04 20:52:57 +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.
    
    (cherry picked from commit 2a27dd0076c55789a43415559906f795fd10c2da)
---
 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 767cccd3918f..6b1139bb0237 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);