hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
....@@ -2641,6 +2641,14 @@
26412641 return 0;
26422642 }
26432643
2644
+static int ixgbe_rss_indir_tbl_max(struct ixgbe_adapter *adapter)
2645
+{
2646
+ if (adapter->hw.mac.type < ixgbe_mac_X550)
2647
+ return 16;
2648
+ else
2649
+ return 64;
2650
+}
2651
+
26442652 static int ixgbe_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
26452653 u32 *rule_locs)
26462654 {
....@@ -2649,7 +2657,8 @@
26492657
26502658 switch (cmd->cmd) {
26512659 case ETHTOOL_GRXRINGS:
2652
- cmd->data = adapter->num_rx_queues;
2660
+ cmd->data = min_t(int, adapter->num_rx_queues,
2661
+ ixgbe_rss_indir_tbl_max(adapter));
26532662 ret = 0;
26542663 break;
26552664 case ETHTOOL_GRXCLSRLCNT:
....@@ -3051,14 +3060,6 @@
30513060 return ret;
30523061 }
30533062
3054
-static int ixgbe_rss_indir_tbl_max(struct ixgbe_adapter *adapter)
3055
-{
3056
- if (adapter->hw.mac.type < ixgbe_mac_X550)
3057
- return 16;
3058
- else
3059
- return 64;
3060
-}
3061
-
30623063 static u32 ixgbe_get_rxfh_key_size(struct net_device *netdev)
30633064 {
30643065 return IXGBE_RSS_KEY_SIZE;
....@@ -3107,8 +3108,8 @@
31073108 int i;
31083109 u32 reta_entries = ixgbe_rss_indir_tbl_entries(adapter);
31093110
3110
- if (hfunc)
3111
- return -EINVAL;
3111
+ if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP)
3112
+ return -EOPNOTSUPP;
31123113
31133114 /* Fill out the redirection table */
31143115 if (indir) {