i40e: FD filter replay logic bug fix
authorAnjali Singhai Jain <anjali.singhai@intel.com>
Wed, 4 Jun 2014 20:41:48 +0000 (20:41 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 1 Jul 2014 07:07:53 +0000 (00:07 -0700)
With the auto_disable flags added there was a bug that was causing the
replay logic to not work correctly.
This patch fixes the issue so that we call a replay after a sideband
reset correctly.

Change-ID: I005fe1ac361188ee5b19517a83c922038cba1b00
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_txrx.c

index 5cc27fba8ad51f66f8e36f4c1b0b8ebac82b4d32..babb7e6a66bd3933aed318afba063410d1a785c4 100644 (file)
@@ -445,14 +445,16 @@ static void i40e_fd_handle_status(struct i40e_ring *rx_ring,
                 */
                if (fcnt_prog >= (fcnt_avail - I40E_FDIR_BUFFER_FULL_MARGIN)) {
                        /* Turn off ATR first */
-                       if (pf->flags & I40E_FLAG_FD_ATR_ENABLED) {
-                               pf->flags &= ~I40E_FLAG_FD_ATR_ENABLED;
+                       if ((pf->flags & I40E_FLAG_FD_ATR_ENABLED) &&
+                           !(pf->auto_disable_flags &
+                             I40E_FLAG_FD_ATR_ENABLED)) {
                                dev_warn(&pdev->dev, "FD filter space full, ATR for further flows will be turned off\n");
                                pf->auto_disable_flags |=
                                                       I40E_FLAG_FD_ATR_ENABLED;
                                pf->flags |= I40E_FLAG_FDIR_REQUIRES_REINIT;
-                       } else if (pf->flags & I40E_FLAG_FD_SB_ENABLED) {
-                               pf->flags &= ~I40E_FLAG_FD_SB_ENABLED;
+                       } else if ((pf->flags & I40E_FLAG_FD_SB_ENABLED) &&
+                                  !(pf->auto_disable_flags &
+                                    I40E_FLAG_FD_SB_ENABLED)) {
                                dev_warn(&pdev->dev, "FD filter space full, new ntuple rules will not be added\n");
                                pf->auto_disable_flags |=
                                                        I40E_FLAG_FD_SB_ENABLED;