Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ixgbe: Retire RSS enabled and capable flags

All of our hardware supports RSS even if it is only for a single queue. So
instead of toting around the RSS enable flag I am updating the code so that
all devices are enabled and if we want to disable RSS it is indicated via
the RSS mask.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

authored by

Alexander Duyck and committed by
Jeff Kirsher
fbe7ca7f 73079ea0

+8 -37
-2
drivers/net/ethernet/intel/ixgbe/ixgbe.h
··· 446 446 #define IXGBE_FLAG_IMIR_ENABLED (u32)(1 << 12) 447 447 #define IXGBE_FLAG_MQ_CAPABLE (u32)(1 << 13) 448 448 #define IXGBE_FLAG_DCB_ENABLED (u32)(1 << 14) 449 - #define IXGBE_FLAG_RSS_ENABLED (u32)(1 << 16) 450 - #define IXGBE_FLAG_RSS_CAPABLE (u32)(1 << 17) 451 449 #define IXGBE_FLAG_VMDQ_CAPABLE (u32)(1 << 18) 452 450 #define IXGBE_FLAG_VMDQ_ENABLED (u32)(1 << 19) 453 451 #define IXGBE_FLAG_FAN_FAIL_CAPABLE (u32)(1 << 20)
-4
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
··· 2245 2245 { 2246 2246 cmd->data = 0; 2247 2247 2248 - /* if RSS is disabled then report no hashing */ 2249 - if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED)) 2250 - return 0; 2251 - 2252 2248 /* Report default options for RSS on ixgbe */ 2253 2249 switch (cmd->flow_type) { 2254 2250 case TCP_V4_FLOW:
+1 -9
drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
··· 265 265 { 266 266 int i; 267 267 268 - if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED)) 269 - return false; 270 - 271 268 for (i = 0; i < adapter->num_rx_queues; i++) 272 269 adapter->rx_ring[i]->reg_idx = i; 273 270 for (i = 0; i < adapter->num_tx_queues; i++) ··· 598 601 { 599 602 struct ixgbe_ring_feature *f; 600 603 u16 rss_i; 601 - 602 - if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED)) { 603 - adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; 604 - return false; 605 - } 606 604 607 605 /* set mask for 16 queue limit of RSS */ 608 606 f = &adapter->ring_feature[RING_F_RSS]; ··· 1054 1062 } 1055 1063 1056 1064 adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; 1057 - adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED; 1058 1065 if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) { 1059 1066 e_err(probe, 1060 1067 "ATR is not supported while multiple " ··· 1064 1073 if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) 1065 1074 ixgbe_disable_sriov(adapter); 1066 1075 1076 + adapter->ring_feature[RING_F_RSS].limit = 1; 1067 1077 ixgbe_set_num_queues(adapter); 1068 1078 adapter->num_q_vectors = 1; 1069 1079
+7 -22
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
··· 2891 2891 int i, j; 2892 2892 u16 rss_i = adapter->ring_feature[RING_F_RSS].indices; 2893 2893 2894 - if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED)) 2895 - rss_i = 1; 2896 - 2897 2894 /* 2898 2895 * Program table for at least 2 queues w/ SR-IOV so that VFs can 2899 2896 * make full use of any rings they may have. We will use the ··· 2920 2923 IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum); 2921 2924 2922 2925 if (adapter->hw.mac.type == ixgbe_mac_82598EB) { 2923 - if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) 2926 + if (adapter->ring_feature[RING_F_RSS].mask) 2924 2927 mrqc = IXGBE_MRQC_RSSEN; 2925 2928 } else { 2926 2929 u8 tcs = netdev_get_num_tc(adapter->netdev); ··· 3099 3102 static void ixgbe_setup_psrtype(struct ixgbe_adapter *adapter) 3100 3103 { 3101 3104 struct ixgbe_hw *hw = &adapter->hw; 3105 + int rss_i = adapter->ring_feature[RING_F_RSS].indices; 3102 3106 int p; 3103 3107 3104 3108 /* PSRTYPE must be initialized in non 82598 adapters */ ··· 3112 3114 if (hw->mac.type == ixgbe_mac_82598EB) 3113 3115 return; 3114 3116 3115 - if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { 3116 - int rss_i = adapter->ring_feature[RING_F_RSS].indices; 3117 - if (rss_i > 3) 3118 - psrtype |= 2 << 29; 3119 - else if (rss_i > 1) 3120 - psrtype |= 1 << 29; 3121 - } 3117 + if (rss_i > 3) 3118 + psrtype |= 2 << 29; 3119 + else if (rss_i > 1) 3120 + psrtype |= 1 << 29; 3122 3121 3123 3122 for (p = 0; p < adapter->num_rx_pools; p++) 3124 3123 IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(adapter->num_vfs + p), ··· 4403 4408 /* Set capability flags */ 4404 4409 rss = min_t(int, IXGBE_MAX_RSS_INDICES, num_online_cpus()); 4405 4410 adapter->ring_feature[RING_F_RSS].limit = rss; 4406 - adapter->flags |= IXGBE_FLAG_RSS_ENABLED; 4407 4411 switch (hw->mac.type) { 4408 4412 case ixgbe_mac_82598EB: 4409 4413 if (hw->device_id == IXGBE_DEV_ID_82598AT) ··· 6750 6756 { 6751 6757 struct ixgbe_adapter *adapter = netdev_priv(netdev); 6752 6758 6753 - /* return error if RXHASH is being enabled when RSS is not supported */ 6754 - if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED)) 6755 - features &= ~NETIF_F_RXHASH; 6756 - 6757 6759 /* If Rx checksum is disabled, then RSC/LRO should also be disabled */ 6758 6760 if (!(features & NETIF_F_RXCSUM)) 6759 6761 features &= ~NETIF_F_LRO; ··· 6792 6802 if (!(features & NETIF_F_NTUPLE)) { 6793 6803 if (adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE) { 6794 6804 /* turn off Flow Director, set ATR and reset */ 6795 - if ((adapter->flags & IXGBE_FLAG_RSS_ENABLED) && 6805 + if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) && 6796 6806 !(adapter->flags & IXGBE_FLAG_DCB_ENABLED)) 6797 6807 adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; 6798 6808 need_reset = true; ··· 7283 7293 err = ixgbe_init_interrupt_scheme(adapter); 7284 7294 if (err) 7285 7295 goto err_sw_init; 7286 - 7287 - if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED)) { 7288 - netdev->hw_features &= ~NETIF_F_RXHASH; 7289 - netdev->features &= ~NETIF_F_RXHASH; 7290 - } 7291 7296 7292 7297 /* WOL not supported for all devices */ 7293 7298 adapter->wol = 0;