Skip to content

Commit 7ecebee

Browse files
committed
Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== ixgbe: Multiple RSS bugfixes Joe Damato says: This series fixes two bugs I stumbled on with ixgbe: 1. The flow hash cannot be set manually with ethool at all. Patch 1/2 addresses this by fixing what appears to be a small bug in set_rxfh in ixgbe. See the commit message for more details. 2. Once the above patch is applied and the flow hash can be set, resetting the flow hash to default fails if the number of queues is greater than the number of queues supported by RSS. Other drivers (like i40e) will reset the flowhash to use the maximum number of queues supported by RSS even if the queue count configured is larger. In other words: some queues will not have packets distributed to them by the RSS hash if the queue count is too large. Patch 2/2 allows the user to reset ixgbe to default and the flowhash is set correctly to either the maximum number of queues supported by RSS or the configured queue count, whichever is smaller. I believe this is correct and it mimics the behavior of i40e; `ethtool -X $iface default` should probably always succeed even if all the queues cannot be utilized. See the commit message for more details and examples. I tested these on an ixgbe system I have access to and they appear to work as intended, but I would appreciate a review by the experts on this list :) * '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ixgbe: Enable setting RSS table to default values ixgbe: Allow flow hash to be set via ethtool ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 2cc8a00 + e85d3d5 commit 7ecebee

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2665,6 +2665,14 @@ static int ixgbe_get_rss_hash_opts(struct ixgbe_adapter *adapter,
26652665
return 0;
26662666
}
26672667

2668+
static int ixgbe_rss_indir_tbl_max(struct ixgbe_adapter *adapter)
2669+
{
2670+
if (adapter->hw.mac.type < ixgbe_mac_X550)
2671+
return 16;
2672+
else
2673+
return 64;
2674+
}
2675+
26682676
static int ixgbe_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
26692677
u32 *rule_locs)
26702678
{
@@ -2673,7 +2681,8 @@ static int ixgbe_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
26732681

26742682
switch (cmd->cmd) {
26752683
case ETHTOOL_GRXRINGS:
2676-
cmd->data = adapter->num_rx_queues;
2684+
cmd->data = min_t(int, adapter->num_rx_queues,
2685+
ixgbe_rss_indir_tbl_max(adapter));
26772686
ret = 0;
26782687
break;
26792688
case ETHTOOL_GRXCLSRLCNT:
@@ -3075,14 +3084,6 @@ static int ixgbe_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
30753084
return ret;
30763085
}
30773086

3078-
static int ixgbe_rss_indir_tbl_max(struct ixgbe_adapter *adapter)
3079-
{
3080-
if (adapter->hw.mac.type < ixgbe_mac_X550)
3081-
return 16;
3082-
else
3083-
return 64;
3084-
}
3085-
30863087
static u32 ixgbe_get_rxfh_key_size(struct net_device *netdev)
30873088
{
30883089
return IXGBE_RSS_KEY_SIZE;
@@ -3131,8 +3132,8 @@ static int ixgbe_set_rxfh(struct net_device *netdev, const u32 *indir,
31313132
int i;
31323133
u32 reta_entries = ixgbe_rss_indir_tbl_entries(adapter);
31333134

3134-
if (hfunc)
3135-
return -EINVAL;
3135+
if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP)
3136+
return -EOPNOTSUPP;
31363137

31373138
/* Fill out the redirection table */
31383139
if (indir) {

0 commit comments

Comments
 (0)