i40e: Add condition to enter fdir flush and reinit
authorAkeem G Abodunrin <akeem.g.abodunrin@intel.com>
Fri, 17 Oct 2014 03:14:41 +0000 (03:14 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 3 Nov 2014 09:15:41 +0000 (01:15 -0800)
When FD_SB/ATR are not enabled, do not allow flow director flush
and reinit.

Change-ID: Iafe261c1862992981615815551abd1ed9fada0a8
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Signed-off-by: Patrick Lu <patrick.lu@intel.com>
Tested-by: <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 834c9ffc6267ec36528698e7597c0ba0fe372e0f..0eccd82227279d049dae2e412c7bf95ce10651ab 100644 (file)
@@ -5211,6 +5211,9 @@ static void i40e_fdir_flush_and_replay(struct i40e_pf *pf)
        int flush_wait_retry = 50;
        int reg;
 
+       if (!(pf->flags & (I40E_FLAG_FD_SB_ENABLED | I40E_FLAG_FD_ATR_ENABLED)))
+               return;
+
        if (time_after(jiffies, pf->fd_flush_timestamp +
                                (I40E_MIN_FD_FLUSH_INTERVAL * HZ))) {
                set_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state);
@@ -5272,6 +5275,9 @@ static void i40e_fdir_reinit_subtask(struct i40e_pf *pf)
        if (test_bit(__I40E_DOWN, &pf->state))
                return;
 
+       if (!(pf->flags & (I40E_FLAG_FD_SB_ENABLED | I40E_FLAG_FD_ATR_ENABLED)))
+               return;
+
        if ((pf->fd_add_err >= I40E_MAX_FD_PROGRAM_ERROR) &&
            (i40e_get_current_atr_cnt(pf) >= pf->fd_atr_cnt) &&
            (i40e_get_current_atr_cnt(pf) > pf->fdir_pf_filter_count))