]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ixgbe: Fix crash with VFs and flow director on interface flap
authorRadoslaw Tyl <radoslawx.tyl@intel.com>
Mon, 24 Sep 2018 07:24:20 +0000 (09:24 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Thu, 28 Nov 2019 04:59:27 +0000 (23:59 -0500)
BugLink: https://bugs.launchpad.net/bugs/1854216
[ Upstream commit 5d826d209164b0752c883607be4cdbbcf7cab494 ]

This patch fix crash when we have restore flow director filters after reset
adapter. In ixgbe_fdir_filter_restore() filter->action is outside of the
rx_ring array, as it has a VF identifier in the upper 32 bits.

Signed-off-by: Radoslaw Tyl <radoslawx.tyl@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index 41804bc2887bcbd5fc9e87cbc71005b4f2ba40d1..aeda8a3e8556144dc4e6317e1d46472b06188e6c 100644 (file)
@@ -5264,6 +5264,7 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter)
        struct ixgbe_hw *hw = &adapter->hw;
        struct hlist_node *node2;
        struct ixgbe_fdir_filter *filter;
+       u64 action;
 
        spin_lock(&adapter->fdir_perfect_lock);
 
@@ -5272,12 +5273,17 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter)
 
        hlist_for_each_entry_safe(filter, node2,
                                  &adapter->fdir_filter_list, fdir_node) {
+               action = filter->action;
+               if (action != IXGBE_FDIR_DROP_QUEUE && action != 0)
+                       action =
+                       (action >> ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF) - 1;
+
                ixgbe_fdir_write_perfect_filter_82599(hw,
                                &filter->filter,
                                filter->sw_idx,
-                               (filter->action == IXGBE_FDIR_DROP_QUEUE) ?
+                               (action == IXGBE_FDIR_DROP_QUEUE) ?
                                IXGBE_FDIR_DROP_QUEUE :
-                               adapter->rx_ring[filter->action]->reg_idx);
+                               adapter->rx_ring[action]->reg_idx);
        }
 
        spin_unlock(&adapter->fdir_perfect_lock);