All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29
@ 2014-08-29  9:30 Jeff Kirsher
  2014-08-29  9:30 ` [net-next 01/15] i40e: Add dual speed module support Jeff Kirsher
                   ` (14 more replies)
  0 siblings, 15 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann

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

Catherine adds dual speed module support to i40e.  Updates i40e to allow
the user to change link settings when the link is down.

Serey renames i40e_ndo_set_vf_spoofck() to i40e_ndo_set_vf_spookchk()
to be more consistent with what is defined in netdev and removes a
unnecessary variable assignment.

Jesse makes a malicious driver detection warning only print if extended
driver string is enabled for i40e.  Fixes a panic under traffic load when
resetting or if/whenever there was a Tx-timeout because we were enabling
the Tx queue to early.

Anjali fixes an issue when PF reset fails, where we were trying to restart
the admin queue which has not been setup at that point.  This resolves an
occasional kernel panic when PF reset fails for some reason.

Ethan Zhao replaces the use of a local i40e_vfs_are_assigned() with the
global kernel pci_vfs_assigned() for i40e.

Alex cleans up the FDB handling for ixgbe.  This change makes it so that
the behavior for FDB handling is consistent between both the SR-IOV and
non-SR-IOV cases.  The main change is that we perform bounds checking on
the number of SR-IOV addresses regardless of if SR-IOV is enabled or not
as we can only support a certain number of addresses in the hardware.

Emil extends the pending Tx work check to the VF interfaces, where the
driver initiates a reset of the interface on link loss with pending Tx
work in order to clear the rings.  Introduces a delay for 82599 VFs of
at least 500 usecs to make sure the VFLINKS value is correct, since this
bit tends to flap when a DA or SFP+ cable is disconnected.

Jacob adds code comments in ixgbe to make it more obvious that we are
resetting features based on the fact that we do not have MSI-X enabled,
and cannot use the previous settings.  Also resolves a kernel NULL
pointer dereference by limiting the combined total of MACVLAN and
SR-IOV VFs, since the hardware has a limited number of pools available
(64).  Previously, no checks were in place to limit the number of
accelerated MACVLAN devices based on the number of pools, which would
be ok since there was already a limit for these well below the number of
available pools.  However, SR-IOV uses the very same pools, therefore
we need to ensure that the total number of pools does not exceed the
number of pools available in the hardware.

The following are changes since commit a3bf5c429eb5f5ec4d364d51dfa8855efcc005f8:
  r8169: add missing MODULE_FIRMWARE.
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master

Alexander Duyck (1):
  ixgbe: Cleanup FDB handling code

Anjali Singhai Jain (1):
  i40e: Fix an issue when PF reset fails

Catherine Sullivan (4):
  i40e: Add dual speed module support
  i40e: Allow user to change link settings if link is down
  i40e: Tell OS link is going down when calling set_phy_config
  i40e/i40evf: Bump i40e/i40evf versions

Emil Tantilov (2):
  ixgbe: reset interface on link loss with pending Tx work from the VF
  ixgbevf: introduce delay for checking VFLINKS on 82599

Ethan Zhao (1):
  i40e: use global pci_vfs_assigned() to replace local
    i40e_vfs_are_assigned()

Jacob Keller (2):
  ixgbe: add comment noting recalculation of queues
  ixgbe: limit combined total of macvlan and SR-IOV VFs

Jesse Brandeburg (2):
  i40e: make warning less verbose
  i40e: fix panic due to too-early Tx queue enable

Serey Kong (2):
  i40e: Change wording to be more consistent
  i40e: Remove unnecessary assignment

 drivers/net/ethernet/intel/i40e/i40e.h             |  1 +
 drivers/net/ethernet/intel/i40e/i40e_common.c      |  2 +
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     | 55 +++++++------
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 45 +++++-----
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 36 +-------
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h |  2 +-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    |  2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c       |  8 ++
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c      | 96 ++++++++++++----------
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c     | 14 ++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_type.h      |  7 ++
 drivers/net/ethernet/intel/ixgbevf/vf.c            | 15 ++++
 12 files changed, 156 insertions(+), 127 deletions(-)

-- 
1.9.3

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

* [net-next 01/15] i40e: Add dual speed module support
  2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
@ 2014-08-29  9:30 ` Jeff Kirsher
  2014-08-29  9:30 ` [net-next 02/15] i40e: Allow user to change link settings if link is down Jeff Kirsher
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem; +Cc: Catherine Sullivan, netdev, nhorman, sassmann, Jeff Kirsher

From: Catherine Sullivan <catherine.sullivan@intel.com>

Now that fw has implemented dual speed module support, we can add ours.
Also, add the phy type for 1G LR/SR and set its media type to fiber.
Lastly, instead of a WARN_ON if the phy type is not recognized just print
a warning.

Change-ID: I2e5227d4a8c2907b0ed423038e5dbce774e466b0
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c  |  2 ++
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 31 +++++++++-----------------
 2 files changed, 13 insertions(+), 20 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 01874c0..30056b2 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -752,6 +752,8 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	switch (hw->phy.link_info.phy_type) {
 	case I40E_PHY_TYPE_10GBASE_SR:
 	case I40E_PHY_TYPE_10GBASE_LR:
+	case I40E_PHY_TYPE_1000BASE_SX:
+	case I40E_PHY_TYPE_1000BASE_LX:
 	case I40E_PHY_TYPE_40GBASE_SR4:
 	case I40E_PHY_TYPE_40GBASE_LR4:
 		media = I40E_MEDIA_TYPE_FIBER;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 571d527..e701f42 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -313,7 +313,10 @@ static int i40e_get_settings(struct net_device *netdev,
 		break;
 	case I40E_PHY_TYPE_10GBASE_SR:
 	case I40E_PHY_TYPE_10GBASE_LR:
+	case I40E_PHY_TYPE_1000BASE_SX:
+	case I40E_PHY_TYPE_1000BASE_LX:
 		ecmd->supported = SUPPORTED_10000baseT_Full;
+		ecmd->supported |= SUPPORTED_1000baseT_Full;
 		break;
 	case I40E_PHY_TYPE_10GBASE_CR1_CU:
 	case I40E_PHY_TYPE_10GBASE_CR1:
@@ -352,7 +355,8 @@ static int i40e_get_settings(struct net_device *netdev,
 		break;
 	default:
 		/* if we got here and link is up something bad is afoot */
-		WARN_ON(link_up);
+		netdev_info(netdev, "WARNING: Link is up but PHY type 0x%x is not recognized.\n",
+			    hw_link_info->phy_type);
 	}
 
 no_valid_phy_type:
@@ -493,11 +497,10 @@ static int i40e_set_settings(struct net_device *netdev,
 	if (status)
 		return -EAGAIN;
 
-	/* Copy link_speed and abilities to config in case they are not
+	/* Copy abilities to config in case autoneg is not
 	 * set below
 	 */
 	memset(&config, 0, sizeof(struct i40e_aq_set_phy_config));
-	config.link_speed = abilities.link_speed;
 	config.abilities = abilities.abilities;
 
 	/* Check autoneg */
@@ -534,33 +537,21 @@ static int i40e_set_settings(struct net_device *netdev,
 		return -EINVAL;
 
 	if (advertise & ADVERTISED_100baseT_Full)
-		if (!(abilities.link_speed & I40E_LINK_SPEED_100MB)) {
-			config.link_speed |= I40E_LINK_SPEED_100MB;
-			change = true;
-		}
+		config.link_speed |= I40E_LINK_SPEED_100MB;
 	if (advertise & ADVERTISED_1000baseT_Full ||
 	    advertise & ADVERTISED_1000baseKX_Full)
-		if (!(abilities.link_speed & I40E_LINK_SPEED_1GB)) {
-			config.link_speed |= I40E_LINK_SPEED_1GB;
-			change = true;
-		}
+		config.link_speed |= I40E_LINK_SPEED_1GB;
 	if (advertise & ADVERTISED_10000baseT_Full ||
 	    advertise & ADVERTISED_10000baseKX4_Full ||
 	    advertise & ADVERTISED_10000baseKR_Full)
-		if (!(abilities.link_speed & I40E_LINK_SPEED_10GB)) {
-			config.link_speed |= I40E_LINK_SPEED_10GB;
-			change = true;
-		}
+		config.link_speed |= I40E_LINK_SPEED_10GB;
 	if (advertise & ADVERTISED_40000baseKR4_Full ||
 	    advertise & ADVERTISED_40000baseCR4_Full ||
 	    advertise & ADVERTISED_40000baseSR4_Full ||
 	    advertise & ADVERTISED_40000baseLR4_Full)
-		if (!(abilities.link_speed & I40E_LINK_SPEED_40GB)) {
-			config.link_speed |= I40E_LINK_SPEED_40GB;
-			change = true;
-		}
+		config.link_speed |= I40E_LINK_SPEED_40GB;
 
-	if (change) {
+	if (change || (abilities.link_speed != config.link_speed)) {
 		/* copy over the rest of the abilities */
 		config.phy_type = abilities.phy_type;
 		config.eee_capability = abilities.eee_capability;
-- 
1.9.3

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

* [net-next 02/15] i40e: Allow user to change link settings if link is down
  2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
  2014-08-29  9:30 ` [net-next 01/15] i40e: Add dual speed module support Jeff Kirsher
@ 2014-08-29  9:30 ` Jeff Kirsher
  2014-08-29  9:30 ` [net-next 03/15] i40e: Change wording to be more consistent Jeff Kirsher
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem; +Cc: Catherine Sullivan, netdev, nhorman, sassmann, Jeff Kirsher

From: Catherine Sullivan <catherine.sullivan@intel.com>

Allow the user to change auto-negotiation and speed settings if
link is down.

Change-ID: I372967c627682b5e1835f623a7cbf41b21b51043
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index e701f42..de4ce0e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -466,7 +466,8 @@ static int i40e_set_settings(struct net_device *netdev,
 
 	if (hw->phy.media_type != I40E_MEDIA_TYPE_BASET &&
 	    hw->phy.media_type != I40E_MEDIA_TYPE_FIBER &&
-	    hw->phy.media_type != I40E_MEDIA_TYPE_BACKPLANE)
+	    hw->phy.media_type != I40E_MEDIA_TYPE_BACKPLANE &&
+	    hw->phy.link_info.link_info & I40E_AQ_LINK_UP)
 		return -EOPNOTSUPP;
 
 	/* get our own copy of the bits to check against */
-- 
1.9.3

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

* [net-next 03/15] i40e: Change wording to be more consistent
  2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
  2014-08-29  9:30 ` [net-next 01/15] i40e: Add dual speed module support Jeff Kirsher
  2014-08-29  9:30 ` [net-next 02/15] i40e: Allow user to change link settings if link is down Jeff Kirsher
@ 2014-08-29  9:30 ` Jeff Kirsher
  2014-08-29  9:30 ` [net-next 04/15] i40e: Remove unnecessary assignment Jeff Kirsher
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem; +Cc: Serey Kong, netdev, nhorman, sassmann, Jeff Kirsher

From: Serey Kong <serey.kong@intel.com>

Change "spoofck" to "spoofchk" to be consistent with as defined in netdev.

Change-ID: I9866d6284cb5f92c8d71dc0776c6d1e71dfb62a5
Signed-off-by: Serey Kong <serey.kong@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 2 +-
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +-
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index bd192b8..2fccd06 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7469,7 +7469,7 @@ static const struct net_device_ops i40e_netdev_ops = {
 	.ndo_set_vf_rate	= i40e_ndo_set_vf_bw,
 	.ndo_get_vf_config	= i40e_ndo_get_vf_config,
 	.ndo_set_vf_link_state	= i40e_ndo_set_vf_link_state,
-	.ndo_set_vf_spoofchk	= i40e_ndo_set_vf_spoofck,
+	.ndo_set_vf_spoofchk	= i40e_ndo_set_vf_spoofchk,
 #ifdef CONFIG_I40E_VXLAN
 	.ndo_add_vxlan_port	= i40e_add_vxlan_port,
 	.ndo_del_vxlan_port	= i40e_del_vxlan_port,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index da0f005..4d8fd22 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -2423,7 +2423,7 @@ error_out:
  *
  * Enable or disable VF spoof checking
  **/
-int i40e_ndo_set_vf_spoofck(struct net_device *netdev, int vf_id, bool enable)
+int i40e_ndo_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool enable)
 {
 	struct i40e_netdev_priv *np = netdev_priv(netdev);
 	struct i40e_vsi *vsi = np->vsi;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
index 63e7e0d..0adc61e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
@@ -122,7 +122,7 @@ int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int min_tx_rate,
 int i40e_ndo_get_vf_config(struct net_device *netdev,
 			   int vf_id, struct ifla_vf_info *ivi);
 int i40e_ndo_set_vf_link_state(struct net_device *netdev, int vf_id, int link);
-int i40e_ndo_set_vf_spoofck(struct net_device *netdev, int vf_id, bool enable);
+int i40e_ndo_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool enable);
 
 void i40e_vc_notify_link_state(struct i40e_pf *pf);
 void i40e_vc_notify_reset(struct i40e_pf *pf);
-- 
1.9.3

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

* [net-next 04/15] i40e: Remove unnecessary assignment
  2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
                   ` (2 preceding siblings ...)
  2014-08-29  9:30 ` [net-next 03/15] i40e: Change wording to be more consistent Jeff Kirsher
@ 2014-08-29  9:30 ` Jeff Kirsher
  2014-08-29  9:30 ` [net-next 05/15] i40e: Tell OS link is going down when calling set_phy_config Jeff Kirsher
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem; +Cc: Serey Kong, netdev, nhorman, sassmann, Jeff Kirsher

From: Serey Kong <serey.kong@intel.com>

Remove unnecessary setting of "ret" variable as it's already set at
the top of the function.

Change-ID: Icaccfc67f335817a23579b7c43625d59ad6c9925
Signed-off-by: Serey Kong <serey.kong@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 4d8fd22..aeae5f2 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -2098,7 +2098,6 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
 	/* Force the VF driver stop so it has to reload with new MAC address */
 	i40e_vc_disable_vf(pf, vf);
 	dev_info(&pf->pdev->dev, "Reload the VF driver to make this change effective.\n");
-	ret = 0;
 
 error_param:
 	return ret;
-- 
1.9.3

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

* [net-next 05/15] i40e: Tell OS link is going down when calling set_phy_config
  2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
                   ` (3 preceding siblings ...)
  2014-08-29  9:30 ` [net-next 04/15] i40e: Remove unnecessary assignment Jeff Kirsher
@ 2014-08-29  9:30 ` Jeff Kirsher
  2014-08-29 17:37   ` Sergei Shtylyov
  2014-08-29  9:30 ` [net-next 06/15] i40e: make warning less verbose Jeff Kirsher
                   ` (9 subsequent siblings)
  14 siblings, 1 reply; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem; +Cc: Catherine Sullivan, netdev, nhorman, sassmann, Jeff Kirsher

From: Catherine Sullivan <catherine.sullivan@intel.com>

Since we don't seem to be getting an LSE telling us link is going down
during set_phy_config (but we do get an LSE telling us we are coming
back up), fake one for the OS and tell them link is going down. Also
do an atomic restart no matter what because there are times the user
may want to end with link up even if they started with link down (like
if they accidentally set it to a speed that can't link and are trying to
fix it).

Change-ID: I0a642af9c1d0feb67bce741aba1a9c33bd349ed6
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index de4ce0e..101be2f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -559,9 +559,17 @@ static int i40e_set_settings(struct net_device *netdev,
 		config.eeer = abilities.eeer_val;
 		config.low_power_ctrl = abilities.d3_lpan;
 
-		/* If link is up set link and an so changes take effect */
-		if (hw->phy.link_info.link_info & I40E_AQ_LINK_UP)
-			config.abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK;
+		/* set link and an so changes take effect */
+		config.abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK;
+		/* If link is up put link down */
+		if (hw->phy.link_info.link_info & I40E_AQ_LINK_UP) {
+			/* Tell the OS link is going down, the link will go
+			 * back up when fw says it is ready asynchronously
+			 */
+			netdev_info(netdev, "PHY settings change requested, NIC Link is going down.\n");
+			netif_carrier_off(netdev);
+			netif_tx_stop_all_queues(netdev);
+		}
 
 		/* make the aq call */
 		status = i40e_aq_set_phy_config(hw, &config, NULL);
@@ -678,6 +686,13 @@ static int i40e_set_pauseparam(struct net_device *netdev,
 	else
 		 return -EINVAL;
 
+	/* Tell the OS link is going down, the link will go back up when fw
+	 * says it is ready asynchronously
+	 */
+	netdev_info(netdev, "Flow control settings change requested, NIC Link is going down.\n");
+	netif_carrier_off(netdev);
+	netif_tx_stop_all_queues(netdev);
+
 	/* Set the fc mode and only restart an if link is up*/
 	status = i40e_set_fc(hw, &aq_failures, link_up);
 
-- 
1.9.3

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

* [net-next 06/15] i40e: make warning less verbose
  2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
                   ` (4 preceding siblings ...)
  2014-08-29  9:30 ` [net-next 05/15] i40e: Tell OS link is going down when calling set_phy_config Jeff Kirsher
@ 2014-08-29  9:30 ` Jeff Kirsher
  2014-08-29  9:30 ` [net-next 07/15] i40e: Fix an issue when PF reset fails Jeff Kirsher
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem; +Cc: Jesse Brandeburg, netdev, nhorman, sassmann, Jeff Kirsher

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

The driver is un-necessarily printing a warning that is only marginally
useful to the user.  Make the warning only print if extended driver
string printing is enabled, other messages related to a reset event
will still continue to print.

Change-ID: I5e8beca6516a2f176cd2e72b0ac2b3b909e6c953
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 2fccd06..55a31ab 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6148,9 +6148,9 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
 				I40E_GL_MDET_TX_EVENT_SHIFT;
 		u8 queue = (reg & I40E_GL_MDET_TX_QUEUE_MASK) >>
 				I40E_GL_MDET_TX_QUEUE_SHIFT;
-		dev_info(&pf->pdev->dev,
-			 "Malicious Driver Detection event 0x%02x on TX queue %d pf number 0x%02x vf number 0x%02x\n",
-			 event, queue, pf_num, vf_num);
+		if (netif_msg_tx_err(pf))
+			dev_info(&pf->pdev->dev, "Malicious Driver Detection event 0x%02x on TX queue %d pf number 0x%02x vf number 0x%02x\n",
+				 event, queue, pf_num, vf_num);
 		wr32(hw, I40E_GL_MDET_TX, 0xffffffff);
 		mdd_detected = true;
 	}
@@ -6162,9 +6162,9 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
 				I40E_GL_MDET_RX_EVENT_SHIFT;
 		u8 queue = (reg & I40E_GL_MDET_RX_QUEUE_MASK) >>
 				I40E_GL_MDET_RX_QUEUE_SHIFT;
-		dev_info(&pf->pdev->dev,
-			 "Malicious Driver Detection event 0x%02x on RX queue %d of function 0x%02x\n",
-			 event, queue, func);
+		if (netif_msg_rx_err(pf))
+			dev_info(&pf->pdev->dev, "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;
 	}
@@ -6173,17 +6173,13 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
 		reg = rd32(hw, I40E_PF_MDET_TX);
 		if (reg & I40E_PF_MDET_TX_VALID_MASK) {
 			wr32(hw, I40E_PF_MDET_TX, 0xFFFF);
-			dev_info(&pf->pdev->dev,
-				 "MDD TX event is for this function 0x%08x, requesting PF reset.\n",
-				 reg);
+			dev_info(&pf->pdev->dev, "TX driver issue detected, PF reset issued\n");
 			pf_mdd_detected = true;
 		}
 		reg = rd32(hw, I40E_PF_MDET_RX);
 		if (reg & I40E_PF_MDET_RX_VALID_MASK) {
 			wr32(hw, I40E_PF_MDET_RX, 0xFFFF);
-			dev_info(&pf->pdev->dev,
-				 "MDD RX event is for this function 0x%08x, requesting PF reset.\n",
-				 reg);
+			dev_info(&pf->pdev->dev, "RX driver issue detected, PF reset issued\n");
 			pf_mdd_detected = true;
 		}
 		/* Queue belongs to the PF, initiate a reset */
@@ -6200,14 +6196,16 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)
 		if (reg & I40E_VP_MDET_TX_VALID_MASK) {
 			wr32(hw, I40E_VP_MDET_TX(i), 0xFFFF);
 			vf->num_mdd_events++;
-			dev_info(&pf->pdev->dev, "MDD TX event on VF %d\n", i);
+			dev_info(&pf->pdev->dev, "TX driver issue detected on VF %d\n",
+				 i);
 		}
 
 		reg = rd32(hw, I40E_VP_MDET_RX(i));
 		if (reg & I40E_VP_MDET_RX_VALID_MASK) {
 			wr32(hw, I40E_VP_MDET_RX(i), 0xFFFF);
 			vf->num_mdd_events++;
-			dev_info(&pf->pdev->dev, "MDD RX event on VF %d\n", i);
+			dev_info(&pf->pdev->dev, "RX driver issue detected on VF %d\n",
+				 i);
 		}
 
 		if (vf->num_mdd_events > I40E_DEFAULT_NUM_MDD_EVENTS_ALLOWED) {
-- 
1.9.3

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

* [net-next 07/15] i40e: Fix an issue when PF reset fails
  2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
                   ` (5 preceding siblings ...)
  2014-08-29  9:30 ` [net-next 06/15] i40e: make warning less verbose Jeff Kirsher
@ 2014-08-29  9:30 ` Jeff Kirsher
  2014-08-29  9:30 ` [net-next 08/15] i40e: fix panic due to too-early Tx queue enable Jeff Kirsher
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem; +Cc: Anjali Singhai Jain, netdev, nhorman, sassmann, Jeff Kirsher

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

We shouldn't restart Admin queue subtask if PF reset fails since we do
not have the AQ setup at that point. This patch makes sure we disable AQ
clean subtask when PF reset fails.

This will resolve an occasional kernel panic when PF reset fails for
some reason.

Change-ID: I11a747773362a8c5c0ad7a10cd34be0bda8eb9e8
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e.h      |  1 +
 drivers/net/ethernet/intel/i40e/i40e_main.c | 13 ++++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 4e97ba1..f1e33f8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -145,6 +145,7 @@ enum i40e_state_t {
 	__I40E_BAD_EEPROM,
 	__I40E_DOWN_REQUESTED,
 	__I40E_FD_FLUSH_REQUESTED,
+	__I40E_RESET_FAILED,
 };
 
 enum i40e_interrupt_policy {
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 55a31ab..64b8683 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5568,6 +5568,10 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf)
 	u32 oldval;
 	u32 val;
 
+	/* Do not run clean AQ when PF reset fails */
+	if (test_bit(__I40E_RESET_FAILED, &pf->state))
+		return;
+
 	/* check for error indications */
 	val = rd32(&pf->hw, pf->hw.aq.arq.len);
 	oldval = val;
@@ -5973,19 +5977,20 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
 	ret = i40e_pf_reset(hw);
 	if (ret) {
 		dev_info(&pf->pdev->dev, "PF reset failed, %d\n", ret);
-		goto end_core_reset;
+		set_bit(__I40E_RESET_FAILED, &pf->state);
+		goto clear_recovery;
 	}
 	pf->pfr_count++;
 
 	if (test_bit(__I40E_DOWN, &pf->state))
-		goto end_core_reset;
+		goto clear_recovery;
 	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);
 	if (ret) {
 		dev_info(&pf->pdev->dev, "Rebuild AdminQ failed, %d\n", ret);
-		goto end_core_reset;
+		goto clear_recovery;
 	}
 
 	/* re-verify the eeprom if we just had an EMP reset */
@@ -6103,6 +6108,8 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
 	i40e_send_version(pf);
 
 end_core_reset:
+	clear_bit(__I40E_RESET_FAILED, &pf->state);
+clear_recovery:
 	clear_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state);
 }
 
-- 
1.9.3

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

* [net-next 08/15] i40e: fix panic due to too-early Tx queue enable
  2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
                   ` (6 preceding siblings ...)
  2014-08-29  9:30 ` [net-next 07/15] i40e: Fix an issue when PF reset fails Jeff Kirsher
@ 2014-08-29  9:30 ` Jeff Kirsher
  2014-08-29 17:08   ` Sergei Shtylyov
  2014-08-29  9:30 ` [net-next 09/15] i40e/i40evf: Bump i40e/i40evf versions Jeff Kirsher
                   ` (6 subsequent siblings)
  14 siblings, 1 reply; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem
  Cc: Jesse Brandeburg, netdev, nhorman, sassmann, Mitch Williams,
	Jeff Kirsher

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

This fixes the panic under traffic load when resetting.  This issue
could also show up if/whenever there is a Tx-timeout.

Change-ID: Ie393a1f17fd5d962e56fc3bfe784899ef25402f5
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Jim Young <jamesx.m.young@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 64b8683..d37dea1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5289,7 +5289,7 @@ static void i40e_fdir_reinit_subtask(struct i40e_pf *pf)
  **/
 static void i40e_vsi_link_event(struct i40e_vsi *vsi, bool link_up)
 {
-	if (!vsi)
+	if (!vsi || (test_bit(__I40E_DOWN, &vsi->state)))
 		return;
 
 	switch (vsi->type) {
-- 
1.9.3

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

* [net-next 09/15] i40e/i40evf: Bump i40e/i40evf versions
  2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
                   ` (7 preceding siblings ...)
  2014-08-29  9:30 ` [net-next 08/15] i40e: fix panic due to too-early Tx queue enable Jeff Kirsher
@ 2014-08-29  9:30 ` Jeff Kirsher
  2014-08-29  9:30 ` [net-next 10/15] i40e: use global pci_vfs_assigned() to replace local i40e_vfs_are_assigned() Jeff Kirsher
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem; +Cc: Catherine Sullivan, netdev, nhorman, sassmann

From: Catherine Sullivan <catherine.sullivan@intel.com>

Bump i40e version to 1.0.11 and i40evf version to 1.0.5.

Change-ID: I63a60fa2efe82aae87a8a3095f43218db57d46ce
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 2 +-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index d37dea1..0a4e16f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -39,7 +39,7 @@ static const char i40e_driver_string[] =
 
 #define DRV_VERSION_MAJOR 1
 #define DRV_VERSION_MINOR 0
-#define DRV_VERSION_BUILD 4
+#define DRV_VERSION_BUILD 11
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD)    DRV_KERN
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 8c80925..c51bc7a 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -36,7 +36,7 @@ char i40evf_driver_name[] = "i40evf";
 static const char i40evf_driver_string[] =
 	"Intel(R) XL710/X710 Virtual Function Network Driver";
 
-#define DRV_VERSION "1.0.1"
+#define DRV_VERSION "1.0.5"
 const char i40evf_driver_version[] = DRV_VERSION;
 static const char i40evf_copyright[] =
 	"Copyright (c) 2013 - 2014 Intel Corporation.";
-- 
1.9.3

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

* [net-next 10/15] i40e: use global pci_vfs_assigned() to replace local i40e_vfs_are_assigned()
  2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
                   ` (8 preceding siblings ...)
  2014-08-29  9:30 ` [net-next 09/15] i40e/i40evf: Bump i40e/i40evf versions Jeff Kirsher
@ 2014-08-29  9:30 ` Jeff Kirsher
  2014-08-29  9:30 ` [net-next 11/15] ixgbe: Cleanup FDB handling code Jeff Kirsher
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem; +Cc: Ethan Zhao, netdev, nhorman, sassmann, Ethan Zhao, Jeff Kirsher

From: Ethan Zhao <ethan.zhao@oracle.com>

There is global funcion pci_vfs_assigned(), so use it instead of composing
local one.

Signed-off-by: Ethan Zhao <ethan.kernel@gmail.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 | 33 ++--------------------
 1 file changed, 2 insertions(+), 31 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index aeae5f2..4eeed26 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -707,35 +707,6 @@ complete_reset:
 	wr32(hw, I40E_VFGEN_RSTAT1(vf->vf_id), I40E_VFR_VFACTIVE);
 	i40e_flush(hw);
 }
-
-/**
- * i40e_vfs_are_assigned
- * @pf: pointer to the pf structure
- *
- * Determine if any VFs are assigned to VMs
- **/
-static bool i40e_vfs_are_assigned(struct i40e_pf *pf)
-{
-	struct pci_dev *pdev = pf->pdev;
-	struct pci_dev *vfdev;
-
-	/* loop through all the VFs to see if we own any that are assigned */
-	vfdev = pci_get_device(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_VF , NULL);
-	while (vfdev) {
-		/* if we don't own it we don't care */
-		if (vfdev->is_virtfn && pci_physfn(vfdev) == pdev) {
-			/* if it is assigned we cannot release it */
-			if (vfdev->dev_flags & PCI_DEV_FLAGS_ASSIGNED)
-				return true;
-		}
-
-		vfdev = pci_get_device(PCI_VENDOR_ID_INTEL,
-				       I40E_DEV_ID_VF,
-				       vfdev);
-	}
-
-	return false;
-}
 #ifdef CONFIG_PCI_IOV
 
 /**
@@ -843,7 +814,7 @@ void i40e_free_vfs(struct i40e_pf *pf)
 	 * assigned. Setting the number of VFs to 0 through sysfs is caught
 	 * before this function ever gets called.
 	 */
-	if (!i40e_vfs_are_assigned(pf)) {
+	if (!pci_vfs_assigned(pf->pdev)) {
 		pci_disable_sriov(pf->pdev);
 		/* Acknowledge VFLR for all VFS. Without this, VFs will fail to
 		 * work correctly when SR-IOV gets re-enabled.
@@ -980,7 +951,7 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
 	if (num_vfs)
 		return i40e_pci_sriov_enable(pdev, num_vfs);
 
-	if (!i40e_vfs_are_assigned(pf)) {
+	if (!pci_vfs_assigned(pf->pdev)) {
 		i40e_free_vfs(pf);
 	} else {
 		dev_warn(&pdev->dev, "Unable to free VFs because some are assigned to VMs.\n");
-- 
1.9.3

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

* [net-next 11/15] ixgbe: Cleanup FDB handling code
  2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
                   ` (9 preceding siblings ...)
  2014-08-29  9:30 ` [net-next 10/15] i40e: use global pci_vfs_assigned() to replace local i40e_vfs_are_assigned() Jeff Kirsher
@ 2014-08-29  9:30 ` Jeff Kirsher
  2014-08-29  9:30 ` [net-next 12/15] ixgbe: reset interface on link loss with pending Tx work from the VF Jeff Kirsher
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem; +Cc: Alexander Duyck, netdev, nhorman, sassmann, Jeff Kirsher

From: Alexander Duyck <alexander.h.duyck@intel.com>

This change makes it so that the behavior for FDB handling is consistent
between both the SR-IOV and non-SR-IOV cases.  The main change here is that we
perform bounds checking on the number of SR-IOV addresses regardless of if
SR-IOV is enabled or not as we can only support a certain number of addresses
in the hardware.

Signed-off-by: Alexander Duyck <alexander.h.duyck@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 | 34 ++++-----------------------
 1 file changed, 4 insertions(+), 30 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 53fbf06..2210c6d 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7741,39 +7741,13 @@ static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 			     const unsigned char *addr,
 			     u16 flags)
 {
-	struct ixgbe_adapter *adapter = netdev_priv(dev);
-	int err;
-
-	if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED))
-		return ndo_dflt_fdb_add(ndm, tb, dev, addr, flags);
-
-	/* Hardware does not support aging addresses so if a
-	 * ndm_state is given only allow permanent addresses
-	 */
-	if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
-		pr_info("%s: FDB only supports static addresses\n",
-			ixgbe_driver_name);
-		return -EINVAL;
-	}
-
+	/* guarantee we can provide a unique filter for the unicast address */
 	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr)) {
-		u32 rar_uc_entries = IXGBE_MAX_PF_MACVLANS;
-
-		if (netdev_uc_count(dev) < rar_uc_entries)
-			err = dev_uc_add_excl(dev, addr);
-		else
-			err = -ENOMEM;
-	} else if (is_multicast_ether_addr(addr)) {
-		err = dev_mc_add_excl(dev, addr);
-	} else {
-		err = -EINVAL;
+		if (IXGBE_MAX_PF_MACVLANS <= netdev_uc_count(dev))
+			return -ENOMEM;
 	}
 
-	/* Only return duplicate errors if NLM_F_EXCL is set */
-	if (err == -EEXIST && !(flags & NLM_F_EXCL))
-		err = 0;
-
-	return err;
+	return ndo_dflt_fdb_add(ndm, tb, dev, addr, flags);
 }
 
 static int ixgbe_ndo_bridge_setlink(struct net_device *dev,
-- 
1.9.3

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

* [net-next 12/15] ixgbe: reset interface on link loss with pending Tx work from the VF
  2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
                   ` (10 preceding siblings ...)
  2014-08-29  9:30 ` [net-next 11/15] ixgbe: Cleanup FDB handling code Jeff Kirsher
@ 2014-08-29  9:30 ` Jeff Kirsher
  2014-08-29  9:30 ` [net-next 13/15] ixgbevf: introduce delay for checking VFLINKS on 82599 Jeff Kirsher
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem; +Cc: Emil Tantilov, netdev, nhorman, sassmann, Jeff Kirsher

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

ixgbe initiates a reset of the interface on link loss with pending Tx work
in order to clear the rings.

This patch extends the pending Tx work check to the VF interfaces with the
same purpose.

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 | 54 +++++++++++++++++++++------
 drivers/net/ethernet/intel/ixgbe/ixgbe_type.h |  7 ++++
 2 files changed, 49 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 2210c6d..bc3eff7 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6319,25 +6319,55 @@ static void ixgbe_watchdog_link_is_down(struct ixgbe_adapter *adapter)
 	ixgbe_ping_all_vfs(adapter);
 }
 
+static bool ixgbe_ring_tx_pending(struct ixgbe_adapter *adapter)
+{
+	int i;
+
+	for (i = 0; i < adapter->num_tx_queues; i++) {
+		struct ixgbe_ring *tx_ring = adapter->tx_ring[i];
+
+		if (tx_ring->next_to_use != tx_ring->next_to_clean)
+			return true;
+	}
+
+	return false;
+}
+
+static bool ixgbe_vf_tx_pending(struct ixgbe_adapter *adapter)
+{
+	struct ixgbe_hw *hw = &adapter->hw;
+	struct ixgbe_ring_feature *vmdq = &adapter->ring_feature[RING_F_VMDQ];
+	u32 q_per_pool = __ALIGN_MASK(1, ~vmdq->mask);
+
+	int i, j;
+
+	if (!adapter->num_vfs)
+		return false;
+
+	for (i = 0; i < adapter->num_vfs; i++) {
+		for (j = 0; j < q_per_pool; j++) {
+			u32 h, t;
+
+			h = IXGBE_READ_REG(hw, IXGBE_PVFTDHN(q_per_pool, i, j));
+			t = IXGBE_READ_REG(hw, IXGBE_PVFTDTN(q_per_pool, i, j));
+
+			if (h != t)
+				return true;
+		}
+	}
+
+	return false;
+}
+
 /**
  * ixgbe_watchdog_flush_tx - flush queues on link down
  * @adapter: pointer to the device adapter structure
  **/
 static void ixgbe_watchdog_flush_tx(struct ixgbe_adapter *adapter)
 {
-	int i;
-	int some_tx_pending = 0;
-
 	if (!netif_carrier_ok(adapter->netdev)) {
-		for (i = 0; i < adapter->num_tx_queues; i++) {
-			struct ixgbe_ring *tx_ring = adapter->tx_ring[i];
-			if (tx_ring->next_to_use != tx_ring->next_to_clean) {
-				some_tx_pending = 1;
-				break;
-			}
-		}
-
-		if (some_tx_pending) {
+		if (ixgbe_ring_tx_pending(adapter) ||
+		    ixgbe_vf_tx_pending(adapter)) {
 			/* We've lost link, so the controller stops DMA,
 			 * but we've got queued Tx work that's never going
 			 * to get done, so reset controller to flush Tx.
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
index e6b07c2..dfd55d8 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
@@ -2194,6 +2194,8 @@ enum {
 #define IXGBE_VFLRE(_i)		((((_i) & 1) ? 0x001C0 : 0x00600))
 #define IXGBE_VFLREC(_i)		(0x00700 + ((_i) * 4))
 /* Translated register #defines */
+#define IXGBE_PVFTDH(P)		(0x06010 + (0x40 * (P)))
+#define IXGBE_PVFTDT(P)		(0x06018 + (0x40 * (P)))
 #define IXGBE_PVFTDWBAL(P)	(0x06038 + (0x40 * (P)))
 #define IXGBE_PVFTDWBAH(P)	(0x0603C + (0x40 * (P)))
 
@@ -2202,6 +2204,11 @@ enum {
 #define IXGBE_PVFTDWBAHn(q_per_pool, vf_number, vf_q_index) \
 		(IXGBE_PVFTDWBAH((q_per_pool)*(vf_number) + (vf_q_index)))
 
+#define IXGBE_PVFTDHN(q_per_pool, vf_number, vf_q_index) \
+		(IXGBE_PVFTDH((q_per_pool)*(vf_number) + (vf_q_index)))
+#define IXGBE_PVFTDTN(q_per_pool, vf_number, vf_q_index) \
+		(IXGBE_PVFTDT((q_per_pool)*(vf_number) + (vf_q_index)))
+
 enum ixgbe_fdir_pballoc_type {
 	IXGBE_FDIR_PBALLOC_NONE = 0,
 	IXGBE_FDIR_PBALLOC_64K  = 1,
-- 
1.9.3

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

* [net-next 13/15] ixgbevf: introduce delay for checking VFLINKS on 82599
  2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
                   ` (11 preceding siblings ...)
  2014-08-29  9:30 ` [net-next 12/15] ixgbe: reset interface on link loss with pending Tx work from the VF Jeff Kirsher
@ 2014-08-29  9:30 ` Jeff Kirsher
  2014-08-29  9:30 ` [net-next 14/15] ixgbe: add comment noting recalculation of queues Jeff Kirsher
  2014-08-29  9:30 ` [net-next 15/15] ixgbe: limit combined total of macvlan and SR-IOV VFs Jeff Kirsher
  14 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem; +Cc: Emil Tantilov, netdev, nhorman, sassmann, Jeff Kirsher

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

VFLINKS.LINKUP bit tends to flap when a DA or SFP+ cable is disconnected.
It can take up to 500 usecs for the LINKUP bit to be correct.

This patch resolves the issue by introducing a delay for 82599 VFs of at
least 500 usecs to make sure the VFLINKS value is correct.

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/ixgbevf/vf.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.c b/drivers/net/ethernet/intel/ixgbevf/vf.c
index 4d44d64..9cddd56 100644
--- a/drivers/net/ethernet/intel/ixgbevf/vf.c
+++ b/drivers/net/ethernet/intel/ixgbevf/vf.c
@@ -434,6 +434,21 @@ static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw,
 	if (!(links_reg & IXGBE_LINKS_UP))
 		goto out;
 
+	/* for SFP+ modules and DA cables on 82599 it can take up to 500usecs
+	 * before the link status is correct
+	 */
+	if (mac->type == ixgbe_mac_82599_vf) {
+		int i;
+
+		for (i = 0; i < 5; i++) {
+			udelay(100);
+			links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
+
+			if (!(links_reg & IXGBE_LINKS_UP))
+				goto out;
+		}
+	}
+
 	switch (links_reg & IXGBE_LINKS_SPEED_82599) {
 	case IXGBE_LINKS_SPEED_10G_82599:
 		*speed = IXGBE_LINK_SPEED_10GB_FULL;
-- 
1.9.3

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

* [net-next 14/15] ixgbe: add comment noting recalculation of queues
  2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
                   ` (12 preceding siblings ...)
  2014-08-29  9:30 ` [net-next 13/15] ixgbevf: introduce delay for checking VFLINKS on 82599 Jeff Kirsher
@ 2014-08-29  9:30 ` Jeff Kirsher
  2014-08-29  9:30 ` [net-next 15/15] ixgbe: limit combined total of macvlan and SR-IOV VFs Jeff Kirsher
  14 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem; +Cc: Jacob Keller, netdev, nhorman, sassmann, Jeff Kirsher

From: Jacob Keller <jacob.e.keller@intel.com>

Since we previously called ixgbe_set_num_queues just prior to attempting
to set our interrupt scheme, it may be non obvious why we have to call
it again inside the function. Add a comment which helps make it more
obvious that we are resetting features based on the fact that we do not
have MSI-X enabled, and cannot use the previous settings.

Signed-off-by: Jacob Keller <jacob.e.keller@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_lib.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
index 2d9451e..ae36fd6 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
@@ -1086,6 +1086,11 @@ static void ixgbe_set_interrupt_capability(struct ixgbe_adapter *adapter)
 			return;
 	}
 
+	/* At this point, we do not have MSI-X capabilities. We need to
+	 * reconfigure or disable various features which require MSI-X
+	 * capability.
+	 */
+
 	/* disable DCB if number of TCs exceeds 1 */
 	if (netdev_get_num_tc(adapter->netdev) > 1) {
 		e_err(probe, "num TCs exceeds number of queues - disabling DCB\n");
@@ -1107,6 +1112,9 @@ static void ixgbe_set_interrupt_capability(struct ixgbe_adapter *adapter)
 	/* disable RSS */
 	adapter->ring_feature[RING_F_RSS].limit = 1;
 
+	/* recalculate number of queues now that many features have been
+	 * changed or disabled.
+	 */
 	ixgbe_set_num_queues(adapter);
 	adapter->num_q_vectors = 1;
 
-- 
1.9.3

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

* [net-next 15/15] ixgbe: limit combined total of macvlan and SR-IOV VFs
  2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
                   ` (13 preceding siblings ...)
  2014-08-29  9:30 ` [net-next 14/15] ixgbe: add comment noting recalculation of queues Jeff Kirsher
@ 2014-08-29  9:30 ` Jeff Kirsher
  14 siblings, 0 replies; 19+ messages in thread
From: Jeff Kirsher @ 2014-08-29  9:30 UTC (permalink / raw)
  To: davem
  Cc: Jacob Keller, netdev, nhorman, sassmann, John Fastabend, Jeff Kirsher

From: Jacob Keller <jacob.e.keller@intel.com>

Hardware has a limited number of pools available (64). Previously, no
checks were in place to limit the number of accelerated macvlan devices
based on the number of pools. Normally this would be ok, because there
was already a limit for these well below the number of available pools.
However, SR-IOV uses the very same pools. Therefor, we need to ensure
that the total number of pools (number of VFs plus the number of non-VF
pools in use for accelerated macvlans) does not exceed the number of
pools available in hardware.

This patch resolves a kernel NULL pointer dereference caused by the following commands:

$modprobe ixgbe max_vfs=63

$ethtool -K eth2 l2-fwd-offload on

$ip link add link eth2 macvlan0 type macvlan

$ip link set dev macvlan0 up

[  992.950080] BUG: unable to handle kernel NULL pointer dereference at 0000000000000056
[  992.951109] IP: [<ffffffffa003b71e>] ixgbe_disable_fwd_ring+0x1e/0xf0 [ixgbe]
[  992.951684] PGD 22a80e067 PUD 232e9b067 PMD 0
[  992.952389] Oops: 0000 [#1] SMP
[  992.953014] Modules linked in: nfsd lockd nfs_acl exportfs auth_rpcgss oid_registry sunrpc bridge stp llc vhost_net macvtap macvlan vhost tun kvm_intel kvm ioatdma ixgbe mdio igb dca
[  992.956042] CPU: 2 PID: 11928 Comm: ifconfig Not tainted 3.16.0-rc6-net-next-07-29-2014-FCoE+ #1
[  992.956915] Hardware name: Intel Corporation S2600CO/S2600CO, BIOS SE5C600.86B.02.03.0003.041920141333 04/19/2014
[  992.957791] task: ffff8804341c0000 ti: ffff8801d7dc8000 task.ti: ffff8801d7dc8000
[  992.958660] RIP: 0010:[<ffffffffa003b71e>]  [<ffffffffa003b71e>] ixgbe_disable_fwd_ring+0x1e/0xf0 [ixgbe]
[  992.959613] RSP: 0018:ffff8801d7dcbbb8  EFLAGS: 00010286
[  992.960093] RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000001
[  992.960575] RDX: ffff880232eb7000 RSI: 0000000000000000 RDI: ffff88022dc05800
[  992.961059] RBP: ffff8801d7dcbbd8 R08: 0000000000000000 R09: 0000000000000000
[  992.961541] R10: 0000000000000001 R11: 0000000000000000 R12: ffff88022ec20980
[  992.962023] R13: ffff880232eb7000 R14: 0000000000000001 R15: 0000000000000001
[  992.962508] FS:  00007fab264887a0(0000) GS:ffff880237640000(0000) knlGS:0000000000000000
[  992.963378] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  992.963858] CR2: 0000000000000056 CR3: 000000022a939000 CR4: 00000000001427e0
[  992.964340] Stack:
[  992.964806]  ffff88022ec28840 ffff88022ec20980 ffff88022dc05800 ffff880232eb7000
[  992.965976]  ffff8801d7dcbc28 ffffffffa003bae8 ffff8801d7dcbbe8 0000000000000400
[  992.967147]  000000000000000d ffff88022ec20980 ffff88022ec20000 ffff88022dc05800
[  992.968319] Call Trace:
[  992.968795]  [<ffffffffa003bae8>] ixgbe_fwd_ring_up+0x88/0x280 [ixgbe]
[  992.969284]  [<ffffffffa0041d83>] ixgbe_fwd_add+0x173/0x220 [ixgbe]
[  992.969767]  [<ffffffffa015056c>] macvlan_open+0x1bc/0x230 [macvlan]
[  992.970256]  [<ffffffff816b8de7>] __dev_open+0xd7/0x150
[  992.970735]  [<ffffffff816b8bd7>] __dev_change_flags+0xa7/0x170
[  992.971220]  [<ffffffff816b8ccb>] dev_change_flags+0x2b/0x70
[  992.971703]  [<ffffffff817471b2>] devinet_ioctl+0x602/0x6d0
[  992.972184]  [<ffffffff81748168>] inet_ioctl+0x78/0x90
[  992.972666]  [<ffffffff816a143b>] sock_do_ioctl+0x2b/0x70
[  992.973146]  [<ffffffff816a14ed>] sock_ioctl+0x6d/0x260
[  992.973627]  [<ffffffff811ad3b4>] do_vfs_ioctl+0x84/0x540
[  992.974109]  [<ffffffff811a4c81>] ? final_putname+0x21/0x50
[  992.974593]  [<ffffffff818725d5>] ? sysret_check+0x22/0x5d
[  992.975073]  [<ffffffff811ad901>] SyS_ioctl+0x91/0xa0
[  992.975550]  [<ffffffff818725a9>] system_call_fastpath+0x16/0x1b
[  992.976026] Code: ff 66 66 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 48 83 ec 20 48 89 5d e8 4c 89 65 f0 48 89 f3 4c 89 6d f8 4c 8b a7 08 02 00 00 <44> 0f b6 6e 56 44 03 af 14 02 00 00 4c 89 e7 e8 5e f2 ff ff be
[  992.982261] RIP  [<ffffffffa003b71e>] ixgbe_disable_fwd_ring+0x1e/0xf0 [ixgbe]
[  992.983212]  RSP <ffff8801d7dcbbb8>
[  992.983681] CR2: 0000000000000056
[  992.984248] ---[ end trace 9f54802b5cc3638b ]---

Cc: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@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  |  8 ++++++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 14 ++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index bc3eff7..5a3efd9 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7840,9 +7840,17 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)
 {
 	struct ixgbe_fwd_adapter *fwd_adapter = NULL;
 	struct ixgbe_adapter *adapter = netdev_priv(pdev);
+	int used_pools = adapter->num_vfs + adapter->num_rx_pools;
 	unsigned int limit;
 	int pool, err;
 
+	/* Hardware has a limited number of available pools. Each VF, and the
+	 * PF require a pool. Check to ensure we don't attempt to use more
+	 * then the available number of pools.
+	 */
+	if (used_pools >= IXGBE_MAX_VF_FUNCTIONS)
+		return ERR_PTR(-EINVAL);
+
 #ifdef CONFIG_RPS
 	if (vdev->num_rx_queues != vdev->num_tx_queues) {
 		netdev_info(pdev, "%s: Only supports a single queue count for TX and RX\n",
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index c14d4d8..706fc69 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -250,13 +250,15 @@ static int ixgbe_pci_sriov_enable(struct pci_dev *dev, int num_vfs)
 	if (err)
 		return err;
 
-	/* While the SR-IOV capability structure reports total VFs to be
-	 * 64 we limit the actual number that can be allocated to 63 so
-	 * that some transmit/receive resources can be reserved to the
-	 * PF.  The PCI bus driver already checks for other values out of
-	 * range.
+	/* While the SR-IOV capability structure reports total VFs to be 64,
+	 * we have to limit the actual number allocated based on two factors.
+	 * First, we reserve some transmit/receive resources for the PF.
+	 * Second, VMDQ also uses the same pools that SR-IOV does. We need to
+	 * account for this, so that we don't accidentally allocate more VFs
+	 * than we have available pools. The PCI bus driver already checks for
+	 * other values out of range.
 	 */
-	if (num_vfs > IXGBE_MAX_VFS_DRV_LIMIT)
+	if ((num_vfs + adapter->num_rx_pools) > IXGBE_MAX_VF_FUNCTIONS)
 		return -EPERM;
 
 	adapter->num_vfs = num_vfs;
-- 
1.9.3

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

* Re: [net-next 08/15] i40e: fix panic due to too-early Tx queue enable
  2014-08-29  9:30 ` [net-next 08/15] i40e: fix panic due to too-early Tx queue enable Jeff Kirsher
@ 2014-08-29 17:08   ` Sergei Shtylyov
  0 siblings, 0 replies; 19+ messages in thread
From: Sergei Shtylyov @ 2014-08-29 17:08 UTC (permalink / raw)
  To: Jeff Kirsher, davem
  Cc: Jesse Brandeburg, netdev, nhorman, sassmann, Mitch Williams

Hello.

On 08/29/2014 01:30 PM, Jeff Kirsher wrote:

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

> This fixes the panic under traffic load when resetting.  This issue
> could also show up if/whenever there is a Tx-timeout.

> Change-ID: Ie393a1f17fd5d962e56fc3bfe784899ef25402f5
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
> Tested-by: Jim Young <jamesx.m.young@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 64b8683..d37dea1 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -5289,7 +5289,7 @@ static void i40e_fdir_reinit_subtask(struct i40e_pf *pf)
>    **/
>   static void i40e_vsi_link_event(struct i40e_vsi *vsi, bool link_up)
>   {
> -	if (!vsi)
> +	if (!vsi || (test_bit(__I40E_DOWN, &vsi->state)))

    Enclosing function call into parens is totally pointless.

WBR, Sergei

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

* Re: [net-next 05/15] i40e: Tell OS link is going down when calling set_phy_config
  2014-08-29  9:30 ` [net-next 05/15] i40e: Tell OS link is going down when calling set_phy_config Jeff Kirsher
@ 2014-08-29 17:37   ` Sergei Shtylyov
  2014-09-03 17:27     ` Greg Rose
  0 siblings, 1 reply; 19+ messages in thread
From: Sergei Shtylyov @ 2014-08-29 17:37 UTC (permalink / raw)
  To: Jeff Kirsher, davem; +Cc: Catherine Sullivan, netdev, nhorman, sassmann

On 08/29/2014 01:30 PM, Jeff Kirsher wrote:

> From: Catherine Sullivan <catherine.sullivan@intel.com>

> Since we don't seem to be getting an LSE telling us link is going down
> during set_phy_config (but we do get an LSE telling us we are coming
> back up), fake one for the OS and tell them link is going down. Also
> do an atomic restart no matter what because there are times the user
> may want to end with link up even if they started with link down (like
> if they accidentally set it to a speed that can't link and are trying to
> fix it).

> Change-ID: I0a642af9c1d0feb67bce741aba1a9c33bd349ed6
> Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
> Tested-by: Jim Young <jamesx.m.young@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
>   drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 21 ++++++++++++++++++---
>   1 file changed, 18 insertions(+), 3 deletions(-)

> diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> index de4ce0e..101be2f 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> @@ -559,9 +559,17 @@ static int i40e_set_settings(struct net_device *netdev,
>   		config.eeer = abilities.eeer_val;
>   		config.low_power_ctrl = abilities.d3_lpan;
>
> -		/* If link is up set link and an so changes take effect */
> -		if (hw->phy.link_info.link_info & I40E_AQ_LINK_UP)
> -			config.abilities |= I40E_AQ_PHY_ENABLE_ATOMIC_LINK;
> +		/* set link and an so changes take effect */

    Can't parse this comment, probably a word is missing?

WBR, Sergei

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

* Re: [net-next 05/15] i40e: Tell OS link is going down when calling set_phy_config
  2014-08-29 17:37   ` Sergei Shtylyov
@ 2014-09-03 17:27     ` Greg Rose
  0 siblings, 0 replies; 19+ messages in thread
From: Greg Rose @ 2014-09-03 17:27 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Jeff Kirsher, davem, Catherine Sullivan, netdev, nhorman, sassmann

On Fri, 29 Aug 2014 21:37:39 +0400
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> wrote:

> On 08/29/2014 01:30 PM, Jeff Kirsher wrote:
> 
> > From: Catherine Sullivan <catherine.sullivan@intel.com>
> 
> > Since we don't seem to be getting an LSE telling us link is going
> > down during set_phy_config (but we do get an LSE telling us we are
> > coming back up), fake one for the OS and tell them link is going
> > down. Also do an atomic restart no matter what because there are
> > times the user may want to end with link up even if they started
> > with link down (like if they accidentally set it to a speed that
> > can't link and are trying to fix it).
> 
> > Change-ID: I0a642af9c1d0feb67bce741aba1a9c33bd349ed6
> > Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
> > Tested-by: Jim Young <jamesx.m.young@intel.com>
> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > ---
> >   drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 21
> > ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3
> > deletions(-)
> 
> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> > b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index
> > de4ce0e..101be2f 100644 ---
> > a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++
> > b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -559,9 +559,17
> > @@ static int i40e_set_settings(struct net_device *netdev,
> > config.eeer = abilities.eeer_val; config.low_power_ctrl =
> > abilities.d3_lpan;
> >
> > -		/* If link is up set link and an so changes take
> > effect */
> > -		if (hw->phy.link_info.link_info & I40E_AQ_LINK_UP)
> > -			config.abilities |=
> > I40E_AQ_PHY_ENABLE_ATOMIC_LINK;
> > +		/* set link and an so changes take effect */
> 
>     Can't parse this comment, probably a word is missing?
> 
> WBR, Sergei

"and an" should be "and AN" I think - AN standing in for
auto negotiation.

Agreed the comment needs fixing up.  Should probably just say
"auto negotiation"

- Greg

> 
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2014-09-03 17:28 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-29  9:30 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2014-08-29 Jeff Kirsher
2014-08-29  9:30 ` [net-next 01/15] i40e: Add dual speed module support Jeff Kirsher
2014-08-29  9:30 ` [net-next 02/15] i40e: Allow user to change link settings if link is down Jeff Kirsher
2014-08-29  9:30 ` [net-next 03/15] i40e: Change wording to be more consistent Jeff Kirsher
2014-08-29  9:30 ` [net-next 04/15] i40e: Remove unnecessary assignment Jeff Kirsher
2014-08-29  9:30 ` [net-next 05/15] i40e: Tell OS link is going down when calling set_phy_config Jeff Kirsher
2014-08-29 17:37   ` Sergei Shtylyov
2014-09-03 17:27     ` Greg Rose
2014-08-29  9:30 ` [net-next 06/15] i40e: make warning less verbose Jeff Kirsher
2014-08-29  9:30 ` [net-next 07/15] i40e: Fix an issue when PF reset fails Jeff Kirsher
2014-08-29  9:30 ` [net-next 08/15] i40e: fix panic due to too-early Tx queue enable Jeff Kirsher
2014-08-29 17:08   ` Sergei Shtylyov
2014-08-29  9:30 ` [net-next 09/15] i40e/i40evf: Bump i40e/i40evf versions Jeff Kirsher
2014-08-29  9:30 ` [net-next 10/15] i40e: use global pci_vfs_assigned() to replace local i40e_vfs_are_assigned() Jeff Kirsher
2014-08-29  9:30 ` [net-next 11/15] ixgbe: Cleanup FDB handling code Jeff Kirsher
2014-08-29  9:30 ` [net-next 12/15] ixgbe: reset interface on link loss with pending Tx work from the VF Jeff Kirsher
2014-08-29  9:30 ` [net-next 13/15] ixgbevf: introduce delay for checking VFLINKS on 82599 Jeff Kirsher
2014-08-29  9:30 ` [net-next 14/15] ixgbe: add comment noting recalculation of queues Jeff Kirsher
2014-08-29  9:30 ` [net-next 15/15] ixgbe: limit combined total of macvlan and SR-IOV VFs 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.