| .. | .. |
|---|
| 2641 | 2641 | return 0; |
|---|
| 2642 | 2642 | } |
|---|
| 2643 | 2643 | |
|---|
| 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 | + |
|---|
| 2644 | 2652 | static int ixgbe_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, |
|---|
| 2645 | 2653 | u32 *rule_locs) |
|---|
| 2646 | 2654 | { |
|---|
| .. | .. |
|---|
| 2649 | 2657 | |
|---|
| 2650 | 2658 | switch (cmd->cmd) { |
|---|
| 2651 | 2659 | 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)); |
|---|
| 2653 | 2662 | ret = 0; |
|---|
| 2654 | 2663 | break; |
|---|
| 2655 | 2664 | case ETHTOOL_GRXCLSRLCNT: |
|---|
| .. | .. |
|---|
| 3051 | 3060 | return ret; |
|---|
| 3052 | 3061 | } |
|---|
| 3053 | 3062 | |
|---|
| 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 | | - |
|---|
| 3062 | 3063 | static u32 ixgbe_get_rxfh_key_size(struct net_device *netdev) |
|---|
| 3063 | 3064 | { |
|---|
| 3064 | 3065 | return IXGBE_RSS_KEY_SIZE; |
|---|
| .. | .. |
|---|
| 3107 | 3108 | int i; |
|---|
| 3108 | 3109 | u32 reta_entries = ixgbe_rss_indir_tbl_entries(adapter); |
|---|
| 3109 | 3110 | |
|---|
| 3110 | | - if (hfunc) |
|---|
| 3111 | | - return -EINVAL; |
|---|
| 3111 | + if (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP) |
|---|
| 3112 | + return -EOPNOTSUPP; |
|---|
| 3112 | 3113 | |
|---|
| 3113 | 3114 | /* Fill out the redirection table */ |
|---|
| 3114 | 3115 | if (indir) { |
|---|