Patch "net: stmmac: fix up RX flow hash indirection table when setting channels" has been added to the 6.2-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: stmmac: fix up RX flow hash indirection table when setting channels

to the 6.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-stmmac-fix-up-rx-flow-hash-indirection-table-whe.patch
and it can be found in the queue-6.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 03949887d8c2a80bbe164d62ce87e0451e6d57b9
Author: Corinna Vinschen <vinschen@xxxxxxxxxx>
Date:   Mon Apr 3 14:11:20 2023 +0200

    net: stmmac: fix up RX flow hash indirection table when setting channels
    
    [ Upstream commit 218c597325f4faf7b7a6049233a30d7842b5b2dc ]
    
    stmmac_reinit_queues() fails to fix up the RX hash.  Even if the number
    of channels gets restricted, the output of `ethtool -x' indicates that
    all RX queues are used:
    
      $ ethtool -l enp0s29f2
      Channel parameters for enp0s29f2:
      Pre-set maximums:
      RX:           8
      TX:           8
      Other:                n/a
      Combined:     n/a
      Current hardware settings:
      RX:           8
      TX:           8
      Other:                n/a
      Combined:     n/a
      $ ethtool -x enp0s29f2
      RX flow hash indirection table for enp0s29f2 with 8 RX ring(s):
          0:      0     1     2     3     4     5     6     7
          8:      0     1     2     3     4     5     6     7
      [...]
      $ ethtool -L enp0s29f2 rx 3
      $ ethtool -x enp0s29f2
      RX flow hash indirection table for enp0s29f2 with 3 RX ring(s):
          0:      0     1     2     3     4     5     6     7
          8:      0     1     2     3     4     5     6     7
      [...]
    
    Fix this by setting the indirection table according to the number
    of specified queues.  The result is now as expected:
    
      $ ethtool -L enp0s29f2 rx 3
      $ ethtool -x enp0s29f2
      RX flow hash indirection table for enp0s29f2 with 3 RX ring(s):
          0:      0     1     2     0     1     2     0     1
          8:      2     0     1     2     0     1     2     0
      [...]
    
    Tested on Intel Elkhart Lake.
    
    Fixes: 0366f7e06a6b ("net: stmmac: add ethtool support for get/set channels")
    Signed-off-by: Corinna Vinschen <vinschen@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230403121120.489138-1-vinschen@xxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 20b51a39db38d..4888536a31500 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -6948,7 +6948,7 @@ static void stmmac_napi_del(struct net_device *dev)
 int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt)
 {
 	struct stmmac_priv *priv = netdev_priv(dev);
-	int ret = 0;
+	int ret = 0, i;
 
 	if (netif_running(dev))
 		stmmac_release(dev);
@@ -6957,6 +6957,10 @@ int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt)
 
 	priv->plat->rx_queues_to_use = rx_cnt;
 	priv->plat->tx_queues_to_use = tx_cnt;
+	if (!netif_is_rxfh_configured(dev))
+		for (i = 0; i < ARRAY_SIZE(priv->rss.table); i++)
+			priv->rss.table[i] = ethtool_rxfh_indir_default(i,
+									rx_cnt);
 
 	stmmac_napi_add(dev);
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux