aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2012-07-14 01:42:36 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-07-18 16:29:05 -0400
commitfbe7ca7f9bb60fdec91cce6b52dd0c6dbac641f7 (patch)
treea41a7b78e192485041de8eb1697e6c1aa8bd0345
parent73079ea0414098ae83f341028434e04d63144ce2 (diff)
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>
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe.h2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c4
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c10
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c29
4 files changed, 8 insertions, 37 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 67743aa7acef..4ca10e6da482 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -446,8 +446,6 @@ struct ixgbe_adapter {
446#define IXGBE_FLAG_IMIR_ENABLED (u32)(1 << 12) 446#define IXGBE_FLAG_IMIR_ENABLED (u32)(1 << 12)
447#define IXGBE_FLAG_MQ_CAPABLE (u32)(1 << 13) 447#define IXGBE_FLAG_MQ_CAPABLE (u32)(1 << 13)
448#define IXGBE_FLAG_DCB_ENABLED (u32)(1 << 14) 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#define IXGBE_FLAG_VMDQ_CAPABLE (u32)(1 << 18) 449#define IXGBE_FLAG_VMDQ_CAPABLE (u32)(1 << 18)
452#define IXGBE_FLAG_VMDQ_ENABLED (u32)(1 << 19) 450#define IXGBE_FLAG_VMDQ_ENABLED (u32)(1 << 19)
453#define IXGBE_FLAG_FAN_FAIL_CAPABLE (u32)(1 << 20) 451#define IXGBE_FLAG_FAN_FAIL_CAPABLE (u32)(1 << 20)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 8e1be50af70a..4104ea25d818 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -2245,10 +2245,6 @@ static int ixgbe_get_rss_hash_opts(struct ixgbe_adapter *adapter,
2245{ 2245{
2246 cmd->data = 0; 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 /* Report default options for RSS on ixgbe */ 2248 /* Report default options for RSS on ixgbe */
2253 switch (cmd->flow_type) { 2249 switch (cmd->flow_type) {
2254 case TCP_V4_FLOW: 2250 case TCP_V4_FLOW:
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
index 676e93f344f3..38d1b65777ad 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
@@ -265,9 +265,6 @@ static bool ixgbe_cache_ring_rss(struct ixgbe_adapter *adapter)
265{ 265{
266 int i; 266 int i;
267 267
268 if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED))
269 return false;
270
271 for (i = 0; i < adapter->num_rx_queues; i++) 268 for (i = 0; i < adapter->num_rx_queues; i++)
272 adapter->rx_ring[i]->reg_idx = i; 269 adapter->rx_ring[i]->reg_idx = i;
273 for (i = 0; i < adapter->num_tx_queues; i++) 270 for (i = 0; i < adapter->num_tx_queues; i++)
@@ -602,11 +599,6 @@ static bool ixgbe_set_rss_queues(struct ixgbe_adapter *adapter)
602 struct ixgbe_ring_feature *f; 599 struct ixgbe_ring_feature *f;
603 u16 rss_i; 600 u16 rss_i;
604 601
605 if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED)) {
606 adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE;
607 return false;
608 }
609
610 /* set mask for 16 queue limit of RSS */ 602 /* set mask for 16 queue limit of RSS */
611 f = &adapter->ring_feature[RING_F_RSS]; 603 f = &adapter->ring_feature[RING_F_RSS];
612 rss_i = f->limit; 604 rss_i = f->limit;
@@ -1062,7 +1054,6 @@ static void ixgbe_set_interrupt_capability(struct ixgbe_adapter *adapter)
1062 } 1054 }
1063 1055
1064 adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; 1056 adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED;
1065 adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED;
1066 if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) { 1057 if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) {
1067 e_err(probe, 1058 e_err(probe,
1068 "ATR is not supported while multiple " 1059 "ATR is not supported while multiple "
@@ -1073,6 +1064,7 @@ static void ixgbe_set_interrupt_capability(struct ixgbe_adapter *adapter)
1073 if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) 1064 if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)
1074 ixgbe_disable_sriov(adapter); 1065 ixgbe_disable_sriov(adapter);
1075 1066
1067 adapter->ring_feature[RING_F_RSS].limit = 1;
1076 ixgbe_set_num_queues(adapter); 1068 ixgbe_set_num_queues(adapter);
1077 adapter->num_q_vectors = 1; 1069 adapter->num_q_vectors = 1;
1078 1070
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 454e556307f2..a3dc9657f572 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -2891,9 +2891,6 @@ static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter)
2891 int i, j; 2891 int i, j;
2892 u16 rss_i = adapter->ring_feature[RING_F_RSS].indices; 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 * Program table for at least 2 queues w/ SR-IOV so that VFs can 2895 * Program table for at least 2 queues w/ SR-IOV so that VFs can
2899 * make full use of any rings they may have. We will use the 2896 * make full use of any rings they may have. We will use the
@@ -2923,7 +2920,7 @@ static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter)
2923 IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum); 2920 IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum);
2924 2921
2925 if (adapter->hw.mac.type == ixgbe_mac_82598EB) { 2922 if (adapter->hw.mac.type == ixgbe_mac_82598EB) {
2926 if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) 2923 if (adapter->ring_feature[RING_F_RSS].mask)
2927 mrqc = IXGBE_MRQC_RSSEN; 2924 mrqc = IXGBE_MRQC_RSSEN;
2928 } else { 2925 } else {
2929 u8 tcs = netdev_get_num_tc(adapter->netdev); 2926 u8 tcs = netdev_get_num_tc(adapter->netdev);
@@ -3102,6 +3099,7 @@ void ixgbe_configure_rx_ring(struct ixgbe_adapter *adapter,
3102static void ixgbe_setup_psrtype(struct ixgbe_adapter *adapter) 3099static void ixgbe_setup_psrtype(struct ixgbe_adapter *adapter)
3103{ 3100{
3104 struct ixgbe_hw *hw = &adapter->hw; 3101 struct ixgbe_hw *hw = &adapter->hw;
3102 int rss_i = adapter->ring_feature[RING_F_RSS].indices;
3105 int p; 3103 int p;
3106 3104
3107 /* PSRTYPE must be initialized in non 82598 adapters */ 3105 /* PSRTYPE must be initialized in non 82598 adapters */
@@ -3114,13 +3112,10 @@ static void ixgbe_setup_psrtype(struct ixgbe_adapter *adapter)
3114 if (hw->mac.type == ixgbe_mac_82598EB) 3112 if (hw->mac.type == ixgbe_mac_82598EB)
3115 return; 3113 return;
3116 3114
3117 if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { 3115 if (rss_i > 3)
3118 int rss_i = adapter->ring_feature[RING_F_RSS].indices; 3116 psrtype |= 2 << 29;
3119 if (rss_i > 3) 3117 else if (rss_i > 1)
3120 psrtype |= 2 << 29; 3118 psrtype |= 1 << 29;
3121 else if (rss_i > 1)
3122 psrtype |= 1 << 29;
3123 }
3124 3119
3125 for (p = 0; p < adapter->num_rx_pools; p++) 3120 for (p = 0; p < adapter->num_rx_pools; p++)
3126 IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(adapter->num_vfs + p), 3121 IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(adapter->num_vfs + p),
@@ -4408,7 +4403,6 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
4408 /* Set capability flags */ 4403 /* Set capability flags */
4409 rss = min_t(int, IXGBE_MAX_RSS_INDICES, num_online_cpus()); 4404 rss = min_t(int, IXGBE_MAX_RSS_INDICES, num_online_cpus());
4410 adapter->ring_feature[RING_F_RSS].limit = rss; 4405 adapter->ring_feature[RING_F_RSS].limit = rss;
4411 adapter->flags |= IXGBE_FLAG_RSS_ENABLED;
4412 switch (hw->mac.type) { 4406 switch (hw->mac.type) {
4413 case ixgbe_mac_82598EB: 4407 case ixgbe_mac_82598EB:
4414 if (hw->device_id == IXGBE_DEV_ID_82598AT) 4408 if (hw->device_id == IXGBE_DEV_ID_82598AT)
@@ -6756,10 +6750,6 @@ static netdev_features_t ixgbe_fix_features(struct net_device *netdev,
6756{ 6750{
6757 struct ixgbe_adapter *adapter = netdev_priv(netdev); 6751 struct ixgbe_adapter *adapter = netdev_priv(netdev);
6758 6752
6759 /* return error if RXHASH is being enabled when RSS is not supported */
6760 if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED))
6761 features &= ~NETIF_F_RXHASH;
6762
6763 /* If Rx checksum is disabled, then RSC/LRO should also be disabled */ 6753 /* If Rx checksum is disabled, then RSC/LRO should also be disabled */
6764 if (!(features & NETIF_F_RXCSUM)) 6754 if (!(features & NETIF_F_RXCSUM))
6765 features &= ~NETIF_F_LRO; 6755 features &= ~NETIF_F_LRO;
@@ -6802,7 +6792,7 @@ static int ixgbe_set_features(struct net_device *netdev,
6802 if (!(features & NETIF_F_NTUPLE)) { 6792 if (!(features & NETIF_F_NTUPLE)) {
6803 if (adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE) { 6793 if (adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE) {
6804 /* turn off Flow Director, set ATR and reset */ 6794 /* turn off Flow Director, set ATR and reset */
6805 if ((adapter->flags & IXGBE_FLAG_RSS_ENABLED) && 6795 if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) &&
6806 !(adapter->flags & IXGBE_FLAG_DCB_ENABLED)) 6796 !(adapter->flags & IXGBE_FLAG_DCB_ENABLED))
6807 adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; 6797 adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
6808 need_reset = true; 6798 need_reset = true;
@@ -7294,11 +7284,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
7294 if (err) 7284 if (err)
7295 goto err_sw_init; 7285 goto err_sw_init;
7296 7286
7297 if (!(adapter->flags & IXGBE_FLAG_RSS_ENABLED)) {
7298 netdev->hw_features &= ~NETIF_F_RXHASH;
7299 netdev->features &= ~NETIF_F_RXHASH;
7300 }
7301
7302 /* WOL not supported for all devices */ 7287 /* WOL not supported for all devices */
7303 adapter->wol = 0; 7288 adapter->wol = 0;
7304 hw->eeprom.ops.read(hw, 0x2c, &adapter->eeprom_cap); 7289 hw->eeprom.ops.read(hw, 0x2c, &adapter->eeprom_cap);