Commit 5d826d20 authored by Radoslaw Tyl's avatar Radoslaw Tyl Committed by Jeff Kirsher

ixgbe: Fix crash with VFs and flow director on interface flap

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: default avatarRadoslaw Tyl <radoslawx.tyl@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 92fb7aaf
...@@ -5179,6 +5179,7 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter) ...@@ -5179,6 +5179,7 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter)
struct ixgbe_hw *hw = &adapter->hw; struct ixgbe_hw *hw = &adapter->hw;
struct hlist_node *node2; struct hlist_node *node2;
struct ixgbe_fdir_filter *filter; struct ixgbe_fdir_filter *filter;
u64 action;
spin_lock(&adapter->fdir_perfect_lock); spin_lock(&adapter->fdir_perfect_lock);
...@@ -5187,12 +5188,17 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter) ...@@ -5187,12 +5188,17 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter)
hlist_for_each_entry_safe(filter, node2, hlist_for_each_entry_safe(filter, node2,
&adapter->fdir_filter_list, fdir_node) { &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, ixgbe_fdir_write_perfect_filter_82599(hw,
&filter->filter, &filter->filter,
filter->sw_idx, filter->sw_idx,
(filter->action == IXGBE_FDIR_DROP_QUEUE) ? (action == IXGBE_FDIR_DROP_QUEUE) ?
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); spin_unlock(&adapter->fdir_perfect_lock);
......
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