aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorDon Skidmore <donald.c.skidmore@intel.com>2014-11-09 01:42:57 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-11-11 09:43:23 -0500
commitd1b849b9e994ef5a283efc288fc7da6a2471219b (patch)
tree5107b5ada184ec716d1bb5e9ac436ee9b9695444 /drivers/net/ethernet
parent9a75a1ac77fac4f63d7013c66c550fbf8e213715 (diff)
ixgbe: add helper function for setting RSS key in preparation of X550
Split off the setting of the RSS key into its own function. This will help when we add support for X550 which can have different RSS keys per pool. Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 355d1f79d274..a5ca877eac1a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -3210,14 +3210,10 @@ static void ixgbe_configure_srrctl(struct ixgbe_adapter *adapter,
3210 IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(reg_idx), srrctl); 3210 IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(reg_idx), srrctl);
3211} 3211}
3212 3212
3213static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter) 3213static void ixgbe_setup_reta(struct ixgbe_adapter *adapter, const u32 *seed)
3214{ 3214{
3215 struct ixgbe_hw *hw = &adapter->hw; 3215 struct ixgbe_hw *hw = &adapter->hw;
3216 static const u32 seed[10] = { 0xE291D73D, 0x1805EC6C, 0x2A94B30D, 3216 u32 reta = 0;
3217 0xA54F2BEC, 0xEA49AF7C, 0xE214AD3D, 0xB855AABE,
3218 0x6A3E67EA, 0x14364D17, 0x3BED200D};
3219 u32 mrqc = 0, reta = 0;
3220 u32 rxcsum;
3221 int i, j; 3217 int i, j;
3222 u16 rss_i = adapter->ring_feature[RING_F_RSS].indices; 3218 u16 rss_i = adapter->ring_feature[RING_F_RSS].indices;
3223 3219
@@ -3243,6 +3239,16 @@ static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter)
3243 if ((i & 3) == 3) 3239 if ((i & 3) == 3)
3244 IXGBE_WRITE_REG(hw, IXGBE_RETA(i >> 2), reta); 3240 IXGBE_WRITE_REG(hw, IXGBE_RETA(i >> 2), reta);
3245 } 3241 }
3242}
3243
3244static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter)
3245{
3246 struct ixgbe_hw *hw = &adapter->hw;
3247 static const u32 seed[10] = { 0xE291D73D, 0x1805EC6C, 0x2A94B30D,
3248 0xA54F2BEC, 0xEA49AF7C, 0xE214AD3D, 0xB855AABE,
3249 0x6A3E67EA, 0x14364D17, 0x3BED200D};
3250 u32 mrqc = 0, rss_field = 0;
3251 u32 rxcsum;
3246 3252
3247 /* Disable indicating checksum in descriptor, enables RSS hash */ 3253 /* Disable indicating checksum in descriptor, enables RSS hash */
3248 rxcsum = IXGBE_READ_REG(hw, IXGBE_RXCSUM); 3254 rxcsum = IXGBE_READ_REG(hw, IXGBE_RXCSUM);
@@ -3275,16 +3281,18 @@ static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter)
3275 } 3281 }
3276 3282
3277 /* Perform hash on these packet types */ 3283 /* Perform hash on these packet types */
3278 mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4 | 3284 rss_field |= IXGBE_MRQC_RSS_FIELD_IPV4 |
3279 IXGBE_MRQC_RSS_FIELD_IPV4_TCP | 3285 IXGBE_MRQC_RSS_FIELD_IPV4_TCP |
3280 IXGBE_MRQC_RSS_FIELD_IPV6 | 3286 IXGBE_MRQC_RSS_FIELD_IPV6 |
3281 IXGBE_MRQC_RSS_FIELD_IPV6_TCP; 3287 IXGBE_MRQC_RSS_FIELD_IPV6_TCP;
3282 3288
3283 if (adapter->flags2 & IXGBE_FLAG2_RSS_FIELD_IPV4_UDP) 3289 if (adapter->flags2 & IXGBE_FLAG2_RSS_FIELD_IPV4_UDP)
3284 mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4_UDP; 3290 rss_field |= IXGBE_MRQC_RSS_FIELD_IPV4_UDP;
3285 if (adapter->flags2 & IXGBE_FLAG2_RSS_FIELD_IPV6_UDP) 3291 if (adapter->flags2 & IXGBE_FLAG2_RSS_FIELD_IPV6_UDP)
3286 mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_UDP; 3292 rss_field |= IXGBE_MRQC_RSS_FIELD_IPV6_UDP;
3287 3293
3294 ixgbe_setup_reta(adapter, seed);
3295 mrqc |= rss_field;
3288 IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc); 3296 IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc);
3289} 3297}
3290 3298