ena_set_io_queue_count() destroys the ena-com RSS state but left
ENA_FLAG_RSS_ACTIVE set. The RSS sysctl handlers gate on that flag, so
they ran against state that was gone.
This causes 2 types of issues:
- Kernel panic when reading dev.ena.0.rss.key or writing to dev.ena.0.rss.indir_table
- Returning a stale cached RSS table when reading dev.ena.0.rss.indir_table, or a bogus 1 when reading dev.ena.0.rss.indir_table_size
ena_set_io_queue_count() is called in 2 cases:
- The io_queues_nb sysctl.
- Device restore when the device comes back with fewer MSI-X vectors than before.
Clear ENA_FLAG_RSS_ACTIVE when the RSS table is destroyed. The handlers
then fail with ENOTSUP until the next ena_up() rebuilds RSS.
This both fixes the panics, and stops returning cached and bogus values.
Note: A plain ifconfig down does not destroy the table, so the sysctls
keep working across a down/up cycle.
Fixes: 56d41ad5fe9c ("Add sysctl node for ENA IO queues number adjustment")
Fixes: 2d4d2ed3fef6 ("ena: Reinit RSS table on device restore when queue count shrinks")
MFC after: 3 days
Sponsored by: Amazon, Inc.