> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf
> Of Kohei Enju
> Sent: Tuesday, September 2, 2025 2:11 PM
> To: [email protected]; [email protected]
> Cc: Nguyen, Anthony L <[email protected]>; Kitszel,
> Przemyslaw <[email protected]>; Andrew Lunn
> <[email protected]>; David S. Miller <[email protected]>; Eric
> Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo
> Abeni <[email protected]>; [email protected]; Kohei Enju
> <[email protected]>
> Subject: [Intel-wired-lan] [PATCH iwl-next v3] ixgbe: preserve RSS
> indirection table across admin down/up
>
> Currently, the RSS indirection table configured by user via ethtool is
> reinitialized to default values during interface resets (e.g., admin
> down/up, MTU change). As for RSS hash key, commit 3dfbfc7ebb95
> ("ixgbe:
> Check for RSS key before setting value") made it persistent across
> interface resets.
>
> Adopt the same approach used in igc and igb drivers which
> reinitializes
> the RSS indirection table only when the queue count changes. Since the
> number of RETA entries can also change in ixgbe, let's make user
> configuration persistent as long as both queue count and the number of
> RETA entries remain unchanged.
>
> Tested on Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network
> Connection.
>
...
> static void ixgbe_setup_reta(struct ixgbe_adapter *adapter)
> {
> - u32 i, j;
> u32 reta_entries = ixgbe_rss_indir_tbl_entries(adapter);
> u16 rss_i = adapter->ring_feature[RING_F_RSS].indices;
> + u32 i;
>
> /* Program table for at least 4 queues w/ SR-IOV so that VFs
> can
> * make full use of any rings they may have. We will use the
> @@ -4323,14 +4323,17 @@ static void ixgbe_setup_reta(struct
> ixgbe_adapter *adapter)
> /* Fill out hash function seeds */
> ixgbe_store_key(adapter);
>
> - /* Fill out redirection table */
> - memset(adapter->rss_indir_tbl, 0, sizeof(adapter-
> >rss_indir_tbl));
> -
> - for (i = 0, j = 0; i < reta_entries; i++, j++) {
> - if (j == rss_i)
> - j = 0;
> + /* Update redirection table in memory on first init, queue
> count change,
> + * or reta entries change, otherwise preserve user
> configurations. Then
> + * always write to hardware.
> + */
> + if (adapter->last_rss_indices != rss_i ||
> + adapter->last_reta_entries != reta_entries) {
> + for (i = 0; i < reta_entries; i++)
> + adapter->rss_indir_tbl[i] = i % rss_i;
Are you sure rss_i never ever can be a 0?
This is the only thing I'm worrying about.