diff options
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 32 |
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 | ||
3213 | static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter) | 3213 | static 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 | |||
3244 | static 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 | ||