@@ -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+
26682676static 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-
30863087static 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