Skip to content

Commit 5d826d2

Browse files
rtylxJeff Kirsher
authored andcommitted
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: Radoslaw Tyl <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 92fb7aa commit 5d826d2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5179,6 +5179,7 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter)
51795179
struct ixgbe_hw *hw = &adapter->hw;
51805180
struct hlist_node *node2;
51815181
struct ixgbe_fdir_filter *filter;
5182+
u64 action;
51825183

51835184
spin_lock(&adapter->fdir_perfect_lock);
51845185

@@ -5187,12 +5188,17 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter)
51875188

51885189
hlist_for_each_entry_safe(filter, node2,
51895190
&adapter->fdir_filter_list, fdir_node) {
5191+
action = filter->action;
5192+
if (action != IXGBE_FDIR_DROP_QUEUE && action != 0)
5193+
action =
5194+
(action >> ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF) - 1;
5195+
51905196
ixgbe_fdir_write_perfect_filter_82599(hw,
51915197
&filter->filter,
51925198
filter->sw_idx,
5193-
(filter->action == IXGBE_FDIR_DROP_QUEUE) ?
5199+
(action == IXGBE_FDIR_DROP_QUEUE) ?
51945200
IXGBE_FDIR_DROP_QUEUE :
5195-
adapter->rx_ring[filter->action]->reg_idx);
5201+
adapter->rx_ring[action]->reg_idx);
51965202
}
51975203

51985204
spin_unlock(&adapter->fdir_perfect_lock);

0 commit comments

Comments
 (0)