Commit a5fdaf34 authored by Jesse Brandeburg's avatar Jesse Brandeburg Committed by Jeff Kirsher

i40e: refactor code to remove indent

I found a code indent that was avoidable because a whole function is inside
an if block, reverse the if and move the code back a tab.

Change-ID: I9989c8750ee61678fbf96a3b0fd7bf7cc7ef300a
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 6995b36c
...@@ -5679,49 +5679,51 @@ static void i40e_fdir_flush_and_replay(struct i40e_pf *pf) ...@@ -5679,49 +5679,51 @@ static void i40e_fdir_flush_and_replay(struct i40e_pf *pf)
if (!(pf->flags & (I40E_FLAG_FD_SB_ENABLED | I40E_FLAG_FD_ATR_ENABLED))) if (!(pf->flags & (I40E_FLAG_FD_SB_ENABLED | I40E_FLAG_FD_ATR_ENABLED)))
return; return;
if (time_after(jiffies, pf->fd_flush_timestamp + if (!time_after(jiffies, pf->fd_flush_timestamp +
(I40E_MIN_FD_FLUSH_INTERVAL * HZ))) { (I40E_MIN_FD_FLUSH_INTERVAL * HZ)))
/* If the flush is happening too quick and we have mostly return;
* SB rules we should not re-enable ATR for some time.
*/
min_flush_time = pf->fd_flush_timestamp
+ (I40E_MIN_FD_FLUSH_SB_ATR_UNSTABLE * HZ);
fd_room = pf->fdir_pf_filter_count - pf->fdir_pf_active_filters;
if (!(time_after(jiffies, min_flush_time)) && /* If the flush is happening too quick and we have mostly SB rules we
(fd_room < I40E_FDIR_BUFFER_HEAD_ROOM_FOR_ATR)) { * should not re-enable ATR for some time.
if (I40E_DEBUG_FD & pf->hw.debug_mask) */
dev_info(&pf->pdev->dev, "ATR disabled, not enough FD filter space.\n"); min_flush_time = pf->fd_flush_timestamp +
disable_atr = true; (I40E_MIN_FD_FLUSH_SB_ATR_UNSTABLE * HZ);
} fd_room = pf->fdir_pf_filter_count - pf->fdir_pf_active_filters;
pf->fd_flush_timestamp = jiffies; if (!(time_after(jiffies, min_flush_time)) &&
pf->flags &= ~I40E_FLAG_FD_ATR_ENABLED; (fd_room < I40E_FDIR_BUFFER_HEAD_ROOM_FOR_ATR)) {
/* flush all filters */ if (I40E_DEBUG_FD & pf->hw.debug_mask)
wr32(&pf->hw, I40E_PFQF_CTL_1, dev_info(&pf->pdev->dev, "ATR disabled, not enough FD filter space.\n");
I40E_PFQF_CTL_1_CLEARFDTABLE_MASK); disable_atr = true;
i40e_flush(&pf->hw); }
pf->fd_flush_cnt++;
pf->fd_add_err = 0; pf->fd_flush_timestamp = jiffies;
do { pf->flags &= ~I40E_FLAG_FD_ATR_ENABLED;
/* Check FD flush status every 5-6msec */ /* flush all filters */
usleep_range(5000, 6000); wr32(&pf->hw, I40E_PFQF_CTL_1,
reg = rd32(&pf->hw, I40E_PFQF_CTL_1); I40E_PFQF_CTL_1_CLEARFDTABLE_MASK);
if (!(reg & I40E_PFQF_CTL_1_CLEARFDTABLE_MASK)) i40e_flush(&pf->hw);
break; pf->fd_flush_cnt++;
} while (flush_wait_retry--); pf->fd_add_err = 0;
if (reg & I40E_PFQF_CTL_1_CLEARFDTABLE_MASK) { do {
dev_warn(&pf->pdev->dev, "FD table did not flush, needs more time\n"); /* Check FD flush status every 5-6msec */
} else { usleep_range(5000, 6000);
/* replay sideband filters */ reg = rd32(&pf->hw, I40E_PFQF_CTL_1);
i40e_fdir_filter_restore(pf->vsi[pf->lan_vsi]); if (!(reg & I40E_PFQF_CTL_1_CLEARFDTABLE_MASK))
if (!disable_atr) break;
pf->flags |= I40E_FLAG_FD_ATR_ENABLED; } while (flush_wait_retry--);
clear_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state); if (reg & I40E_PFQF_CTL_1_CLEARFDTABLE_MASK) {
if (I40E_DEBUG_FD & pf->hw.debug_mask) dev_warn(&pf->pdev->dev, "FD table did not flush, needs more time\n");
dev_info(&pf->pdev->dev, "FD Filter table flushed and FD-SB replayed.\n"); } else {
} /* replay sideband filters */
i40e_fdir_filter_restore(pf->vsi[pf->lan_vsi]);
if (!disable_atr)
pf->flags |= I40E_FLAG_FD_ATR_ENABLED;
clear_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state);
if (I40E_DEBUG_FD & pf->hw.debug_mask)
dev_info(&pf->pdev->dev, "FD Filter table flushed and FD-SB replayed.\n");
} }
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment