aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40e/i40e_txrx.c
diff options
context:
space:
mode:
authorAnjali Singhai Jain <anjali.singhai@intel.com>2015-02-27 09:15:28 +0000
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-03-07 04:59:46 -0800
commit04294e38a451b37288d61e52fa07ed087c5cdc02 (patch)
treec3be5cfe42d60aa876e0f1bf2af3047ec0e727d1 /drivers/net/ethernet/intel/i40e/i40e_txrx.c
parenti40e: Avoid logs while adding/deleting FD-SB filters (diff)
downloadlinux-dev-04294e38a451b37288d61e52fa07ed087c5cdc02.tar.xz
linux-dev-04294e38a451b37288d61e52fa07ed087c5cdc02.zip
i40e: FD filters flush policy changes
Since GLQF_FDCNT_0 register now has the right offset, use it to simplify our FD flush flow. If the filter add error happens to be for SB we just auto disable SB. If filter error happens to be for ATR, auto disable ATR and mark the state to FD_FLUSH_REQUESTED. Which gets cleared when flush completes. If we are entering flush too quickly (< 30 seconds) and we have quite a few SB rules, its time to disable ATR for good. Since SB + ATR rules is most likely making the FD table unstable. ATR can be re-enabled by turning ntuple off (ethtool -K ntuple off) and will remain off after turning ntuple on till it gets unstable again. Change-ID: I2154a2e0a5d44851a2f0eb8731e2f1d4a4d1acbc Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_txrx.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 64beea95bce6..cdd5cc13cbeb 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -471,12 +471,27 @@ static void i40e_fd_handle_status(struct i40e_ring *rx_ring,
dev_warn(&pdev->dev, "ntuple filter loc = %d, could not be added\n",
rx_desc->wb.qword0.hi_dword.fd_id);
+ /* Check if the programming error is for ATR.
+ * If so, auto disable ATR and set a state for
+ * flush in progress. Next time we come here if flush is in
+ * progress do nothing, once flush is complete the state will
+ * be cleared.
+ */
+ if (test_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state))
+ return;
+
pf->fd_add_err++;
/* store the current atr filter count */
pf->fd_atr_cnt = i40e_get_current_atr_cnt(pf);
+ if ((rx_desc->wb.qword0.hi_dword.fd_id == 0) &&
+ (pf->auto_disable_flags & I40E_FLAG_FD_SB_ENABLED)) {
+ pf->auto_disable_flags |= I40E_FLAG_FD_ATR_ENABLED;
+ set_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state);
+ }
+
/* filter programming failed most likely due to table full */
- fcnt_prog = i40e_get_cur_guaranteed_fd_count(pf);
+ fcnt_prog = i40e_get_global_fd_count(pf);
fcnt_avail = pf->fdir_pf_filter_count;
/* If ATR is running fcnt_prog can quickly change,
* if we are very close to full, it makes sense to disable
@@ -1926,6 +1941,9 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb,
if (!(pf->flags & I40E_FLAG_FD_ATR_ENABLED))
return;
+ if ((pf->auto_disable_flags & I40E_FLAG_FD_ATR_ENABLED))
+ return;
+
/* if sampling is disabled do nothing */
if (!tx_ring->atr_sample_rate)
return;