i40e: ATR policy change to flush the table to clean stale ATR rules
[firefly-linux-kernel-4.4.55.git] / drivers / net / ethernet / intel / i40e / i40e_ethtool.c
index e8ba7470700af1abaaf33826c7bffc8409666b9e..7204e293dc71d39cfc2c86ddec91439f0135cf87 100644 (file)
@@ -1977,6 +1977,9 @@ static int i40e_del_fdir_entry(struct i40e_vsi *vsi,
        struct i40e_pf *pf = vsi->back;
        int ret = 0;
 
+       if (test_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state))
+               return -EBUSY;
+
        ret = i40e_update_ethtool_fdir_entry(vsi, NULL, fsp->location, cmd);
 
        i40e_fdir_check_and_reenable(pf);
@@ -2010,6 +2013,9 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,
        if (pf->auto_disable_flags & I40E_FLAG_FD_SB_ENABLED)
                return -ENOSPC;
 
+       if (test_bit(__I40E_FD_FLUSH_REQUESTED, &pf->state))
+               return -EBUSY;
+
        fsp = (struct ethtool_rx_flow_spec *)&cmd->fs;
 
        if (fsp->location >= (pf->hw.func_caps.fd_filters_best_effort +