All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Radoslaw Tyl <radoslawx.tyl@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 07/13] ixgbe: Fix crash with VFs and flow director on interface flap
Date: Wed,  3 Oct 2018 13:25:05 -0700	[thread overview]
Message-ID: <20181003202511.29684-8-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20181003202511.29684-1-jeffrey.t.kirsher@intel.com>

From: Radoslaw Tyl <radoslawx.tyl@intel.com>

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>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index ddc22557155b..2928ce7653eb 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -5179,6 +5179,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);
 
@@ -5187,12 +5188,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);
-- 
2.17.1

  parent reply	other threads:[~2018-10-04  3:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 20:24 [net-next 00/13][pull request] 10GbE Intel Wired LAN Driver Updates 2018-10-03 Jeff Kirsher
2018-10-03 20:24 ` [net-next 01/13] ixgbevf: fix msglen for ipsec mbx messages Jeff Kirsher
2018-10-03 20:25 ` [net-next 02/13] ixgbe: Fix ixgbe TX hangs with XDP_TX beyond queue limit Jeff Kirsher
2018-10-04  9:08   ` Sergei Shtylyov
2018-10-03 20:25 ` [net-next 03/13] ixgbe: remove redundant function ixgbe_fw_recovery_mode() Jeff Kirsher
2018-10-03 20:25 ` [net-next 04/13] ixgbevf: off by one in ixgbevf_ipsec_tx() Jeff Kirsher
2018-10-03 20:25 ` [net-next 05/13] i40e: Use proper enum in i40e_ndo_set_vf_link_state Jeff Kirsher
2018-10-03 20:25 ` [net-next 06/13] i40e: Remove unnecessary print statement Jeff Kirsher
2018-10-03 20:25 ` Jeff Kirsher [this message]
2018-10-04  9:12   ` [net-next 07/13] ixgbe: Fix crash with VFs and flow director on interface flap Sergei Shtylyov
2018-10-03 20:25 ` [net-next 08/13] ixgbe: added Rx/Tx ring disable/enable functions Jeff Kirsher
2018-10-03 20:25 ` [net-next 09/13] ixgbe: move common Rx functions to ixgbe_txrx_common.h Jeff Kirsher
2018-10-03 20:25 ` [net-next 10/13] ixgbe: add AF_XDP zero-copy Rx support Jeff Kirsher
2018-10-03 20:25 ` [net-next 11/13] ixgbe: move common Tx functions to ixgbe_txrx_common.h Jeff Kirsher
2018-10-03 20:25 ` [net-next 12/13] ixgbe: add AF_XDP zero-copy Tx support Jeff Kirsher
2018-10-03 20:25 ` [net-next 13/13] iavf: fix a typo Jeff Kirsher
2018-10-03 21:46 ` [net-next 00/13][pull request] 10GbE Intel Wired LAN Driver Updates 2018-10-03 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181003202511.29684-8-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=radoslawx.tyl@intel.com \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.