All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next 00/16][pull request] Intel Wired LAN Driver Updates
@ 2014-03-14  9:47 Jeff Kirsher
  2014-03-14  9:47 ` [net-next 01/16] ixgbe: add check for netif_carrier_ok in ixgbe_xmit_frame Jeff Kirsher
                   ` (15 more replies)
  0 siblings, 16 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann

This series contains updates to ixgbe, igb, i40e and i40evf.

Emil provides two fixes for ixgbe which could have been sent to the
net tree, but being this late in the -rc, I chose to go through net-next
and have stable pick these up.  Both fixes resolve issues found when
using netconsole, first prevents resets on ifup/ifdown when the interface
is down and the second resolves a hand with busy poll.

I provide a code comment fix which David Miller noticed in the last
series of patches I submitted.

Shannon provides a patch to cleanup the NAPI structs when deleting the
netdev.

Anjali provides several patches for i40e, first fixes a bug in the update
filter logic which was causing a kernel panic.  Then provides a fix to
rename an error bit to correctly indicate the error.  Adds a definition
for a new state variable to keep track of features automatically disabled
due to hardware resource limitations versus user enforced feature disabled.
Anjali provides a patch to add code to handle when there is a filter
programming error due to a full table, which also resolves a previous
compile warning about an unused "*pf" variable introduced in the last i40e
series patch submission.

Jesse provides three i40e patches to cleanup strings to make more
consistent and to align with other Intel drivers.

Akeem cleans up a misleading function header comment for i40e.

Mitch provides a fix for i40e/i40evf to use the correctly reported number
of MSI-X vectors in the PF an VF.  Then provides a patch to use
dma_set_mask_and_coherent() which was introduced in v3.13 and simplifies
the DMA mapping code a bit.

The following are changes since commit 177943260a6088bec51fc6c04643d84e43bef423:
  6lowpan: reassembly: un-export local functions
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master

Akeem G Abodunrin (1):
  i40e: Fix function comments

Anjali Singhai Jain (6):
  i40e: Fix a bug in the update logic for FDIR SB filter.
  i40e/i40evf: Some flow director HW definition fixes
  i40e: Define a new state variable to keep track of feature auto
    disable
  i40e: Add code to handle FD table full condition
  i40e: Bug fix for FDIR replay logic
  i40e: Let MDD events be handled by MDD handler

Emil Tantilov (2):
  ixgbe: add check for netif_carrier_ok in ixgbe_xmit_frame
  ixgbe: fix spinlock recursion with netpoll and busy poll

Jeff Kirsher (1):
  igb: Fix code comment

Jesse Brandeburg (3):
  i40e: make string references to q be queue
  i40e: cleanup strings
  i40e: simplified init string

Mitch Williams (2):
  i40e/i40evf: Use correct number of VF vectors
  i40e/i40evf: Use dma_set_mask_and_coherent

Shannon Nelson (1):
  i40e: delete netdev after deleting napi and vectors

 drivers/net/ethernet/intel/i40e/i40e.h             |  10 +-
 drivers/net/ethernet/intel/i40e/i40e_debugfs.c     |  25 ++-
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |  37 +++-
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 190 +++++++++++++++------
 drivers/net/ethernet/intel/i40e/i40e_txrx.c        |  60 ++++++-
 drivers/net/ethernet/intel/i40e/i40e_type.h        |   6 +-
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |   9 +-
 drivers/net/ethernet/intel/i40evf/i40e_type.h      |   6 +-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    |  19 +--
 drivers/net/ethernet/intel/igb/igb_main.c          |   2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe.h           |   3 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c      |  23 ++-
 12 files changed, 285 insertions(+), 105 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [net-next 01/16] ixgbe: add check for netif_carrier_ok in ixgbe_xmit_frame
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  2014-03-14 18:57   ` David Miller
  2014-03-14  9:47 ` [net-next 02/16] ixgbe: fix spinlock recursion with netpoll and busy poll Jeff Kirsher
                   ` (14 subsequent siblings)
  15 siblings, 1 reply; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem
  Cc: Emil Tantilov, netdev, gospo, sassmann, Arun Sharma,
	stable-kernel, Jeff Kirsher

From: Emil Tantilov <emil.s.tantilov@intel.com>

This patch prevents reset/s on ifdown/up which can happen if
ixgbe_xmit_frame is invoked (netconsole) while the interface is down and
there are Tx rings to clean:

     kworker/6:0-11169 [006] d..2 75290.700064: ixgbe_xmit_frame <-netpoll_send_skb_on_dev
     kworker/6:0-11169 [006] d..2 75290.700064: ixgbe_xmit_frame_ring <-ixgbe_xmit_frame
     kworker/6:0-11169 [006] .N.. 75290.700097: ixgbe_get_link_capabilities_82599 <-ixgbe_service_task
     kworker/6:0-11169 [006] .N.. 75290.700097: ixgbe_setup_mac_link_82599 <-ixgbe_service_task
     kworker/6:0-11169 [006] .N.. 75290.700099: ixgbe_get_link_capabilities_82599 <-ixgbe_setup_mac_link_82599
     kworker/6:0-11169 [006] .N.. 75290.700100: ixgbe_check_mac_link_generic <-ixgbe_service_task
     kworker/6:0-11169 [006] .N.. 75290.700103: ixgbe_update_stats <-ixgbe_service_task
     kworker/6:0-11169 [006] .N.. 75290.700289: ixgbe_service_task: initiating reset to clear Tx work after link loss

CC: Arun Sharma <asharma@fb.com>
CC: stable-kernel <stable@vger.kernel.org>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 851c413..8bea6ca 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7121,6 +7121,11 @@ static netdev_tx_t __ixgbe_xmit_frame(struct sk_buff *skb,
 	struct ixgbe_adapter *adapter = netdev_priv(netdev);
 	struct ixgbe_ring *tx_ring;
 
+	if (!netif_carrier_ok(netdev)) {
+		dev_kfree_skb_any(skb);
+		return NETDEV_TX_OK;
+	}
+
 	/*
 	 * The minimum packet size for olinfo paylen is 17 so pad the skb
 	 * in order to meet this minimum size requirement.
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [net-next 02/16] ixgbe: fix spinlock recursion with netpoll and busy poll
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
  2014-03-14  9:47 ` [net-next 01/16] ixgbe: add check for netif_carrier_ok in ixgbe_xmit_frame Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  2014-03-14 18:58   ` David Miller
  2014-03-14  9:47 ` [net-next 03/16] igb: Fix code comment Jeff Kirsher
                   ` (13 subsequent siblings)
  15 siblings, 1 reply; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem
  Cc: Emil Tantilov, netdev, gospo, sassmann, Arun Sharma, stable,
	Jacob Keller, Jeff Kirsher

From: Emil Tantilov <emil.s.tantilov@intel.com>

This patch resolves a hang with busy poll when used with netconsole.

The main change is the check for netpoll packets in ixgbe_poll() which
prevents a call to spin_lock_bh() while interrupts are disabled.

In addition it removes the call to netif_rx() since netif_receive_skb()
can deal with netpoll packets and also replaced the global adapter flag
with per-q_vector bool that indicates Rx packet from netpoll which
should help with performance.

CC: Arun Sharma <asharma@fb.com>
CC: stable <stable@vger.kernel.org>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe.h      |  3 ++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 18 +++++++++---------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 2fff0fc..d34abbc 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -386,6 +386,7 @@ struct ixgbe_q_vector {
 	int numa_node;
 	struct rcu_head rcu;	/* to avoid race with update stats on free */
 	char name[IFNAMSIZ + 9];
+	bool netpoll_rx;
 
 #ifdef CONFIG_NET_RX_BUSY_POLL
 	unsigned int state;
@@ -643,7 +644,7 @@ struct ixgbe_adapter {
 #define IXGBE_FLAG_RX_1BUF_CAPABLE              (u32)(1 << 4)
 #define IXGBE_FLAG_RX_PS_CAPABLE                (u32)(1 << 5)
 #define IXGBE_FLAG_RX_PS_ENABLED                (u32)(1 << 6)
-#define IXGBE_FLAG_IN_NETPOLL                   (u32)(1 << 7)
+
 #define IXGBE_FLAG_DCA_ENABLED                  (u32)(1 << 8)
 #define IXGBE_FLAG_DCA_CAPABLE                  (u32)(1 << 9)
 #define IXGBE_FLAG_IMIR_ENABLED                 (u32)(1 << 10)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 8bea6ca..06aab2c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -1670,14 +1670,10 @@ static void ixgbe_process_skb_fields(struct ixgbe_ring *rx_ring,
 static void ixgbe_rx_skb(struct ixgbe_q_vector *q_vector,
 			 struct sk_buff *skb)
 {
-	struct ixgbe_adapter *adapter = q_vector->adapter;
-
-	if (ixgbe_qv_busy_polling(q_vector))
+	if (ixgbe_qv_busy_polling(q_vector) || q_vector->netpoll_rx)
 		netif_receive_skb(skb);
-	else if (!(adapter->flags & IXGBE_FLAG_IN_NETPOLL))
-		napi_gro_receive(&q_vector->napi, skb);
 	else
-		netif_rx(skb);
+		napi_gro_receive(&q_vector->napi, skb);
 }
 
 /**
@@ -2159,6 +2155,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
 	u64_stats_update_end(&rx_ring->syncp);
 	q_vector->rx.total_packets += total_rx_packets;
 	q_vector->rx.total_bytes += total_rx_bytes;
+	q_vector->netpoll_rx = false;
 
 	if (cleaned_count)
 		ixgbe_alloc_rx_buffers(rx_ring, cleaned_count);
@@ -2758,6 +2755,9 @@ int ixgbe_poll(struct napi_struct *napi, int budget)
 	ixgbe_for_each_ring(ring, q_vector->tx)
 		clean_complete &= !!ixgbe_clean_tx_irq(q_vector, ring);
 
+	if (test_bit(NAPI_STATE_NPSVC, &napi->state))
+		return budget;
+
 	if (!ixgbe_qv_lock_napi(q_vector))
 		return budget;
 
@@ -7273,14 +7273,14 @@ static void ixgbe_netpoll(struct net_device *netdev)
 	if (test_bit(__IXGBE_DOWN, &adapter->state))
 		return;
 
-	adapter->flags |= IXGBE_FLAG_IN_NETPOLL;
 	if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) {
-		for (i = 0; i < adapter->num_q_vectors; i++)
+		for (i = 0; i < adapter->num_q_vectors; i++) {
+			adapter->q_vector[i]->netpoll_rx = true;
 			ixgbe_msix_clean_rings(0, adapter->q_vector[i]);
+		}
 	} else {
 		ixgbe_intr(adapter->pdev->irq, netdev);
 	}
-	adapter->flags &= ~IXGBE_FLAG_IN_NETPOLL;
 }
 
 #endif
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [net-next 03/16] igb: Fix code comment
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
  2014-03-14  9:47 ` [net-next 01/16] ixgbe: add check for netif_carrier_ok in ixgbe_xmit_frame Jeff Kirsher
  2014-03-14  9:47 ` [net-next 02/16] ixgbe: fix spinlock recursion with netpoll and busy poll Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  2014-03-14  9:47 ` [net-next 04/16] i40e: delete netdev after deleting napi and vectors Jeff Kirsher
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann

Recently added code comment was missing a space that is needed.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 340a344..ea8b9c4 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1978,7 +1978,7 @@ void igb_reset(struct igb_adapter *adapter)
 		}
 	}
 #endif
-	/*Re-establish EEE setting */
+	/* Re-establish EEE setting */
 	if (hw->phy.media_type == e1000_media_type_copper) {
 		switch (mac->type) {
 		case e1000_i350:
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [net-next 04/16] i40e: delete netdev after deleting napi and vectors
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (2 preceding siblings ...)
  2014-03-14  9:47 ` [net-next 03/16] igb: Fix code comment Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  2014-03-14  9:47 ` [net-next 05/16] i40e: Fix a bug in the update logic for FDIR SB filter Jeff Kirsher
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem
  Cc: Shannon Nelson, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

From: Shannon Nelson <shannon.nelson@intel.com>

We've been deleting the netdev before getting around to deleting the napi
structs.  Unfortunately, we then didn't delete the napi structs because we
have a check for netdev, thus we were leaving garbage around in the system.

Change-ID: Ife540176f6c9f801147495b3f2d2ac2e61ddcc58
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 43d391b..a3f122e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6806,8 +6806,6 @@ int i40e_vsi_release(struct i40e_vsi *vsi)
 			if (vsi->netdev) {
 				/* results in a call to i40e_close() */
 				unregister_netdev(vsi->netdev);
-				free_netdev(vsi->netdev);
-				vsi->netdev = NULL;
 			}
 		} else {
 			if (!test_and_set_bit(__I40E_DOWN, &vsi->state))
@@ -6826,6 +6824,10 @@ int i40e_vsi_release(struct i40e_vsi *vsi)
 
 	i40e_vsi_delete(vsi);
 	i40e_vsi_free_q_vectors(vsi);
+	if (vsi->netdev) {
+		free_netdev(vsi->netdev);
+		vsi->netdev = NULL;
+	}
 	i40e_vsi_clear_rings(vsi);
 	i40e_vsi_clear(vsi);
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [net-next 05/16] i40e: Fix a bug in the update logic for FDIR SB filter.
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (3 preceding siblings ...)
  2014-03-14  9:47 ` [net-next 04/16] i40e: delete netdev after deleting napi and vectors Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  2014-03-14  9:47 ` [net-next 06/16] i40e/i40evf: Some flow director HW definition fixes Jeff Kirsher
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem
  Cc: Anjali Singhai Jain, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

From: Anjali Singhai Jain <anjali.singhai@intel.com>

The update filter logic was causing a kernel panic in the original code.
We need to compare the input set to decide whether or not to delete a
filter since we do not have a hash stored. This new design helps fix the issue.

Change-ID: I2462b108e58ca4833312804cda730b4660cc18c9
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 27 +++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index d34ff31..718a3e0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -1357,6 +1357,24 @@ static int i40e_set_rss_hash_opt(struct i40e_pf *pf, struct ethtool_rxnfc *nfc)
 }
 
 /**
+ * i40e_match_fdir_input_set - Match a new filter against an existing one
+ * @rule: The filter already added
+ * @input: The new filter to comapre against
+ *
+ * Returns true if the two input set match
+ **/
+static bool i40e_match_fdir_input_set(struct i40e_fdir_filter *rule,
+				      struct i40e_fdir_filter *input)
+{
+	if ((rule->dst_ip[0] != input->dst_ip[0]) ||
+	    (rule->src_ip[0] != input->src_ip[0]) ||
+	    (rule->dst_port != input->dst_port) ||
+	    (rule->src_port != input->src_port))
+		return false;
+	return true;
+}
+
+/**
  * i40e_update_ethtool_fdir_entry - Updates the fdir filter entry
  * @vsi: Pointer to the targeted VSI
  * @input: The filter to update or NULL to indicate deletion
@@ -1391,11 +1409,10 @@ static int i40e_update_ethtool_fdir_entry(struct i40e_vsi *vsi,
 
 	/* if there is an old rule occupying our place remove it */
 	if (rule && (rule->fd_id == sw_idx)) {
-		if (!input || (rule->fd_id != input->fd_id)) {
-			cmd->fs.flow_type = rule->flow_type;
-			err = i40e_add_del_fdir_ethtool(vsi, cmd, false);
-		}
-
+		if (input && !i40e_match_fdir_input_set(rule, input))
+			err = i40e_add_del_fdir(vsi, rule, false);
+		else if (!input)
+			err = i40e_add_del_fdir(vsi, rule, false);
 		hlist_del(&rule->fdir_node);
 		kfree(rule);
 		pf->fdir_pf_active_filters--;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [net-next 06/16] i40e/i40evf: Some flow director HW definition fixes
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (4 preceding siblings ...)
  2014-03-14  9:47 ` [net-next 05/16] i40e: Fix a bug in the update logic for FDIR SB filter Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  2014-03-14  9:47 ` [net-next 07/16] i40e: make string references to q be queue Jeff Kirsher
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem
  Cc: Anjali Singhai Jain, netdev, gospo, sassmann, Kevin Scott,
	Catherine Sullivan, Jeff Kirsher

From: Anjali Singhai Jain <anjali.singhai@intel.com>

1) Fix a name of the error bit to correctly indicate the error.
2) Added a fd_id field in the 32 byte desc at the place(qw0) where it gets
reported in the programming error desc WB. In a normal data desc
the fd_id field is reported in qw3.

Change-ID: Ide9a24bff7273da5889c36635d629bc3b5212010
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Kevin Scott <kevin.c.scott@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_type.h   | 6 +++++-
 drivers/net/ethernet/intel/i40evf/i40e_type.h | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index 181a825..5c902f4 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -458,6 +458,10 @@ union i40e_32byte_rx_desc {
 			union {
 				__le32 rss; /* RSS Hash */
 				__le32 fcoe_param; /* FCoE DDP Context id */
+				/* Flow director filter id in case of
+				 * Programming status desc WB
+				 */
+				__le32 fd_id;
 			} hi_dword;
 		} qword0;
 		struct {
@@ -698,7 +702,7 @@ enum i40e_rx_prog_status_desc_prog_id_masks {
 enum i40e_rx_prog_status_desc_error_bits {
 	/* Note: These are predefined bit offsets */
 	I40E_RX_PROG_STATUS_DESC_FD_TBL_FULL_SHIFT	= 0,
-	I40E_RX_PROG_STATUS_DESC_NO_FD_QUOTA_SHIFT	= 1,
+	I40E_RX_PROG_STATUS_DESC_NO_FD_ENTRY_SHIFT	= 1,
 	I40E_RX_PROG_STATUS_DESC_FCOE_TBL_FULL_SHIFT	= 2,
 	I40E_RX_PROG_STATUS_DESC_FCOE_CONFLICT_SHIFT	= 3
 };
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h
index 092aace..7189d6f 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h
@@ -464,6 +464,10 @@ union i40e_32byte_rx_desc {
 			union {
 				__le32 rss; /* RSS Hash */
 				__le32 fcoe_param; /* FCoE DDP Context id */
+				/* Flow director filter id in case of
+				 * Programming status desc WB
+				 */
+				__le32 fd_id;
 			} hi_dword;
 		} qword0;
 		struct {
@@ -704,7 +708,7 @@ enum i40e_rx_prog_status_desc_prog_id_masks {
 enum i40e_rx_prog_status_desc_error_bits {
 	/* Note: These are predefined bit offsets */
 	I40E_RX_PROG_STATUS_DESC_FD_TBL_FULL_SHIFT	= 0,
-	I40E_RX_PROG_STATUS_DESC_NO_FD_QUOTA_SHIFT	= 1,
+	I40E_RX_PROG_STATUS_DESC_NO_FD_ENTRY_SHIFT	= 1,
 	I40E_RX_PROG_STATUS_DESC_FCOE_TBL_FULL_SHIFT	= 2,
 	I40E_RX_PROG_STATUS_DESC_FCOE_CONFLICT_SHIFT	= 3
 };
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [net-next 07/16] i40e: make string references to q be queue
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (5 preceding siblings ...)
  2014-03-14  9:47 ` [net-next 06/16] i40e/i40evf: Some flow director HW definition fixes Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  2014-03-14  9:47 ` [net-next 08/16] i40e: cleanup strings Jeff Kirsher
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem
  Cc: Jesse Brandeburg, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

This cleans up strings for consistency, q is replaced with queue.

Change-ID: Ia5f9dfae9af261f4c24485854264e02363729cf3
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index a3f122e..acf0b20 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -2582,7 +2582,7 @@ static void i40e_configure_msi_and_legacy(struct i40e_vsi *vsi)
 	/* FIRSTQ_INDX = 0, FIRSTQ_TYPE = 0 (rx) */
 	wr32(hw, I40E_PFINT_LNKLST0, 0);
 
-	/* Associate the queue pair to the vector and enable the q int */
+	/* Associate the queue pair to the vector and enable the queue int */
 	val = I40E_QINT_RQCTL_CAUSE_ENA_MASK		      |
 	      (I40E_RX_ITR << I40E_QINT_RQCTL_ITR_INDX_SHIFT) |
 	      (I40E_QUEUE_TYPE_TX << I40E_QINT_TQCTL_NEXTQ_TYPE_SHIFT);
@@ -5442,7 +5442,7 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
 		u8 queue = (reg & I40E_GL_MDET_TX_QUEUE_MASK)
 				>> I40E_GL_MDET_TX_QUEUE_SHIFT;
 		dev_info(&pf->pdev->dev,
-			 "Malicious Driver Detection TX event 0x%02x on q %d of function 0x%02x\n",
+			 "Malicious Driver Detection event 0x%02x on TX queue %d of function 0x%02x\n",
 			 event, queue, func);
 		wr32(hw, I40E_GL_MDET_TX, 0xffffffff);
 		mdd_detected = true;
@@ -5456,7 +5456,7 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
 		u8 queue = (reg & I40E_GL_MDET_RX_QUEUE_MASK)
 				>> I40E_GL_MDET_RX_QUEUE_SHIFT;
 		dev_info(&pf->pdev->dev,
-			 "Malicious Driver Detection RX event 0x%02x on q %d of function 0x%02x\n",
+			 "Malicious Driver Detection event 0x%02x on RX queue %d of function 0x%02x\n",
 			 event, queue, func);
 		wr32(hw, I40E_GL_MDET_RX, 0xffffffff);
 		mdd_detected = true;
@@ -6882,8 +6882,7 @@ static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi)
 	}
 
 	if (vsi->base_vector) {
-		dev_info(&pf->pdev->dev,
-			 "VSI %d has non-zero base vector %d\n",
+		dev_info(&pf->pdev->dev, "VSI %d has non-zero base vector %d\n",
 			 vsi->seid, vsi->base_vector);
 		return -EEXIST;
 	}
@@ -6902,7 +6901,7 @@ static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi)
 						 vsi->num_q_vectors, vsi->idx);
 	if (vsi->base_vector < 0) {
 		dev_info(&pf->pdev->dev,
-			 "failed to get q tracking for VSI %d, err=%d\n",
+			 "failed to get queue tracking for VSI %d, err=%d\n",
 			 vsi->seid, vsi->base_vector);
 		i40e_vsi_free_q_vectors(vsi);
 		ret = -ENOENT;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [net-next 08/16] i40e: cleanup strings
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (6 preceding siblings ...)
  2014-03-14  9:47 ` [net-next 07/16] i40e: make string references to q be queue Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  2014-03-14  9:47 ` [net-next 09/16] i40e: simplified init string Jeff Kirsher
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem
  Cc: Jesse Brandeburg, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

This patch cleans up the strings that the driver prints during normal
operation and moves many strings into dev_dbg.  It also cleans up
strings printed during reset.

Change-ID: I1835cc4e3c3b22596182b683284e6bb87eac61b2
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_debugfs.c |  8 ++---
 drivers/net/ethernet/intel/i40e/i40e_main.c    | 47 +++++++++++---------------
 2 files changed, 24 insertions(+), 31 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
index 57fc864..47b9754 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
@@ -1467,19 +1467,19 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
 				 pf->msg_enable);
 		}
 	} else if (strncmp(cmd_buf, "pfr", 3) == 0) {
-		dev_info(&pf->pdev->dev, "forcing PFR\n");
+		dev_info(&pf->pdev->dev, "debugfs: forcing PFR\n");
 		i40e_do_reset_safe(pf, (1 << __I40E_PF_RESET_REQUESTED));
 
 	} else if (strncmp(cmd_buf, "corer", 5) == 0) {
-		dev_info(&pf->pdev->dev, "forcing CoreR\n");
+		dev_info(&pf->pdev->dev, "debugfs: forcing CoreR\n");
 		i40e_do_reset_safe(pf, (1 << __I40E_CORE_RESET_REQUESTED));
 
 	} else if (strncmp(cmd_buf, "globr", 5) == 0) {
-		dev_info(&pf->pdev->dev, "forcing GlobR\n");
+		dev_info(&pf->pdev->dev, "debugfs: forcing GlobR\n");
 		i40e_do_reset_safe(pf, (1 << __I40E_GLOBAL_RESET_REQUESTED));
 
 	} else if (strncmp(cmd_buf, "empr", 4) == 0) {
-		dev_info(&pf->pdev->dev, "forcing EMPR\n");
+		dev_info(&pf->pdev->dev, "debugfs: forcing EMPR\n");
 		i40e_do_reset_safe(pf, (1 << __I40E_EMP_RESET_REQUESTED));
 
 	} else if (strncmp(cmd_buf, "read", 4) == 0) {
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index acf0b20..f7b1753ac 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -3755,8 +3755,8 @@ static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, u8 enabled_tc,
 					  NULL);
 	if (aq_ret) {
 		dev_info(&vsi->back->pdev->dev,
-			 "%s: AQ command Config VSI BW allocation per TC failed = %d\n",
-			 __func__, vsi->back->hw.aq.asq_last_status);
+			 "AQ command Config VSI BW allocation per TC failed = %d\n",
+			 vsi->back->hw.aq.asq_last_status);
 		return -EINVAL;
 	}
 
@@ -4364,7 +4364,7 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)
 		 * for the warning interrupt will deal with the shutdown
 		 * and recovery of the switch setup.
 		 */
-		dev_info(&pf->pdev->dev, "GlobalR requested\n");
+		dev_dbg(&pf->pdev->dev, "GlobalR requested\n");
 		val = rd32(&pf->hw, I40E_GLGEN_RTRIG);
 		val |= I40E_GLGEN_RTRIG_GLOBR_MASK;
 		wr32(&pf->hw, I40E_GLGEN_RTRIG, val);
@@ -4375,7 +4375,7 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)
 		 *
 		 * Same as Global Reset, except does *not* include the MAC/PHY
 		 */
-		dev_info(&pf->pdev->dev, "CoreR requested\n");
+		dev_dbg(&pf->pdev->dev, "CoreR requested\n");
 		val = rd32(&pf->hw, I40E_GLGEN_RTRIG);
 		val |= I40E_GLGEN_RTRIG_CORER_MASK;
 		wr32(&pf->hw, I40E_GLGEN_RTRIG, val);
@@ -4409,7 +4409,7 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)
 		 * the switch, since we need to do all the recovery as
 		 * for the Core Reset.
 		 */
-		dev_info(&pf->pdev->dev, "PFR requested\n");
+		dev_dbg(&pf->pdev->dev, "PFR requested\n");
 		i40e_handle_reset_warning(pf);
 
 	} else if (reset_flags & (1 << __I40E_REINIT_REQUESTED)) {
@@ -4458,18 +4458,18 @@ bool i40e_dcb_need_reconfig(struct i40e_pf *pf,
 			   &old_cfg->etscfg.prioritytable,
 			   sizeof(new_cfg->etscfg.prioritytable))) {
 			need_reconfig = true;
-			dev_info(&pf->pdev->dev, "ETS UP2TC changed.\n");
+			dev_dbg(&pf->pdev->dev, "ETS UP2TC changed.\n");
 		}
 
 		if (memcmp(&new_cfg->etscfg.tcbwtable,
 			   &old_cfg->etscfg.tcbwtable,
 			   sizeof(new_cfg->etscfg.tcbwtable)))
-			dev_info(&pf->pdev->dev, "ETS TC BW Table changed.\n");
+			dev_dbg(&pf->pdev->dev, "ETS TC BW Table changed.\n");
 
 		if (memcmp(&new_cfg->etscfg.tsatable,
 			   &old_cfg->etscfg.tsatable,
 			   sizeof(new_cfg->etscfg.tsatable)))
-			dev_info(&pf->pdev->dev, "ETS TSA Table changed.\n");
+			dev_dbg(&pf->pdev->dev, "ETS TSA Table changed.\n");
 	}
 
 	/* Check if PFC configuration has changed */
@@ -4477,7 +4477,7 @@ bool i40e_dcb_need_reconfig(struct i40e_pf *pf,
 		   &old_cfg->pfc,
 		   sizeof(new_cfg->pfc))) {
 		need_reconfig = true;
-		dev_info(&pf->pdev->dev, "PFC config change detected.\n");
+		dev_dbg(&pf->pdev->dev, "PFC config change detected.\n");
 	}
 
 	/* Check if APP Table has changed */
@@ -4485,7 +4485,7 @@ bool i40e_dcb_need_reconfig(struct i40e_pf *pf,
 		   &old_cfg->app,
 		   sizeof(new_cfg->app))) {
 		need_reconfig = true;
-		dev_info(&pf->pdev->dev, "APP Table change detected.\n");
+		dev_dbg(&pf->pdev->dev, "APP Table change detected.\n");
 	}
 
 	return need_reconfig;
@@ -4535,7 +4535,7 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,
 
 	/* No change detected in DCBX configs */
 	if (!memcmp(&tmp_dcbx_cfg, dcbx_cfg, sizeof(tmp_dcbx_cfg))) {
-		dev_info(&pf->pdev->dev, "No change detected in DCBX configuration.\n");
+		dev_dbg(&pf->pdev->dev, "No change detected in DCBX configuration.\n");
 		goto exit;
 	}
 
@@ -4593,8 +4593,8 @@ static void i40e_handle_lan_overflow_event(struct i40e_pf *pf,
 	struct i40e_vf *vf;
 	u16 vf_id;
 
-	dev_info(&pf->pdev->dev, "%s: Rx Queue Number = %d QTX_CTL=0x%08x\n",
-		 __func__, queue, qtx_ctl);
+	dev_dbg(&pf->pdev->dev, "overflow Rx Queue Number = %d QTX_CTL=0x%08x\n",
+		queue, qtx_ctl);
 
 	/* Queue belongs to VF, find the VF and issue VF reset */
 	if (((qtx_ctl & I40E_QTX_CTL_PFVF_Q_MASK)
@@ -4946,7 +4946,7 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf)
 					event.msg_size);
 			break;
 		case i40e_aqc_opc_lldp_update_mib:
-			dev_info(&pf->pdev->dev, "ARQ: Update LLDP MIB event received\n");
+			dev_dbg(&pf->pdev->dev, "ARQ: Update LLDP MIB event received\n");
 #ifdef CONFIG_I40E_DCB
 			rtnl_lock();
 			ret = i40e_handle_lldp_event(pf, &event);
@@ -4954,7 +4954,7 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf)
 #endif /* CONFIG_I40E_DCB */
 			break;
 		case i40e_aqc_opc_event_lan_overflow:
-			dev_info(&pf->pdev->dev, "ARQ LAN queue overflow event received\n");
+			dev_dbg(&pf->pdev->dev, "ARQ LAN queue overflow event received\n");
 			i40e_handle_lan_overflow_event(pf, &event);
 			break;
 		case i40e_aqc_opc_send_msg_to_peer:
@@ -5231,7 +5231,7 @@ static int i40e_prep_for_reset(struct i40e_pf *pf)
 	if (test_and_set_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state))
 		return 0;
 
-	dev_info(&pf->pdev->dev, "Tearing down internal switch for reset\n");
+	dev_dbg(&pf->pdev->dev, "Tearing down internal switch for reset\n");
 
 	if (i40e_check_asq_alive(hw))
 		i40e_vc_notify_reset(pf);
@@ -5278,7 +5278,7 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
 
 	if (test_bit(__I40E_DOWN, &pf->state))
 		goto end_core_reset;
-	dev_info(&pf->pdev->dev, "Rebuilding internal switch\n");
+	dev_dbg(&pf->pdev->dev, "Rebuilding internal switch\n");
 
 	/* rebuild the basics for the AdminQ, HMC, and initial HW switch */
 	ret = i40e_init_adminq(&pf->hw);
@@ -5328,7 +5328,7 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
 	 * try to recover minimal use by getting the basic PF VSI working.
 	 */
 	if (pf->vsi[pf->lan_vsi]->uplink_seid != pf->mac_seid) {
-		dev_info(&pf->pdev->dev, "attempting to rebuild switch\n");
+		dev_dbg(&pf->pdev->dev, "attempting to rebuild switch\n");
 		/* find the one VEB connected to the MAC, and find orphans */
 		for (v = 0; v < I40E_MAX_VEB; v++) {
 			if (!pf->veb[v])
@@ -5393,7 +5393,7 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
 	dv.subbuild_version = 0;
 	i40e_aq_send_driver_version(&pf->hw, &dv, NULL);
 
-	dev_info(&pf->pdev->dev, "PF reset done\n");
+	dev_info(&pf->pdev->dev, "reset complete\n");
 
 end_core_reset:
 	clear_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state);
@@ -6293,12 +6293,8 @@ static int i40e_sw_init(struct i40e_pf *pf)
 	    (pf->hw.func_caps.fd_filters_best_effort > 0)) {
 		pf->flags |= I40E_FLAG_FD_ATR_ENABLED;
 		pf->atr_sample_rate = I40E_DEFAULT_ATR_SAMPLE_RATE;
-		dev_info(&pf->pdev->dev,
-			"Flow Director ATR mode Enabled\n");
 		if (!(pf->flags & I40E_FLAG_MFP_ENABLED)) {
 			pf->flags |= I40E_FLAG_FD_SB_ENABLED;
-			dev_info(&pf->pdev->dev,
-				 "Flow Director Side Band mode Enabled\n");
 		} else {
 			dev_info(&pf->pdev->dev,
 				 "Flow Director Side Band mode Disabled in MFP mode\n");
@@ -6322,9 +6318,6 @@ static int i40e_sw_init(struct i40e_pf *pf)
 		pf->num_req_vfs = min_t(int,
 					pf->hw.func_caps.num_vfs,
 					I40E_MAX_VF_COUNT);
-		dev_info(&pf->pdev->dev,
-			 "Number of VFs being requested for PF[%d] = %d\n",
-			 pf->hw.pf_id, pf->num_req_vfs);
 	}
 #endif /* CONFIG_PCI_IOV */
 	pf->eeprom_version = 0xDEAD;
@@ -8131,7 +8124,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	i40e_set_pci_config_data(hw, link_status);
 
-	dev_info(&pdev->dev, "PCI Express: %s %s\n",
+	dev_info(&pdev->dev, "PCI-Express: %s %s\n",
 		(hw->bus.speed == i40e_bus_speed_8000 ? "Speed 8.0GT/s" :
 		 hw->bus.speed == i40e_bus_speed_5000 ? "Speed 5.0GT/s" :
 		 hw->bus.speed == i40e_bus_speed_2500 ? "Speed 2.5GT/s" :
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [net-next 09/16] i40e: simplified init string
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (7 preceding siblings ...)
  2014-03-14  9:47 ` [net-next 08/16] i40e: cleanup strings Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  2014-03-14  9:47 ` [net-next 10/16] i40e: Fix function comments Jeff Kirsher
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem
  Cc: Jesse Brandeburg, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

In a similar way to how ixgbe works, print a short one-line string
showing what features and number of queues the driver and hardware has
enabled at probe time.

Example (wrapped for the commit message):
i40e 0000:06:00.1: Features: PF-id[1] VFs: 64 VSIs: 66 QP: 32 FDir RSS
ATR NTUPLE DCB

Change-ID: I177bf7f93d1c4c921529c92fdf66e614f6b4f755
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 41 +++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index f7b1753ac..79be808 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7851,6 +7851,44 @@ static int i40e_setup_pf_filter_control(struct i40e_pf *pf)
 	return 0;
 }
 
+#define INFO_STRING_LEN 255
+static void i40e_print_features(struct i40e_pf *pf)
+{
+	struct i40e_hw *hw = &pf->hw;
+	char *buf, *string;
+
+	string = kzalloc(INFO_STRING_LEN, GFP_KERNEL);
+	if (!string) {
+		dev_err(&pf->pdev->dev, "Features string allocation failed\n");
+		return;
+	}
+
+	buf = string;
+
+	buf += sprintf(string, "Features: PF-id[%d] ", hw->pf_id);
+#ifdef CONFIG_PCI_IOV
+	buf += sprintf(buf, "VFs: %d ", pf->num_req_vfs);
+#endif
+	buf += sprintf(buf, "VSIs: %d QP: %d ", pf->hw.func_caps.num_vsis,
+		       pf->vsi[pf->lan_vsi]->num_queue_pairs);
+
+	if (pf->flags & I40E_FLAG_RSS_ENABLED)
+		buf += sprintf(buf, "RSS ");
+	buf += sprintf(buf, "FDir ");
+	if (pf->flags & I40E_FLAG_FD_ATR_ENABLED)
+		buf += sprintf(buf, "ATR ");
+	if (pf->flags & I40E_FLAG_FD_SB_ENABLED)
+		buf += sprintf(buf, "NTUPLE ");
+	if (pf->flags & I40E_FLAG_DCB_ENABLED)
+		buf += sprintf(buf, "DCB ");
+	if (pf->flags & I40E_FLAG_PTP)
+		buf += sprintf(buf, "PTP ");
+
+	BUG_ON(buf > (string + INFO_STRING_LEN));
+	dev_info(&pf->pdev->dev, "%s\n", string);
+	kfree(string);
+}
+
 /**
  * i40e_probe - Device initialization routine
  * @pdev: PCI device information struct
@@ -8141,6 +8179,9 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		dev_warn(&pdev->dev, "Please move the device to a different PCI-e link with more lanes and/or higher transfer rate.\n");
 	}
 
+	/* print a string summarizing features */
+	i40e_print_features(pf);
+
 	return 0;
 
 	/* Unwind what we've done if something failed in the setup */
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [net-next 10/16] i40e: Fix function comments
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (8 preceding siblings ...)
  2014-03-14  9:47 ` [net-next 09/16] i40e: simplified init string Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  2014-03-14  9:47 ` [net-next 11/16] i40e: Define a new state variable to keep track of feature auto disable Jeff Kirsher
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem
  Cc: Akeem G Abodunrin, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

From: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>

Correct misleading function comment.

Change-ID: I3f66cff5cc00250a285756b6500a58fad8eba4b5
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 79be808..63776ea 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -1985,7 +1985,7 @@ static int i40e_vlan_rx_add_vid(struct net_device *netdev,
  * @netdev: network interface to be adjusted
  * @vid: vlan id to be removed
  *
- * net_device_ops implementation for adding vlan ids
+ * net_device_ops implementation for removing vlan ids
  **/
 static int i40e_vlan_rx_kill_vid(struct net_device *netdev,
 				 __always_unused __be16 proto, u16 vid)
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [net-next 11/16] i40e: Define a new state variable to keep track of feature auto disable
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (9 preceding siblings ...)
  2014-03-14  9:47 ` [net-next 10/16] i40e: Fix function comments Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  2014-03-14  9:47 ` [net-next 12/16] i40e: Add code to handle FD table full condition Jeff Kirsher
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem
  Cc: Anjali Singhai Jain, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

From: Anjali Singhai Jain <anjali.singhai@intel.com>

This variable is a bit mask. It is needed to differentiate between
user enforced feature disables and auto disable of features due to
HW resource limitations.

Change-ID: Ib4b4f6ae1bb2668c12e482d2555100bc8ad713d5
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 838b69b..a191653 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -263,6 +263,9 @@ struct i40e_pf {
 #define I40E_FLAG_VXLAN_FILTER_SYNC            (u64)(1 << 27)
 #endif
 
+	/* tracks features that get auto disabled by errors */
+	u64 auto_disable_flags;
+
 	bool stat_offsets_loaded;
 	struct i40e_hw_port_stats stats;
 	struct i40e_hw_port_stats stats_offsets;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [net-next 12/16] i40e: Add code to handle FD table full condition
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (10 preceding siblings ...)
  2014-03-14  9:47 ` [net-next 11/16] i40e: Define a new state variable to keep track of feature auto disable Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  2014-03-14  9:47 ` [net-next 13/16] i40e: Bug fix for FDIR replay logic Jeff Kirsher
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem
  Cc: Anjali Singhai Jain, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

From: Anjali Singhai Jain <anjali.singhai@intel.com>

Add code to enforce the following policy:
- If the HW reports filter programming error, we check if it's due to a
  full table.
- If so, we go ahead and turn off new rule addition for ATR and then SB
  in that order.
- We monitor the programmed filter count, if enough room is created due
  to filter deletion/reset, we then re-enable SB and ATR new rule addition.

Change-ID: I69d24b29e5c45bc4fa861258e11c2fa7b8868748
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e.h         |  7 ++-
 drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 17 ++++++--
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 10 ++++-
 drivers/net/ethernet/intel/i40e/i40e_main.c    | 58 ++++++++++++++++++++++++-
 drivers/net/ethernet/intel/i40e/i40e_txrx.c    | 60 ++++++++++++++++++++++----
 5 files changed, 135 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index a191653..bd1b469 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -152,7 +152,10 @@ struct i40e_lump_tracking {
 };
 
 #define I40E_DEFAULT_ATR_SAMPLE_RATE	20
-#define I40E_FDIR_MAX_RAW_PACKET_SIZE   512
+#define I40E_FDIR_MAX_RAW_PACKET_SIZE	512
+#define I40E_FDIR_BUFFER_FULL_MARGIN	10
+#define I40E_FDIR_BUFFER_HEAD_ROOM	200
+
 struct i40e_fdir_filter {
 	struct hlist_node fdir_node;
 	/* filter ipnut set */
@@ -553,6 +556,8 @@ int i40e_program_fdir_filter(struct i40e_fdir_filter *fdir_data, u8 *raw_packet,
 			     struct i40e_pf *pf, bool add);
 int i40e_add_del_fdir(struct i40e_vsi *vsi,
 		      struct i40e_fdir_filter *input, bool add);
+void i40e_fdir_check_and_reenable(struct i40e_pf *pf);
+int i40e_get_current_fd_count(struct i40e_pf *pf);
 void i40e_set_ethtool_ops(struct net_device *netdev);
 struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi,
 					u8 *macaddr, s16 vlan,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
index 47b9754..afd43d7 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
@@ -1011,10 +1011,12 @@ static void i40e_dbg_dump_veb_all(struct i40e_pf *pf)
  **/
 static void i40e_dbg_cmd_fd_ctrl(struct i40e_pf *pf, u64 flag, bool enable)
 {
-	if (enable)
+	if (enable) {
 		pf->flags |= flag;
-	else
+	} else {
 		pf->flags &= ~flag;
+		pf->auto_disable_flags |= flag;
+	}
 	dev_info(&pf->pdev->dev, "requesting a pf reset\n");
 	i40e_do_reset_safe(pf, (1 << __I40E_PF_RESET_REQUESTED));
 }
@@ -1670,6 +1672,15 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
 		bool add = false;
 		int ret;
 
+		if (!(pf->flags & I40E_FLAG_FD_SB_ENABLED))
+			goto command_write_done;
+
+		if (strncmp(cmd_buf, "add", 3) == 0)
+			add = true;
+
+		if (add && (pf->auto_disable_flags & I40E_FLAG_FD_SB_ENABLED))
+			goto command_write_done;
+
 		asc_packet = kzalloc(I40E_FDIR_MAX_RAW_PACKET_SIZE,
 				     GFP_KERNEL);
 		if (!asc_packet)
@@ -1684,8 +1695,6 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
 			goto command_write_done;
 		}
 
-		if (strncmp(cmd_buf, "add", 3) == 0)
-			add = true;
 		cnt = sscanf(&cmd_buf[13],
 			     "%hx %2hhx %2hhx %hx %2hhx %2hhx %hx %x %hd %511s",
 			     &fd_data.q_index,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 718a3e0..8ee224f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -1460,6 +1460,7 @@ static int i40e_del_fdir_entry(struct i40e_vsi *vsi,
 
 	ret = i40e_update_ethtool_fdir_entry(vsi, NULL, fsp->location, cmd);
 
+	i40e_fdir_check_and_reenable(pf);
 	return ret;
 }
 
@@ -1483,9 +1484,16 @@ static int i40e_add_del_fdir_ethtool(struct i40e_vsi *vsi,
 	if (!vsi)
 		return -EINVAL;
 
-	fsp = (struct ethtool_rx_flow_spec *)&cmd->fs;
 	pf = vsi->back;
 
+	if (!(pf->flags & I40E_FLAG_FD_SB_ENABLED))
+		return -EOPNOTSUPP;
+
+	if (add && (pf->auto_disable_flags & I40E_FLAG_FD_SB_ENABLED))
+		return -ENOSPC;
+
+	fsp = (struct ethtool_rx_flow_spec *)&cmd->fs;
+
 	if (fsp->location >= (pf->hw.func_caps.fd_filters_best_effort +
 			      pf->hw.func_caps.fd_filters_guaranteed)) {
 		return -EINVAL;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 63776ea..6185856 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -2436,6 +2436,9 @@ static void i40e_fdir_filter_restore(struct i40e_vsi *vsi)
 	struct i40e_pf *pf = vsi->back;
 	struct hlist_node *node;
 
+	if (!(pf->flags & I40E_FLAG_FD_SB_ENABLED))
+		return;
+
 	hlist_for_each_entry_safe(filter, node,
 				  &pf->fdir_filter_list, fdir_node) {
 		i40e_add_del_fdir(vsi, filter, true);
@@ -4624,6 +4627,54 @@ static void i40e_service_event_complete(struct i40e_pf *pf)
 }
 
 /**
+ * i40e_get_current_fd_count - Get the count of FD filters programmed in the HW
+ * @pf: board private structure
+ **/
+int i40e_get_current_fd_count(struct i40e_pf *pf)
+{
+	int val, fcnt_prog;
+	val = rd32(&pf->hw, I40E_PFQF_FDSTAT);
+	fcnt_prog = (val & I40E_PFQF_FDSTAT_GUARANT_CNT_MASK) +
+		    ((val & I40E_PFQF_FDSTAT_BEST_CNT_MASK) >>
+		      I40E_PFQF_FDSTAT_BEST_CNT_SHIFT);
+	return fcnt_prog;
+}
+
+/**
+ * i40e_fdir_check_and_reenable - Function to reenabe FD ATR or SB if disabled
+ * @pf: board private structure
+ **/
+void i40e_fdir_check_and_reenable(struct i40e_pf *pf)
+{
+	u32 fcnt_prog, fcnt_avail;
+
+	/* Check if, FD SB or ATR was auto disabled and if there is enough room
+	 * to re-enable
+	 */
+	if ((pf->flags & I40E_FLAG_FD_ATR_ENABLED) &&
+	    (pf->flags & I40E_FLAG_FD_SB_ENABLED))
+		return;
+	fcnt_prog = i40e_get_current_fd_count(pf);
+	fcnt_avail = pf->hw.fdir_shared_filter_count +
+					       pf->fdir_pf_filter_count;
+	if (fcnt_prog < (fcnt_avail - I40E_FDIR_BUFFER_HEAD_ROOM)) {
+		if ((pf->flags & I40E_FLAG_FD_SB_ENABLED) &&
+		    (pf->auto_disable_flags & I40E_FLAG_FD_SB_ENABLED)) {
+			pf->auto_disable_flags &= ~I40E_FLAG_FD_SB_ENABLED;
+			dev_info(&pf->pdev->dev, "FD Sideband/ntuple is being enabled since we have space in the table now\n");
+		}
+	}
+	/* Wait for some more space to be available to turn on ATR */
+	if (fcnt_prog < (fcnt_avail - I40E_FDIR_BUFFER_HEAD_ROOM * 2)) {
+		if ((pf->flags & I40E_FLAG_FD_ATR_ENABLED) &&
+		    (pf->auto_disable_flags & I40E_FLAG_FD_ATR_ENABLED)) {
+			pf->auto_disable_flags &= ~I40E_FLAG_FD_ATR_ENABLED;
+			dev_info(&pf->pdev->dev, "ATR is being enabled since we have space in the table now\n");
+		}
+	}
+}
+
+/**
  * i40e_fdir_reinit_subtask - Worker thread to reinit FDIR filter table
  * @pf: board private structure
  **/
@@ -4632,11 +4683,14 @@ static void i40e_fdir_reinit_subtask(struct i40e_pf *pf)
 	if (!(pf->flags & I40E_FLAG_FDIR_REQUIRES_REINIT))
 		return;
 
-	pf->flags &= ~I40E_FLAG_FDIR_REQUIRES_REINIT;
-
 	/* if interface is down do nothing */
 	if (test_bit(__I40E_DOWN, &pf->state))
 		return;
+	i40e_fdir_check_and_reenable(pf);
+
+	if ((pf->flags & I40E_FLAG_FD_ATR_ENABLED) &&
+	    (pf->flags & I40E_FLAG_FD_SB_ENABLED))
+		pf->flags &= ~I40E_FLAG_FDIR_REQUIRES_REINIT;
 }
 
 /**
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 2081bdb..daa3b29 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -430,23 +430,61 @@ int i40e_add_del_fdir(struct i40e_vsi *vsi,
 /**
  * i40e_fd_handle_status - check the Programming Status for FD
  * @rx_ring: the Rx ring for this descriptor
- * @qw: the descriptor data
+ * @rx_desc: the Rx descriptor for programming Status, not a packet descriptor.
  * @prog_id: the id originally used for programming
  *
  * This is used to verify if the FD programming or invalidation
  * requested by SW to the HW is successful or not and take actions accordingly.
  **/
-static void i40e_fd_handle_status(struct i40e_ring *rx_ring, u32 qw, u8 prog_id)
+static void i40e_fd_handle_status(struct i40e_ring *rx_ring,
+				  union i40e_rx_desc *rx_desc, u8 prog_id)
 {
-	struct pci_dev *pdev = rx_ring->vsi->back->pdev;
+	struct i40e_pf *pf = rx_ring->vsi->back;
+	struct pci_dev *pdev = pf->pdev;
+	u32 fcnt_prog, fcnt_avail;
 	u32 error;
+	u64 qw;
 
+	qw = le64_to_cpu(rx_desc->wb.qword1.status_error_len);
 	error = (qw & I40E_RX_PROG_STATUS_DESC_QW1_ERROR_MASK) >>
 		I40E_RX_PROG_STATUS_DESC_QW1_ERROR_SHIFT;
 
-	/* for now just print the Status */
-	dev_info(&pdev->dev, "FD programming id %02x, Status %08x\n",
-		 prog_id, error);
+	if (error == (0x1 << I40E_RX_PROG_STATUS_DESC_FD_TBL_FULL_SHIFT)) {
+		dev_warn(&pdev->dev, "ntuple filter loc = %d, could not be added\n",
+			 rx_desc->wb.qword0.hi_dword.fd_id);
+
+		/* filter programming failed most likely due to table full */
+		fcnt_prog = i40e_get_current_fd_count(pf);
+		fcnt_avail = pf->hw.fdir_shared_filter_count +
+						       pf->fdir_pf_filter_count;
+
+		/* If ATR is running fcnt_prog can quickly change,
+		 * if we are very close to full, it makes sense to disable
+		 * FD ATR/SB and then re-enable it when there is room.
+		 */
+		if (fcnt_prog >= (fcnt_avail - I40E_FDIR_BUFFER_FULL_MARGIN)) {
+			/* Turn off ATR first */
+			if (pf->flags | I40E_FLAG_FD_ATR_ENABLED) {
+				pf->flags &= ~I40E_FLAG_FD_ATR_ENABLED;
+				dev_warn(&pdev->dev, "FD filter space full, ATR for further flows will be turned off\n");
+				pf->auto_disable_flags |=
+						       I40E_FLAG_FD_ATR_ENABLED;
+				pf->flags |= I40E_FLAG_FDIR_REQUIRES_REINIT;
+			} else if (pf->flags | I40E_FLAG_FD_SB_ENABLED) {
+				pf->flags &= ~I40E_FLAG_FD_SB_ENABLED;
+				dev_warn(&pdev->dev, "FD filter space full, new ntuple rules will not be added\n");
+				pf->auto_disable_flags |=
+							I40E_FLAG_FD_SB_ENABLED;
+				pf->flags |= I40E_FLAG_FDIR_REQUIRES_REINIT;
+			}
+		} else {
+			dev_info(&pdev->dev, "FD filter programming error");
+		}
+	} else if (error ==
+			  (0x1 << I40E_RX_PROG_STATUS_DESC_NO_FD_ENTRY_SHIFT)) {
+		netdev_info(rx_ring->vsi->netdev, "ntuple filter loc = %d, could not be removed\n",
+			    rx_desc->wb.qword0.hi_dword.fd_id);
+	}
 }
 
 /**
@@ -843,7 +881,7 @@ static void i40e_clean_programming_status(struct i40e_ring *rx_ring,
 		  I40E_RX_PROG_STATUS_DESC_QW1_PROGID_SHIFT;
 
 	if (id == I40E_RX_PROG_STATUS_DESC_FD_FILTER_STATUS)
-		i40e_fd_handle_status(rx_ring, qw, id);
+		i40e_fd_handle_status(rx_ring, rx_desc, id);
 }
 
 /**
@@ -1536,8 +1574,6 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb,
 	if (!tx_ring->atr_sample_rate)
 		return;
 
-	tx_ring->atr_count++;
-
 	/* snag network header to get L4 type and address */
 	hdr.network = skb_network_header(skb);
 
@@ -1559,6 +1595,12 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb,
 
 	th = (struct tcphdr *)(hdr.network + hlen);
 
+	/* Due to lack of space, no more new filters can be programmed */
+	if (th->syn && (pf->auto_disable_flags & I40E_FLAG_FD_ATR_ENABLED))
+		return;
+
+	tx_ring->atr_count++;
+
 	/* sample on all syn/fin packets or once every atr sample rate */
 	if (!th->fin && !th->syn && (tx_ring->atr_count < tx_ring->atr_sample_rate))
 		return;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [net-next 13/16] i40e: Bug fix for FDIR replay logic
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (11 preceding siblings ...)
  2014-03-14  9:47 ` [net-next 12/16] i40e: Add code to handle FD table full condition Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  2014-03-14  9:47 ` [net-next 14/16] i40e: Let MDD events be handled by MDD handler Jeff Kirsher
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem
  Cc: Anjali Singhai Jain, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

From: Anjali Singhai Jain <anjali.singhai@intel.com>

The FDIR replay logic was being run a little too soon (before the
queues were enabled) and hence the tail bump was not effective till
a later transaction happened on the queue.

Change-ID: Icfd7cd2e79fc3cae3cbd3f703a2b3a148b4e7bf6
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 6185856..669715b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -2456,8 +2456,6 @@ static int i40e_vsi_configure(struct i40e_vsi *vsi)
 	i40e_set_vsi_rx_mode(vsi);
 	i40e_restore_vlan(vsi);
 	i40e_vsi_config_dcb_rings(vsi);
-	if (vsi->type == I40E_VSI_FDIR)
-		i40e_fdir_filter_restore(vsi);
 	err = i40e_vsi_configure_tx(vsi);
 	if (!err)
 		err = i40e_vsi_configure_rx(vsi);
@@ -4088,6 +4086,10 @@ static int i40e_up_complete(struct i40e_vsi *vsi)
 	} else if (vsi->netdev) {
 		netdev_info(vsi->netdev, "NIC Link is Down\n");
 	}
+
+	/* replay FDIR SB filters */
+	if (vsi->type == I40E_VSI_FDIR)
+		i40e_fdir_filter_restore(vsi);
 	i40e_service_event_schedule(pf);
 
 	return 0;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [net-next 14/16] i40e: Let MDD events be handled by MDD handler
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (12 preceding siblings ...)
  2014-03-14  9:47 ` [net-next 13/16] i40e: Bug fix for FDIR replay logic Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  2014-03-14  9:47 ` [net-next 15/16] i40e/i40evf: Use correct number of VF vectors Jeff Kirsher
  2014-03-14  9:47 ` [net-next 16/16] i40e/i40evf: Use dma_set_mask_and_coherent Jeff Kirsher
  15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem; +Cc: Anjali Singhai Jain, netdev, gospo, sassmann, Jeff Kirsher

From: Anjali Singhai Jain <anjali.singhai@intel.com>

We have a separate handler for MDD events, a generic reset is not required.

Change-ID: I77858e2d479e4e65c52aede67109464649ea0253
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 669715b..54e1462 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -2892,8 +2892,7 @@ static irqreturn_t i40e_intr(int irq, void *data)
 			 icr0_remaining);
 		if ((icr0_remaining & I40E_PFINT_ICR0_PE_CRITERR_MASK) ||
 		    (icr0_remaining & I40E_PFINT_ICR0_PCI_EXCEPTION_MASK) ||
-		    (icr0_remaining & I40E_PFINT_ICR0_ECC_ERR_MASK) ||
-		    (icr0_remaining & I40E_PFINT_ICR0_MAL_DETECT_MASK)) {
+		    (icr0_remaining & I40E_PFINT_ICR0_ECC_ERR_MASK)) {
 			dev_info(&pf->pdev->dev, "device will be reset\n");
 			set_bit(__I40E_PF_RESET_REQUESTED, &pf->state);
 			i40e_service_event_schedule(pf);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [net-next 15/16] i40e/i40evf: Use correct number of VF vectors
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (13 preceding siblings ...)
  2014-03-14  9:47 ` [net-next 14/16] i40e: Let MDD events be handled by MDD handler Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  2014-03-14  9:47 ` [net-next 16/16] i40e/i40evf: Use dma_set_mask_and_coherent Jeff Kirsher
  15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem
  Cc: Mitch Williams, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

From: Mitch Williams <mitch.a.williams@intel.com>

Now that the 2.4 firmware reports the correct number of MSI-X vectors,
use this value correctly when communicating with the VF, and when
setting up the interrupt linked list.

The PF has always reported the correct number of MSI-X vectors, so we
should never increment the value in the vf driver.

Change-ID: Ifeefc631c321390192219ce2af9ada6180c1492f
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 9 +++++----
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 42cc6ba..7839343 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -69,7 +69,7 @@ static inline bool i40e_vc_isvalid_vector_id(struct i40e_vf *vf, u8 vector_id)
 {
 	struct i40e_pf *pf = vf->pf;
 
-	return vector_id <= pf->hw.func_caps.num_msix_vectors_vf;
+	return vector_id < pf->hw.func_caps.num_msix_vectors_vf;
 }
 
 /***********************vf resource mgmt routines*****************/
@@ -126,8 +126,8 @@ static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_idx,
 		reg_idx = I40E_VPINT_LNKLST0(vf->vf_id);
 	else
 		reg_idx = I40E_VPINT_LNKLSTN(
-					   (pf->hw.func_caps.num_msix_vectors_vf
-					      * vf->vf_id) + (vector_id - 1));
+		     ((pf->hw.func_caps.num_msix_vectors_vf - 1) * vf->vf_id) +
+		     (vector_id - 1));
 
 	if (vecmap->rxq_map == 0 && vecmap->txq_map == 0) {
 		/* Special case - No queues mapped on this vector */
@@ -506,7 +506,8 @@ static void i40e_free_vf_res(struct i40e_vf *vf)
 		vf->lan_vsi_index = 0;
 		vf->lan_vsi_id = 0;
 	}
-	msix_vf = pf->hw.func_caps.num_msix_vectors_vf + 1;
+	msix_vf = pf->hw.func_caps.num_msix_vectors_vf;
+
 	/* disable interrupts so the VF starts in a known state */
 	for (i = 0; i < msix_vf; i++) {
 		/* format is same for both registers */
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 11d0b61..8daab3a 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1141,7 +1141,7 @@ static int i40evf_set_interrupt_capability(struct i40evf_adapter *adapter)
 	 * (roughly) twice the number of vectors as there are CPU's.
 	 */
 	v_budget = min(pairs, (int)(num_online_cpus() * 2)) + NONQ_VECS;
-	v_budget = min(v_budget, (int)adapter->vf_res->max_vectors + 1);
+	v_budget = min(v_budget, (int)adapter->vf_res->max_vectors);
 
 	/* A failure in MSI-X entry allocation isn't fatal, but it does
 	 * mean we disable MSI-X capabilities of the adapter.
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [net-next 16/16] i40e/i40evf: Use dma_set_mask_and_coherent
  2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
                   ` (14 preceding siblings ...)
  2014-03-14  9:47 ` [net-next 15/16] i40e/i40evf: Use correct number of VF vectors Jeff Kirsher
@ 2014-03-14  9:47 ` Jeff Kirsher
  15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-14  9:47 UTC (permalink / raw)
  To: davem
  Cc: Mitch Williams, netdev, gospo, sassmann, Catherine Sullivan,
	Jeff Kirsher

From: Mitch Williams <mitch.a.williams@intel.com>

In Linux 3.13, dma_set_mask_and_coherent was introduced, and we have
been encouraged to use it. It simplifies the DMA mapping code a bit as
well.

Change-ID: I66e340245af7d0dedfa8b40fec1f5e352754432e
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Catherine Sullivan  <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 16 ++++++----------
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 17 ++++++-----------
 2 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 54e1462..7379e5a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7970,16 +7970,12 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		return err;
 
 	/* set up for high or low dma */
-	if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
-		/* coherent mask for the same size will always succeed if
-		 * dma_set_mask does
-		 */
-		dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
-	} else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
-		dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
-	} else {
-		dev_err(&pdev->dev, "DMA configuration failed: %d\n", err);
-		err = -EIO;
+	err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (err)
+		err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	if (err) {
+		dev_err(&pdev->dev,
+			"DMA configuration failed: 0x%x\n", err);
 		goto err_dma;
 	}
 
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 8daab3a..d62e27f 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2182,17 +2182,12 @@ static int i40evf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (err)
 		return err;
 
-	if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
-		/* coherent mask for the same size will always succeed if
-		 * dma_set_mask does
-		 */
-		dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
-	} else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
-		dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
-	} else {
-		dev_err(&pdev->dev, "%s: DMA configuration failed: %d\n",
-			 __func__, err);
-		err = -EIO;
+	err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+	if (err)
+		err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	if (err) {
+		dev_err(&pdev->dev,
+			"DMA configuration failed: 0x%x\n", err);
 		goto err_dma;
 	}
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [net-next 01/16] ixgbe: add check for netif_carrier_ok in ixgbe_xmit_frame
  2014-03-14  9:47 ` [net-next 01/16] ixgbe: add check for netif_carrier_ok in ixgbe_xmit_frame Jeff Kirsher
@ 2014-03-14 18:57   ` David Miller
  2014-03-14 20:19     ` Tantilov, Emil S
  0 siblings, 1 reply; 26+ messages in thread
From: David Miller @ 2014-03-14 18:57 UTC (permalink / raw)
  To: jeffrey.t.kirsher
  Cc: emil.s.tantilov, netdev, gospo, sassmann, asharma, stable

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 14 Mar 2014 02:47:11 -0700

> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index 851c413..8bea6ca 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -7121,6 +7121,11 @@ static netdev_tx_t __ixgbe_xmit_frame(struct sk_buff *skb,
>  	struct ixgbe_adapter *adapter = netdev_priv(netdev);
>  	struct ixgbe_ring *tx_ring;
>  
> +	if (!netif_carrier_ok(netdev)) {
> +		dev_kfree_skb_any(skb);
> +		return NETDEV_TX_OK;
> +	}
> +

I would much prefer that this check moves into netpoll's direct invocation of
->ndo_start_xmit().

Otherwise every driver will start to add this check and that kind of
duplication doesn't make any sense at all.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [net-next 02/16] ixgbe: fix spinlock recursion with netpoll and busy poll
  2014-03-14  9:47 ` [net-next 02/16] ixgbe: fix spinlock recursion with netpoll and busy poll Jeff Kirsher
@ 2014-03-14 18:58   ` David Miller
  2014-03-14 20:40     ` Tantilov, Emil S
  0 siblings, 1 reply; 26+ messages in thread
From: David Miller @ 2014-03-14 18:58 UTC (permalink / raw)
  To: jeffrey.t.kirsher
  Cc: emil.s.tantilov, netdev, gospo, sassmann, asharma, stable,
	jacob.e.keller

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 14 Mar 2014 02:47:12 -0700

> From: Emil Tantilov <emil.s.tantilov@intel.com>
> 
> This patch resolves a hang with busy poll when used with netconsole.
> 
> The main change is the check for netpoll packets in ixgbe_poll() which
> prevents a call to spin_lock_bh() while interrupts are disabled.
> 
> In addition it removes the call to netif_rx() since netif_receive_skb()
> can deal with netpoll packets and also replaced the global adapter flag
> with per-q_vector bool that indicates Rx packet from netpoll which
> should help with performance.
> 
> CC: Arun Sharma <asharma@fb.com>
> CC: stable <stable@vger.kernel.org>
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Eric Biederman and co. are working to make this completely unnecessary.

What is going to happen is that poll will be called with a budget of
zero, and no RX processing will thus occur, for netpoll.

Nothing in the RX path can handle being invoked from hardware
interrupt context, so we have to prevent it completely in all
drivers that support netpoll.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: [net-next 01/16] ixgbe: add check for netif_carrier_ok in ixgbe_xmit_frame
  2014-03-14 18:57   ` David Miller
@ 2014-03-14 20:19     ` Tantilov, Emil S
  2014-03-14 21:51       ` David Miller
  0 siblings, 1 reply; 26+ messages in thread
From: Tantilov, Emil S @ 2014-03-14 20:19 UTC (permalink / raw)
  To: David Miller, Kirsher, Jeffrey T; +Cc: netdev, gospo, sassmann, asharma, stable

>-----Original Message-----
>From: David Miller [mailto:davem@davemloft.net]
>Sent: Friday, March 14, 2014 11:58 AM
>To: Kirsher, Jeffrey T
>Cc: Tantilov, Emil S; netdev@vger.kernel.org;
>gospo@redhat.com; sassmann@redhat.com; asharma@fb.com;
>stable@vger.kernel.org
>Subject: Re: [net-next 01/16] ixgbe: add check for
>netif_carrier_ok in ixgbe_xmit_frame
>
>From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>Date: Fri, 14 Mar 2014 02:47:11 -0700
>
>> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> index 851c413..8bea6ca 100644
>> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> @@ -7121,6 +7121,11 @@ static netdev_tx_t
>__ixgbe_xmit_frame(struct sk_buff *skb,
>>  	struct ixgbe_adapter *adapter = netdev_priv(netdev);
>>  	struct ixgbe_ring *tx_ring;
>>
>> +	if (!netif_carrier_ok(netdev)) {
>> +		dev_kfree_skb_any(skb);
>> +		return NETDEV_TX_OK;
>> +	}
>> +
>
>I would much prefer that this check moves into netpoll's
>direct invocation of
>->ndo_start_xmit().
>
>Otherwise every driver will start to add this check and that
>kind of duplication doesn't make any sense at all.

That would work, but what if there are other callers of ndo_start_xmit that don't have this check? Handling this in the driver takes care of all instances.

Specifically this issue was seen with netconsole, but we also had reports of the same issue where I'm not sure netconsole was the culprit (I just don't have enough info about the setup).

If the netif_carrier_ok() check in ixgbe_start_xmit() is not acceptable we'll still have to plug a possible issue in ixgbe_watchdog_flush_tx() where a call to ndo_start_xmit may fill the rings after the HW reset and cause the driver to go into a reset loop.

Thanks,
Emil

^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: [net-next 02/16] ixgbe: fix spinlock recursion with netpoll and busy poll
  2014-03-14 18:58   ` David Miller
@ 2014-03-14 20:40     ` Tantilov, Emil S
  2014-03-14 21:53       ` David Miller
  2014-03-15  2:08       ` Eric W. Biederman
  0 siblings, 2 replies; 26+ messages in thread
From: Tantilov, Emil S @ 2014-03-14 20:40 UTC (permalink / raw)
  To: David Miller, Kirsher, Jeffrey T
  Cc: netdev, gospo, sassmann, asharma, stable, Keller, Jacob E

>-----Original Message-----
>From: David Miller [mailto:davem@davemloft.net]
>Sent: Friday, March 14, 2014 11:59 AM
>To: Kirsher, Jeffrey T
>Cc: Tantilov, Emil S; netdev@vger.kernel.org;
>gospo@redhat.com; sassmann@redhat.com; asharma@fb.com;
>stable@vger.kernel.org; Keller, Jacob E
>Subject: Re: [net-next 02/16] ixgbe: fix spinlock recursion
>with netpoll and busy poll
>
>From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>Date: Fri, 14 Mar 2014 02:47:12 -0700
>
>> From: Emil Tantilov <emil.s.tantilov@intel.com>
>>
>> This patch resolves a hang with busy poll when used with netconsole.
>>
>> The main change is the check for netpoll packets in ixgbe_poll() which
>> prevents a call to spin_lock_bh() while interrupts are disabled.
>>
>> In addition it removes the call to netif_rx() since netif_receive_skb()
>> can deal with netpoll packets and also replaced the global adapter flag
>> with per-q_vector bool that indicates Rx packet from netpoll which
>> should help with performance.
>>
>> CC: Arun Sharma <asharma@fb.com>
>> CC: stable <stable@vger.kernel.org>
>> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
>> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
>> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
>> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>
>Eric Biederman and co. are working to make this completely unnecessary.
>
>What is going to happen is that poll will be called with a budget of
>zero, and no RX processing will thus occur, for netpoll.
>
>Nothing in the RX path can handle being invoked from hardware
>interrupt context, so we have to prevent it completely in all
>drivers that support netpoll.

I noticed Eric's patches and this is obviously the better way to deal with it, but once the netpoll_rx patches are accepted will they make it into previous stable releases? Currently kernels between 3.11 and 3.13 (assuming Eric's changes make it into 3.14) will hang when netpoll and busy poll are used together.

Thanks,
Emil

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [net-next 01/16] ixgbe: add check for netif_carrier_ok in ixgbe_xmit_frame
  2014-03-14 20:19     ` Tantilov, Emil S
@ 2014-03-14 21:51       ` David Miller
  2014-03-15  0:19         ` Ben Hutchings
  0 siblings, 1 reply; 26+ messages in thread
From: David Miller @ 2014-03-14 21:51 UTC (permalink / raw)
  To: emil.s.tantilov
  Cc: jeffrey.t.kirsher, netdev, gospo, sassmann, asharma, stable

From: "Tantilov, Emil S" <emil.s.tantilov@intel.com>
Date: Fri, 14 Mar 2014 20:19:38 +0000

> That would work, but what if there are other callers of
> ndo_start_xmit that don't have this check? Handling this in the
> driver takes care of all instances.

netif_carrier_off() is supposed to stop traffic from flowing to
the device.

The qdisc layer should be honoring this property, and my
suspicion is that it is just netpoll operates in the unique
environment that doesn't.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [net-next 02/16] ixgbe: fix spinlock recursion with netpoll and busy poll
  2014-03-14 20:40     ` Tantilov, Emil S
@ 2014-03-14 21:53       ` David Miller
  2014-03-15  2:08       ` Eric W. Biederman
  1 sibling, 0 replies; 26+ messages in thread
From: David Miller @ 2014-03-14 21:53 UTC (permalink / raw)
  To: emil.s.tantilov
  Cc: jeffrey.t.kirsher, netdev, gospo, sassmann, asharma, stable,
	jacob.e.keller

From: "Tantilov, Emil S" <emil.s.tantilov@intel.com>
Date: Fri, 14 Mar 2014 20:40:25 +0000

> I noticed Eric's patches and this is obviously the better way to
> deal with it, but once the netpoll_rx patches are accepted will they
> make it into previous stable releases? Currently kernels between
> 3.11 and 3.13 (assuming Eric's changes make it into 3.14) will hang
> when netpoll and busy poll are used together.

This is very likely.

And in any event, solving it only in specific drivers is not the way
to go about things.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [net-next 01/16] ixgbe: add check for netif_carrier_ok in ixgbe_xmit_frame
  2014-03-14 21:51       ` David Miller
@ 2014-03-15  0:19         ` Ben Hutchings
  2014-03-15  0:24           ` Tantilov, Emil S
  0 siblings, 1 reply; 26+ messages in thread
From: Ben Hutchings @ 2014-03-15  0:19 UTC (permalink / raw)
  To: David Miller
  Cc: emil.s.tantilov, jeffrey.t.kirsher, netdev, gospo, sassmann,
	asharma, stable

[-- Attachment #1: Type: text/plain, Size: 1202 bytes --]

On Fri, 2014-03-14 at 17:51 -0400, David Miller wrote:
> From: "Tantilov, Emil S" <emil.s.tantilov@intel.com>
> Date: Fri, 14 Mar 2014 20:19:38 +0000
> 
> > That would work, but what if there are other callers of
> > ndo_start_xmit that don't have this check? Handling this in the
> > driver takes care of all instances.
> 
> netif_carrier_off() is supposed to stop traffic from flowing to
> the device.
> 
> The qdisc layer should be honoring this property, and my
> suspicion is that it is just netpoll operates in the unique
> environment that doesn't.

There is no check for netif_carrier_ok() in the qdisc transmit path.
Instead netif_carrier_off() eventually causes link_watch to call
dev_deactivate() which installs the noop qdisc.

It does seem like transmitters that bypass the qdisc should be checking
netif_carrier_ok(), but drivers must also accept that the effect of
netif_carrier_off() is not immediate.

Maybe ixgbe is not calling netif_stop_all_queues() at quite the right
time?

Ben.

-- 
Ben Hutchings
When you say `I wrote a program that crashed Windows', people just stare ...
and say `Hey, I got those with the system, *for free*'. - Linus Torvalds

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: [net-next 01/16] ixgbe: add check for netif_carrier_ok in ixgbe_xmit_frame
  2014-03-15  0:19         ` Ben Hutchings
@ 2014-03-15  0:24           ` Tantilov, Emil S
  0 siblings, 0 replies; 26+ messages in thread
From: Tantilov, Emil S @ 2014-03-15  0:24 UTC (permalink / raw)
  To: Ben Hutchings, David Miller
  Cc: Kirsher, Jeffrey T, netdev, gospo, sassmann, asharma, stable

>-----Original Message-----
>From: Ben Hutchings [mailto:ben@decadent.org.uk]
>Sent: Friday, March 14, 2014 5:19 PM
>To: David Miller
>Cc: Tantilov, Emil S; Kirsher, Jeffrey T;
>netdev@vger.kernel.org; gospo@redhat.com;
>sassmann@redhat.com; asharma@fb.com; stable@vger.kernel.org
>Subject: Re: [net-next 01/16] ixgbe: add check for
>netif_carrier_ok in ixgbe_xmit_frame
>
>On Fri, 2014-03-14 at 17:51 -0400, David Miller wrote:
>> From: "Tantilov, Emil S" <emil.s.tantilov@intel.com>
>> Date: Fri, 14 Mar 2014 20:19:38 +0000
>>
>> > That would work, but what if there are other callers of
>> > ndo_start_xmit that don't have this check? Handling this in the
>> > driver takes care of all instances.
>>
>> netif_carrier_off() is supposed to stop traffic from flowing to
>> the device.
>>
>> The qdisc layer should be honoring this property, and my
>> suspicion is that it is just netpoll operates in the unique
>> environment that doesn't.
>
>There is no check for netif_carrier_ok() in the qdisc transmit path.
>Instead netif_carrier_off() eventually causes link_watch to call
>dev_deactivate() which installs the noop qdisc.
>
>It does seem like transmitters that bypass the qdisc should
>be checking netif_carrier_ok(), but drivers must also accept that the
>effect of netif_carrier_off() is not immediate.
>
>Maybe ixgbe is not calling netif_stop_all_queues() at quite
>the right time?

You're probably right. I'm looking into it.

Thanks,
Emil

>
>Ben.
>
>--
>Ben Hutchings
>When you say `I wrote a program that crashed Windows',
>people just stare ...
>and say `Hey, I got those with the system, *for free*'. -
>Linus Torvalds

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [net-next 02/16] ixgbe: fix spinlock recursion with netpoll and busy poll
  2014-03-14 20:40     ` Tantilov, Emil S
  2014-03-14 21:53       ` David Miller
@ 2014-03-15  2:08       ` Eric W. Biederman
  1 sibling, 0 replies; 26+ messages in thread
From: Eric W. Biederman @ 2014-03-15  2:08 UTC (permalink / raw)
  To: Tantilov, Emil S
  Cc: David Miller, Kirsher, Jeffrey T, netdev, gospo, sassmann,
	asharma, stable, Keller, Jacob E

"Tantilov, Emil S" <emil.s.tantilov@intel.com> writes:

>>-----Original Message-----
>>From: David Miller [mailto:davem@davemloft.net]
>>Sent: Friday, March 14, 2014 11:59 AM
>>To: Kirsher, Jeffrey T
>>Cc: Tantilov, Emil S; netdev@vger.kernel.org;
>>gospo@redhat.com; sassmann@redhat.com; asharma@fb.com;
>>stable@vger.kernel.org; Keller, Jacob E
>>Subject: Re: [net-next 02/16] ixgbe: fix spinlock recursion
>>with netpoll and busy poll
>>
>>From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>>Date: Fri, 14 Mar 2014 02:47:12 -0700
>>
>>> From: Emil Tantilov <emil.s.tantilov@intel.com>
>>>
>>> This patch resolves a hang with busy poll when used with netconsole.
>>>
>>> The main change is the check for netpoll packets in ixgbe_poll() which
>>> prevents a call to spin_lock_bh() while interrupts are disabled.
>>>
>>> In addition it removes the call to netif_rx() since netif_receive_skb()
>>> can deal with netpoll packets and also replaced the global adapter flag
>>> with per-q_vector bool that indicates Rx packet from netpoll which
>>> should help with performance.
>>>
>>> CC: Arun Sharma <asharma@fb.com>
>>> CC: stable <stable@vger.kernel.org>
>>> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
>>> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
>>> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
>>> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>>
>>Eric Biederman and co. are working to make this completely unnecessary.
>>
>>What is going to happen is that poll will be called with a budget of
>>zero, and no RX processing will thus occur, for netpoll.
>>
>>Nothing in the RX path can handle being invoked from hardware
>>interrupt context, so we have to prevent it completely in all
>>drivers that support netpoll.
>
> I noticed Eric's patches and this is obviously the better way to deal
> with it, but once the netpoll_rx patches are accepted will they make
> it into previous stable releases? Currently kernels between 3.11 and
> 3.13 (assuming Eric's changes make it into 3.14) will hang when
> netpoll and busy poll are used together.

A quick comment on this patch.  IXGBE_FLAG_IN_NETPOLL in ixgbe (before
your refinement) is harmless but complete nonsense.  The napi poll
methods do not get called from ndo_poll_controller.  So the call of
netif_rx is bunk.

Before my patches go in netpoll will cause any packets processed with
napi_gro_receive or netif_receive_skb while netconsole is sending a
packet to be dropped, so netif_rx (which is not called) should be
unnecessary.

As for the netpoll hang taking the lock. I expect that the fix for
handling receving packets with netpoll is simply to disable interrupts
in the ixgbe_qv_lock_ family of functions, so you can handle netpoll
from hard irq context.

Of course that won't be needed as soon David merges my patches and but shrug.

Eric

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2014-03-15  2:08 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-03-14  9:47 ` [net-next 01/16] ixgbe: add check for netif_carrier_ok in ixgbe_xmit_frame Jeff Kirsher
2014-03-14 18:57   ` David Miller
2014-03-14 20:19     ` Tantilov, Emil S
2014-03-14 21:51       ` David Miller
2014-03-15  0:19         ` Ben Hutchings
2014-03-15  0:24           ` Tantilov, Emil S
2014-03-14  9:47 ` [net-next 02/16] ixgbe: fix spinlock recursion with netpoll and busy poll Jeff Kirsher
2014-03-14 18:58   ` David Miller
2014-03-14 20:40     ` Tantilov, Emil S
2014-03-14 21:53       ` David Miller
2014-03-15  2:08       ` Eric W. Biederman
2014-03-14  9:47 ` [net-next 03/16] igb: Fix code comment Jeff Kirsher
2014-03-14  9:47 ` [net-next 04/16] i40e: delete netdev after deleting napi and vectors Jeff Kirsher
2014-03-14  9:47 ` [net-next 05/16] i40e: Fix a bug in the update logic for FDIR SB filter Jeff Kirsher
2014-03-14  9:47 ` [net-next 06/16] i40e/i40evf: Some flow director HW definition fixes Jeff Kirsher
2014-03-14  9:47 ` [net-next 07/16] i40e: make string references to q be queue Jeff Kirsher
2014-03-14  9:47 ` [net-next 08/16] i40e: cleanup strings Jeff Kirsher
2014-03-14  9:47 ` [net-next 09/16] i40e: simplified init string Jeff Kirsher
2014-03-14  9:47 ` [net-next 10/16] i40e: Fix function comments Jeff Kirsher
2014-03-14  9:47 ` [net-next 11/16] i40e: Define a new state variable to keep track of feature auto disable Jeff Kirsher
2014-03-14  9:47 ` [net-next 12/16] i40e: Add code to handle FD table full condition Jeff Kirsher
2014-03-14  9:47 ` [net-next 13/16] i40e: Bug fix for FDIR replay logic Jeff Kirsher
2014-03-14  9:47 ` [net-next 14/16] i40e: Let MDD events be handled by MDD handler Jeff Kirsher
2014-03-14  9:47 ` [net-next 15/16] i40e/i40evf: Use correct number of VF vectors Jeff Kirsher
2014-03-14  9:47 ` [net-next 16/16] i40e/i40evf: Use dma_set_mask_and_coherent Jeff Kirsher

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.