diff options
author | Jacob Keller <jacob.e.keller@intel.com> | 2017-06-12 18:38:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-12 18:53:02 -0400 |
commit | 6964e53f55837b0c49ed60d36656d2e0ee4fc27b (patch) | |
tree | d6a21f02526c74a1d852836c96bc59338e8c8332 | |
parent | 675c8da049fd6556eb2d6cdd745fe812752f07a8 (diff) |
i40e: fix handling of HW ATR eviction
A recent commit to refactor the driver and remove the hw_disabled_flags
field accidentally introduced two regressions. First, we overwrote
pf->flags which removed various key flags including the MSI-X settings.
Additionally, it was intended that we have now two flags,
HW_ATR_EVICT_CAPABLE and HW_ATR_EVICT_ENABLED, but this was not done,
and we accidentally were mis-using HW_ATR_EVICT_CAPABLE everywhere.
This patch adds the missing piece, HW_ATR_EVICT_ENABLED, and safely
updates pf->flags instead of overwriting it.
Without this patch we will have many problems including disabling MSI-X
support, and we'll attempt to use HW ATR eviction on devices which do
not support it.
Fixes: 47994c119a36 ("i40e: remove hw_disabled_flags in favor of using separate flag bits", 2017-04-19)
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_txrx.c | 4 |
4 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index cdde3cc28fb5..44d9610f7a15 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h | |||
@@ -399,6 +399,7 @@ struct i40e_pf { | |||
399 | #define I40E_FLAG_RX_CSUM_ENABLED BIT_ULL(1) | 399 | #define I40E_FLAG_RX_CSUM_ENABLED BIT_ULL(1) |
400 | #define I40E_FLAG_MSI_ENABLED BIT_ULL(2) | 400 | #define I40E_FLAG_MSI_ENABLED BIT_ULL(2) |
401 | #define I40E_FLAG_MSIX_ENABLED BIT_ULL(3) | 401 | #define I40E_FLAG_MSIX_ENABLED BIT_ULL(3) |
402 | #define I40E_FLAG_HW_ATR_EVICT_ENABLED BIT_ULL(4) | ||
402 | #define I40E_FLAG_RSS_ENABLED BIT_ULL(6) | 403 | #define I40E_FLAG_RSS_ENABLED BIT_ULL(6) |
403 | #define I40E_FLAG_VMDQ_ENABLED BIT_ULL(7) | 404 | #define I40E_FLAG_VMDQ_ENABLED BIT_ULL(7) |
404 | #define I40E_FLAG_IWARP_ENABLED BIT_ULL(10) | 405 | #define I40E_FLAG_IWARP_ENABLED BIT_ULL(10) |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index 7a8eb486b9ea..894c8e57ba00 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c | |||
@@ -224,7 +224,7 @@ static const struct i40e_priv_flags i40e_gstrings_priv_flags[] = { | |||
224 | I40E_PRIV_FLAG("LinkPolling", I40E_FLAG_LINK_POLLING_ENABLED, 0), | 224 | I40E_PRIV_FLAG("LinkPolling", I40E_FLAG_LINK_POLLING_ENABLED, 0), |
225 | I40E_PRIV_FLAG("flow-director-atr", I40E_FLAG_FD_ATR_ENABLED, 0), | 225 | I40E_PRIV_FLAG("flow-director-atr", I40E_FLAG_FD_ATR_ENABLED, 0), |
226 | I40E_PRIV_FLAG("veb-stats", I40E_FLAG_VEB_STATS_ENABLED, 0), | 226 | I40E_PRIV_FLAG("veb-stats", I40E_FLAG_VEB_STATS_ENABLED, 0), |
227 | I40E_PRIV_FLAG("hw-atr-eviction", I40E_FLAG_HW_ATR_EVICT_CAPABLE, 0), | 227 | I40E_PRIV_FLAG("hw-atr-eviction", I40E_FLAG_HW_ATR_EVICT_ENABLED, 0), |
228 | I40E_PRIV_FLAG("legacy-rx", I40E_FLAG_LEGACY_RX, 0), | 228 | I40E_PRIV_FLAG("legacy-rx", I40E_FLAG_LEGACY_RX, 0), |
229 | }; | 229 | }; |
230 | 230 | ||
@@ -4092,7 +4092,7 @@ flags_complete: | |||
4092 | 4092 | ||
4093 | /* Only allow ATR evict on hardware that is capable of handling it */ | 4093 | /* Only allow ATR evict on hardware that is capable of handling it */ |
4094 | if (pf->flags & I40E_FLAG_HW_ATR_EVICT_CAPABLE) | 4094 | if (pf->flags & I40E_FLAG_HW_ATR_EVICT_CAPABLE) |
4095 | pf->flags &= ~I40E_FLAG_HW_ATR_EVICT_CAPABLE; | 4095 | pf->flags &= ~I40E_FLAG_HW_ATR_EVICT_ENABLED; |
4096 | 4096 | ||
4097 | if (changed_flags & I40E_FLAG_TRUE_PROMISC_SUPPORT) { | 4097 | if (changed_flags & I40E_FLAG_TRUE_PROMISC_SUPPORT) { |
4098 | u16 sw_flags = 0, valid_flags = 0; | 4098 | u16 sw_flags = 0, valid_flags = 0; |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 150caf6ca2b4..a7a4b28b4144 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -8821,11 +8821,12 @@ static int i40e_sw_init(struct i40e_pf *pf) | |||
8821 | (pf->hw.aq.api_min_ver > 4))) { | 8821 | (pf->hw.aq.api_min_ver > 4))) { |
8822 | /* Supported in FW API version higher than 1.4 */ | 8822 | /* Supported in FW API version higher than 1.4 */ |
8823 | pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE; | 8823 | pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE; |
8824 | pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE; | ||
8825 | } else { | ||
8826 | pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE; | ||
8827 | } | 8824 | } |
8828 | 8825 | ||
8826 | /* Enable HW ATR eviction if possible */ | ||
8827 | if (pf->flags & I40E_FLAG_HW_ATR_EVICT_CAPABLE) | ||
8828 | pf->flags |= I40E_FLAG_HW_ATR_EVICT_ENABLED; | ||
8829 | |||
8829 | pf->eeprom_version = 0xDEAD; | 8830 | pf->eeprom_version = 0xDEAD; |
8830 | pf->lan_veb = I40E_NO_VEB; | 8831 | pf->lan_veb = I40E_NO_VEB; |
8831 | pf->lan_vsi = I40E_NO_VSI; | 8832 | pf->lan_vsi = I40E_NO_VSI; |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index cd894f4023b1..77115c25d96f 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c | |||
@@ -2341,7 +2341,7 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb, | |||
2341 | /* Due to lack of space, no more new filters can be programmed */ | 2341 | /* Due to lack of space, no more new filters can be programmed */ |
2342 | if (th->syn && (pf->flags & I40E_FLAG_FD_ATR_AUTO_DISABLED)) | 2342 | if (th->syn && (pf->flags & I40E_FLAG_FD_ATR_AUTO_DISABLED)) |
2343 | return; | 2343 | return; |
2344 | if (pf->flags & I40E_FLAG_HW_ATR_EVICT_CAPABLE) { | 2344 | if (pf->flags & I40E_FLAG_HW_ATR_EVICT_ENABLED) { |
2345 | /* HW ATR eviction will take care of removing filters on FIN | 2345 | /* HW ATR eviction will take care of removing filters on FIN |
2346 | * and RST packets. | 2346 | * and RST packets. |
2347 | */ | 2347 | */ |
@@ -2403,7 +2403,7 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb, | |||
2403 | I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT) & | 2403 | I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT) & |
2404 | I40E_TXD_FLTR_QW1_CNTINDEX_MASK; | 2404 | I40E_TXD_FLTR_QW1_CNTINDEX_MASK; |
2405 | 2405 | ||
2406 | if (pf->flags & I40E_FLAG_HW_ATR_EVICT_CAPABLE) | 2406 | if (pf->flags & I40E_FLAG_HW_ATR_EVICT_ENABLED) |
2407 | dtype_cmd |= I40E_TXD_FLTR_QW1_ATR_MASK; | 2407 | dtype_cmd |= I40E_TXD_FLTR_QW1_ATR_MASK; |
2408 | 2408 | ||
2409 | fdir_desc->qindex_flex_ptype_vsi = cpu_to_le32(flex_ptype); | 2409 | fdir_desc->qindex_flex_ptype_vsi = cpu_to_le32(flex_ptype); |