netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06
@ 2014-06-06  9:04 Jeff Kirsher
  2014-06-06  9:04 ` [net-next 01/13] i40e: set lan_veb index Jeff Kirsher
                   ` (13 more replies)
  0 siblings, 14 replies; 18+ messages in thread
From: Jeff Kirsher @ 2014-06-06  9:04 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann

This series contains updates to i40e and i40evf.

Shannon sets the lan_veb index when the Virtual Ethernet Bridge (VEB) is
created for the basic LAN device and its Virtual Switch Interfaces (VSIs).
Also adds the VEB/VSI statistics in the ethtool stats output.  Increases the
reset wait time because the original time was too optimistic and resets
were failing after EMPR.  This won't delay the actual wait, just allows
us to poll more times as needed.  He fixes the attempted removal of the
HMC space and unhook IRQs when a reset recovery fails because the HMC space
never got setup and IRQs are already unhooked in the first place, so the
removal is not necessary.

Jesse adds a log message for pre-production hardware so that the user is
notified that there may be issues with the hardware, yet does not prevent
the user from using the hardware.  Add the printing of link messages
in the i40e driver like all the other Intel Ethernet drivers.

Mitch makes log message changes to i40evf to prevent confusion by making
the most common messages less scary by lowering them to a less terrifying
log level.  This is due to the fact that depending on the timing of what
the PF driver is doing, it may take a few tries before the VF driver is able
to communicate with the PF driver on init or reset recovery.

Kamil provides a change to prevent the driver from getting into a endless
loop while trying to send GetVersion AQ command, since BO silicon blocks
AQ registers when in Blank Flash mode.  So introduce a simple check for a
correct value in one of the AQ registers to be sure that AQ was configured
correctly.

Matt adds a function which indicates our intention to enable or disable a
particular transmit queue.  Also adds a function to notify the device's
transmit unit that we are about to enable or disable a transmit queue.

The following are changes since commit 9e89fd8b7db71038fd9f70f34e210963fa8fc980:
  ipv6: Shrink udp_v6_mcast_next() to one socket variable
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master

Catherine Sullivan (1):
  i40e/i40evf: Bump build version

Jesse Brandeburg (2):
  i40e: print message for pre-production hardware
  i40e: print full link message

Kamil Krawczyk (1):
  i40e/i40evf: check AQ register for valid data

Matt Jared (1):
  i40e/i40evf: add Tx pre queue disable function

Mitch Williams (1):
  i40evf: make messages less dire

Shannon Nelson (7):
  i40e: set lan_veb index
  i40e: add VEB stats to ethtool
  i40e: increase reset wait time
  i40e: add vsi x-cast stats
  i40e: add xcast stats for port
  i40e: don't remove HMC that doesn't exist
  i40e: remove irqs only when they are set up

 drivers/net/ethernet/intel/i40e/i40e.h            |   1 +
 drivers/net/ethernet/intel/i40e/i40e_adminq.c     |  34 +++++-
 drivers/net/ethernet/intel/i40e/i40e_common.c     |  33 ++++-
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c    | 140 +++++++++++++++-------
 drivers/net/ethernet/intel/i40e/i40e_main.c       | 128 +++++++++++++++++---
 drivers/net/ethernet/intel/i40e/i40e_prototype.h  |   1 +
 drivers/net/ethernet/intel/i40e/i40e_register.h   |   8 ++
 drivers/net/ethernet/intel/i40evf/i40e_adminq.c   |  34 +++++-
 drivers/net/ethernet/intel/i40evf/i40e_register.h |   8 ++
 drivers/net/ethernet/intel/i40evf/i40evf_main.c   |   6 +-
 10 files changed, 320 insertions(+), 73 deletions(-)

-- 
1.9.3

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

* [net-next 01/13] i40e: set lan_veb index
  2014-06-06  9:04 [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 Jeff Kirsher
@ 2014-06-06  9:04 ` Jeff Kirsher
  2014-06-06  9:04 ` [net-next 02/13] i40e: add VEB stats to ethtool Jeff Kirsher
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Jeff Kirsher @ 2014-06-06  9:04 UTC (permalink / raw)
  To: davem; +Cc: Shannon Nelson, netdev, gospo, sassmann, Jeff Kirsher

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

When the VEB is created for the basic LAN device and its VSIs, we need to
set the tracking lan_veb index for later use.

Change-ID: I66bb74993bbda3621ca557437cb4b3517f9b315b
Signed-off-by: Shannon Nelson <shannon.nelson@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, 2 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 35e5ba4..a08f5a0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7735,6 +7735,8 @@ struct i40e_veb *i40e_veb_setup(struct i40e_pf *pf, u16 flags,
 	ret = i40e_add_veb(veb, pf->vsi[vsi_idx]);
 	if (ret)
 		goto err_veb;
+	if (vsi_idx == pf->lan_vsi)
+		pf->lan_veb = veb->idx;
 
 	return veb;
 
-- 
1.9.3

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

* [net-next 02/13] i40e: add VEB stats to ethtool
  2014-06-06  9:04 [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 Jeff Kirsher
  2014-06-06  9:04 ` [net-next 01/13] i40e: set lan_veb index Jeff Kirsher
@ 2014-06-06  9:04 ` Jeff Kirsher
  2014-06-06  9:04 ` [net-next 03/13] i40e: print message for pre-production hardware Jeff Kirsher
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Jeff Kirsher @ 2014-06-06  9:04 UTC (permalink / raw)
  To: davem; +Cc: Shannon Nelson, netdev, gospo, sassmann, Jeff Kirsher

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

Print the VEB statistics in the ethtool stats output.

Change-ID: Ic93d4c3922345c43e4cfd7f7e7a906844dd2f49f
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 127 ++++++++++++++++---------
 1 file changed, 84 insertions(+), 43 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 1bb470b..7f03b23 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -46,6 +46,8 @@ struct i40e_stats {
 		I40E_STAT(struct i40e_pf, _name, _stat)
 #define I40E_VSI_STAT(_name, _stat) \
 		I40E_STAT(struct i40e_vsi, _name, _stat)
+#define I40E_VEB_STAT(_name, _stat) \
+		I40E_STAT(struct i40e_veb, _name, _stat)
 
 static const struct i40e_stats i40e_gstrings_net_stats[] = {
 	I40E_NETDEV_STAT(rx_packets),
@@ -62,6 +64,21 @@ static const struct i40e_stats i40e_gstrings_net_stats[] = {
 	I40E_NETDEV_STAT(rx_crc_errors),
 };
 
+static const struct i40e_stats i40e_gstrings_veb_stats[] = {
+	I40E_VEB_STAT("rx_bytes", stats.rx_bytes),
+	I40E_VEB_STAT("tx_bytes", stats.tx_bytes),
+	I40E_VEB_STAT("rx_unicast", stats.rx_unicast),
+	I40E_VEB_STAT("tx_unicast", stats.tx_unicast),
+	I40E_VEB_STAT("rx_multicast", stats.rx_multicast),
+	I40E_VEB_STAT("tx_multicast", stats.tx_multicast),
+	I40E_VEB_STAT("rx_broadcast", stats.rx_broadcast),
+	I40E_VEB_STAT("tx_broadcast", stats.tx_broadcast),
+	I40E_VEB_STAT("rx_discards", stats.rx_discards),
+	I40E_VEB_STAT("tx_discards", stats.tx_discards),
+	I40E_VEB_STAT("tx_errors", stats.tx_errors),
+	I40E_VEB_STAT("rx_unknown_protocol", stats.rx_unknown_protocol),
+};
+
 static const struct i40e_stats i40e_gstrings_misc_stats[] = {
 	I40E_VSI_STAT("rx_unknown_protocol", eth_stats.rx_unknown_protocol),
 	I40E_VSI_STAT("rx_broadcast", eth_stats.rx_broadcast),
@@ -142,6 +159,7 @@ static struct i40e_stats i40e_gstrings_stats[] = {
 		 FIELD_SIZEOF(struct i40e_pf, stats.priority_xon_tx) + \
 		 FIELD_SIZEOF(struct i40e_pf, stats.priority_xon_2_xoff)) \
 		 / sizeof(u64))
+#define I40E_VEB_STATS_LEN	ARRAY_SIZE(i40e_gstrings_veb_stats)
 #define I40E_PF_STATS_LEN(n)	(I40E_GLOBAL_STATS_LEN + \
 				 I40E_PFC_STATS_LEN + \
 				 I40E_VSI_STATS_LEN((n)))
@@ -627,10 +645,15 @@ static int i40e_get_sset_count(struct net_device *netdev, int sset)
 	case ETH_SS_TEST:
 		return I40E_TEST_LEN;
 	case ETH_SS_STATS:
-		if (vsi == pf->vsi[pf->lan_vsi])
-			return I40E_PF_STATS_LEN(netdev);
-		else
+		if (vsi == pf->vsi[pf->lan_vsi]) {
+			int len = I40E_PF_STATS_LEN(netdev);
+
+			if (pf->lan_veb != I40E_NO_VEB)
+				len += I40E_VEB_STATS_LEN;
+			return len;
+		} else {
 			return I40E_VSI_STATS_LEN(netdev);
+		}
 	default:
 		return -EOPNOTSUPP;
 	}
@@ -686,23 +709,33 @@ static void i40e_get_ethtool_stats(struct net_device *netdev,
 		i += 2;
 	}
 	rcu_read_unlock();
-	if (vsi == pf->vsi[pf->lan_vsi]) {
-		for (j = 0; j < I40E_GLOBAL_STATS_LEN; j++) {
-			p = (char *)pf + i40e_gstrings_stats[j].stat_offset;
-			data[i++] = (i40e_gstrings_stats[j].sizeof_stat ==
-				   sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
-		}
-		for (j = 0; j < I40E_MAX_USER_PRIORITY; j++) {
-			data[i++] = pf->stats.priority_xon_tx[j];
-			data[i++] = pf->stats.priority_xoff_tx[j];
-		}
-		for (j = 0; j < I40E_MAX_USER_PRIORITY; j++) {
-			data[i++] = pf->stats.priority_xon_rx[j];
-			data[i++] = pf->stats.priority_xoff_rx[j];
+	if (vsi != pf->vsi[pf->lan_vsi])
+		return;
+
+	if (pf->lan_veb != I40E_NO_VEB) {
+		struct i40e_veb *veb = pf->veb[pf->lan_veb];
+		for (j = 0; j < I40E_VEB_STATS_LEN; j++) {
+			p = (char *)veb;
+			p += i40e_gstrings_veb_stats[j].stat_offset;
+			data[i++] = (i40e_gstrings_veb_stats[j].sizeof_stat ==
+				     sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
 		}
-		for (j = 0; j < I40E_MAX_USER_PRIORITY; j++)
-			data[i++] = pf->stats.priority_xon_2_xoff[j];
 	}
+	for (j = 0; j < I40E_GLOBAL_STATS_LEN; j++) {
+		p = (char *)pf + i40e_gstrings_stats[j].stat_offset;
+		data[i++] = (i40e_gstrings_stats[j].sizeof_stat ==
+			     sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
+	}
+	for (j = 0; j < I40E_MAX_USER_PRIORITY; j++) {
+		data[i++] = pf->stats.priority_xon_tx[j];
+		data[i++] = pf->stats.priority_xoff_tx[j];
+	}
+	for (j = 0; j < I40E_MAX_USER_PRIORITY; j++) {
+		data[i++] = pf->stats.priority_xon_rx[j];
+		data[i++] = pf->stats.priority_xoff_rx[j];
+	}
+	for (j = 0; j < I40E_MAX_USER_PRIORITY; j++)
+		data[i++] = pf->stats.priority_xon_2_xoff[j];
 }
 
 static void i40e_get_strings(struct net_device *netdev, u32 stringset,
@@ -742,34 +775,42 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset,
 			snprintf(p, ETH_GSTRING_LEN, "rx-%u.rx_bytes", i);
 			p += ETH_GSTRING_LEN;
 		}
-		if (vsi == pf->vsi[pf->lan_vsi]) {
-			for (i = 0; i < I40E_GLOBAL_STATS_LEN; i++) {
-				snprintf(p, ETH_GSTRING_LEN, "port.%s",
-					 i40e_gstrings_stats[i].stat_string);
-				p += ETH_GSTRING_LEN;
-			}
-			for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) {
-				snprintf(p, ETH_GSTRING_LEN,
-					 "port.tx_priority_%u_xon", i);
-				p += ETH_GSTRING_LEN;
-				snprintf(p, ETH_GSTRING_LEN,
-					 "port.tx_priority_%u_xoff", i);
-				p += ETH_GSTRING_LEN;
-			}
-			for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) {
-				snprintf(p, ETH_GSTRING_LEN,
-					 "port.rx_priority_%u_xon", i);
-				p += ETH_GSTRING_LEN;
-				snprintf(p, ETH_GSTRING_LEN,
-					 "port.rx_priority_%u_xoff", i);
-				p += ETH_GSTRING_LEN;
-			}
-			for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) {
-				snprintf(p, ETH_GSTRING_LEN,
-					 "port.rx_priority_%u_xon_2_xoff", i);
+		if (vsi != pf->vsi[pf->lan_vsi])
+			return;
+
+		if (pf->lan_veb != I40E_NO_VEB) {
+			for (i = 0; i < I40E_VEB_STATS_LEN; i++) {
+				snprintf(p, ETH_GSTRING_LEN, "veb.%s",
+					i40e_gstrings_veb_stats[i].stat_string);
 				p += ETH_GSTRING_LEN;
 			}
 		}
+		for (i = 0; i < I40E_GLOBAL_STATS_LEN; i++) {
+			snprintf(p, ETH_GSTRING_LEN, "port.%s",
+				 i40e_gstrings_stats[i].stat_string);
+			p += ETH_GSTRING_LEN;
+		}
+		for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) {
+			snprintf(p, ETH_GSTRING_LEN,
+				 "port.tx_priority_%u_xon", i);
+			p += ETH_GSTRING_LEN;
+			snprintf(p, ETH_GSTRING_LEN,
+				 "port.tx_priority_%u_xoff", i);
+			p += ETH_GSTRING_LEN;
+		}
+		for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) {
+			snprintf(p, ETH_GSTRING_LEN,
+				 "port.rx_priority_%u_xon", i);
+			p += ETH_GSTRING_LEN;
+			snprintf(p, ETH_GSTRING_LEN,
+				 "port.rx_priority_%u_xoff", i);
+			p += ETH_GSTRING_LEN;
+		}
+		for (i = 0; i < I40E_MAX_USER_PRIORITY; i++) {
+			snprintf(p, ETH_GSTRING_LEN,
+				 "port.rx_priority_%u_xon_2_xoff", i);
+			p += ETH_GSTRING_LEN;
+		}
 		/* BUG_ON(p - data != I40E_STATS_LEN * ETH_GSTRING_LEN); */
 		break;
 	}
-- 
1.9.3

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

* [net-next 03/13] i40e: print message for pre-production hardware
  2014-06-06  9:04 [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 Jeff Kirsher
  2014-06-06  9:04 ` [net-next 01/13] i40e: set lan_veb index Jeff Kirsher
  2014-06-06  9:04 ` [net-next 02/13] i40e: add VEB stats to ethtool Jeff Kirsher
@ 2014-06-06  9:04 ` Jeff Kirsher
  2014-06-06  9:04 ` [net-next 04/13] i40evf: make messages less dire Jeff Kirsher
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Jeff Kirsher @ 2014-06-06  9:04 UTC (permalink / raw)
  To: davem; +Cc: Jesse Brandeburg, netdev, gospo, sassmann, Jeff Kirsher

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

The driver and hardware are not expected to work correctly
with revision_id 0 hardware.  Don't prevent the user from
using it, but be sure to print a warning.

Change-ID: I3712d34752bfad458078a5f35dfd0aa0ae9fd20e
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index a08f5a0..105d754 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8298,6 +8298,10 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	i40e_verify_eeprom(pf);
 
+	/* Rev 0 hardware was never productized */
+	if (hw->revision_id < 1)
+		dev_warn(&pdev->dev, "This device is a pre-production adapter/LOM. Please be aware there may be issues with your hardware. If you are experiencing problems please contact your Intel or hardware representative who provided you with this hardware.\n");
+
 	i40e_clear_pxe_mode(hw);
 	err = i40e_get_capabilities(pf);
 	if (err)
-- 
1.9.3

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

* [net-next 04/13] i40evf: make messages less dire
  2014-06-06  9:04 [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 Jeff Kirsher
                   ` (2 preceding siblings ...)
  2014-06-06  9:04 ` [net-next 03/13] i40e: print message for pre-production hardware Jeff Kirsher
@ 2014-06-06  9:04 ` Jeff Kirsher
  2014-06-06 12:19   ` Joe Perches
  2014-06-06  9:04 ` [net-next 05/13] i40e/i40evf: check AQ register for valid data Jeff Kirsher
                   ` (9 subsequent siblings)
  13 siblings, 1 reply; 18+ messages in thread
From: Jeff Kirsher @ 2014-06-06  9:04 UTC (permalink / raw)
  To: davem; +Cc: Mitch Williams, netdev, gospo, sassmann, Jeff Kirsher

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

Depending on the timing of what the PF driver is doing, it make take a
few tries before the VF driver is able to communicate with the PF driver
on init or reset recovery. In order to prevent confusion, make the most
common messages less scary by lowering them to a less terrifying log
level and indicate that the driver will retry.

Change-ID: I1ec22aa59a68f4469aabe14775a1bfc1ab4b7f2f
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index d24f40f..f6a2bdc 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1963,7 +1963,7 @@ static void i40evf_init_task(struct work_struct *work)
 		}
 		err = i40evf_check_reset_complete(hw);
 		if (err) {
-			dev_err(&pdev->dev, "Device is still in reset (%d)\n",
+			dev_info(&pdev->dev, "Device is still in reset (%d), retrying\n",
 				err);
 			goto err;
 		}
@@ -1996,7 +1996,7 @@ static void i40evf_init_task(struct work_struct *work)
 		/* aq msg sent, awaiting reply */
 		err = i40evf_verify_api_ver(adapter);
 		if (err) {
-			dev_err(&pdev->dev, "Unable to verify API version (%d)\n",
+			dev_info(&pdev->dev, "Unable to verify API version (%d), retrying\n",
 				err);
 			goto err;
 		}
-- 
1.9.3

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

* [net-next 05/13] i40e/i40evf: check AQ register for valid data
  2014-06-06  9:04 [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 Jeff Kirsher
                   ` (3 preceding siblings ...)
  2014-06-06  9:04 ` [net-next 04/13] i40evf: make messages less dire Jeff Kirsher
@ 2014-06-06  9:04 ` Jeff Kirsher
  2014-06-06  9:04 ` [net-next 06/13] i40e/i40evf: add Tx pre queue disable function Jeff Kirsher
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Jeff Kirsher @ 2014-06-06  9:04 UTC (permalink / raw)
  To: davem; +Cc: Kamil Krawczyk, netdev, gospo, sassmann, Jeff Kirsher

From: Kamil Krawczyk <kamil.krawczyk@intel.com>

B0 Si blocks AQ registers when in Blank Flash mode - write is dropped,
read gives 0xDEADBEEF. Introduce a simple check for a correct value in one
of the AQ registers to be sure that AQ was configured correctly.
Without this check we get into an endless loop while trying to send
GetVersion AQ cmd.

Change-ID: I00102b8c5fa6c16d14289be677aafadf87f10f0d
Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_adminq.c   | 34 ++++++++++++++++++++++---
 drivers/net/ethernet/intel/i40evf/i40e_adminq.c | 34 ++++++++++++++++++++++---
 2 files changed, 60 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
index ba2811b..7a02749 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
@@ -291,8 +291,11 @@ static void i40e_free_asq_bufs(struct i40e_hw *hw)
  *
  *  Configure base address and length registers for the transmit queue
  **/
-static void i40e_config_asq_regs(struct i40e_hw *hw)
+static i40e_status i40e_config_asq_regs(struct i40e_hw *hw)
 {
+	i40e_status ret_code = 0;
+	u32 reg = 0;
+
 	if (hw->mac.type == I40E_MAC_VF) {
 		/* configure the transmit queue */
 		wr32(hw, I40E_VF_ATQBAH1,
@@ -301,6 +304,7 @@ static void i40e_config_asq_regs(struct i40e_hw *hw)
 		    lower_32_bits(hw->aq.asq.desc_buf.pa));
 		wr32(hw, I40E_VF_ATQLEN1, (hw->aq.num_asq_entries |
 					  I40E_VF_ATQLEN1_ATQENABLE_MASK));
+		reg = rd32(hw, I40E_VF_ATQBAL1);
 	} else {
 		/* configure the transmit queue */
 		wr32(hw, I40E_PF_ATQBAH,
@@ -309,7 +313,14 @@ static void i40e_config_asq_regs(struct i40e_hw *hw)
 		    lower_32_bits(hw->aq.asq.desc_buf.pa));
 		wr32(hw, I40E_PF_ATQLEN, (hw->aq.num_asq_entries |
 					  I40E_PF_ATQLEN_ATQENABLE_MASK));
+		reg = rd32(hw, I40E_PF_ATQBAL);
 	}
+
+	/* Check one register to verify that config was applied */
+	if (reg != lower_32_bits(hw->aq.asq.desc_buf.pa))
+		ret_code = I40E_ERR_ADMIN_QUEUE_ERROR;
+
+	return ret_code;
 }
 
 /**
@@ -318,8 +329,11 @@ static void i40e_config_asq_regs(struct i40e_hw *hw)
  *
  * Configure base address and length registers for the receive (event queue)
  **/
-static void i40e_config_arq_regs(struct i40e_hw *hw)
+static i40e_status i40e_config_arq_regs(struct i40e_hw *hw)
 {
+	i40e_status ret_code = 0;
+	u32 reg = 0;
+
 	if (hw->mac.type == I40E_MAC_VF) {
 		/* configure the receive queue */
 		wr32(hw, I40E_VF_ARQBAH1,
@@ -328,6 +342,7 @@ static void i40e_config_arq_regs(struct i40e_hw *hw)
 		    lower_32_bits(hw->aq.arq.desc_buf.pa));
 		wr32(hw, I40E_VF_ARQLEN1, (hw->aq.num_arq_entries |
 					  I40E_VF_ARQLEN1_ARQENABLE_MASK));
+		reg = rd32(hw, I40E_VF_ARQBAL1);
 	} else {
 		/* configure the receive queue */
 		wr32(hw, I40E_PF_ARQBAH,
@@ -336,10 +351,17 @@ static void i40e_config_arq_regs(struct i40e_hw *hw)
 		    lower_32_bits(hw->aq.arq.desc_buf.pa));
 		wr32(hw, I40E_PF_ARQLEN, (hw->aq.num_arq_entries |
 					  I40E_PF_ARQLEN_ARQENABLE_MASK));
+		reg = rd32(hw, I40E_PF_ARQBAL);
 	}
 
 	/* Update tail in the HW to post pre-allocated buffers */
 	wr32(hw, hw->aq.arq.tail, hw->aq.num_arq_entries - 1);
+
+	/* Check one register to verify that config was applied */
+	if (reg != lower_32_bits(hw->aq.arq.desc_buf.pa))
+		ret_code = I40E_ERR_ADMIN_QUEUE_ERROR;
+
+	return ret_code;
 }
 
 /**
@@ -387,7 +409,9 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw)
 		goto init_adminq_free_rings;
 
 	/* initialize base registers */
-	i40e_config_asq_regs(hw);
+	ret_code = i40e_config_asq_regs(hw);
+	if (ret_code)
+		goto init_adminq_free_rings;
 
 	/* success! */
 	goto init_adminq_exit;
@@ -444,7 +468,9 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw)
 		goto init_adminq_free_rings;
 
 	/* initialize base registers */
-	i40e_config_arq_regs(hw);
+	ret_code = i40e_config_arq_regs(hw);
+	if (ret_code)
+		goto init_adminq_free_rings;
 
 	/* success! */
 	goto init_adminq_exit;
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
index 68b4aac..eb67cce 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_adminq.c
@@ -289,8 +289,11 @@ static void i40e_free_asq_bufs(struct i40e_hw *hw)
  *
  *  Configure base address and length registers for the transmit queue
  **/
-static void i40e_config_asq_regs(struct i40e_hw *hw)
+static i40e_status i40e_config_asq_regs(struct i40e_hw *hw)
 {
+	i40e_status ret_code = 0;
+	u32 reg = 0;
+
 	if (hw->mac.type == I40E_MAC_VF) {
 		/* configure the transmit queue */
 		wr32(hw, I40E_VF_ATQBAH1,
@@ -299,6 +302,7 @@ static void i40e_config_asq_regs(struct i40e_hw *hw)
 		    lower_32_bits(hw->aq.asq.desc_buf.pa));
 		wr32(hw, I40E_VF_ATQLEN1, (hw->aq.num_asq_entries |
 					  I40E_VF_ATQLEN1_ATQENABLE_MASK));
+		reg = rd32(hw, I40E_VF_ATQBAL1);
 	} else {
 		/* configure the transmit queue */
 		wr32(hw, I40E_PF_ATQBAH,
@@ -307,7 +311,14 @@ static void i40e_config_asq_regs(struct i40e_hw *hw)
 		    lower_32_bits(hw->aq.asq.desc_buf.pa));
 		wr32(hw, I40E_PF_ATQLEN, (hw->aq.num_asq_entries |
 					  I40E_PF_ATQLEN_ATQENABLE_MASK));
+		reg = rd32(hw, I40E_PF_ATQBAL);
 	}
+
+	/* Check one register to verify that config was applied */
+	if (reg != lower_32_bits(hw->aq.asq.desc_buf.pa))
+		ret_code = I40E_ERR_ADMIN_QUEUE_ERROR;
+
+	return ret_code;
 }
 
 /**
@@ -316,8 +327,11 @@ static void i40e_config_asq_regs(struct i40e_hw *hw)
  *
  * Configure base address and length registers for the receive (event queue)
  **/
-static void i40e_config_arq_regs(struct i40e_hw *hw)
+static i40e_status i40e_config_arq_regs(struct i40e_hw *hw)
 {
+	i40e_status ret_code = 0;
+	u32 reg = 0;
+
 	if (hw->mac.type == I40E_MAC_VF) {
 		/* configure the receive queue */
 		wr32(hw, I40E_VF_ARQBAH1,
@@ -326,6 +340,7 @@ static void i40e_config_arq_regs(struct i40e_hw *hw)
 		    lower_32_bits(hw->aq.arq.desc_buf.pa));
 		wr32(hw, I40E_VF_ARQLEN1, (hw->aq.num_arq_entries |
 					  I40E_VF_ARQLEN1_ARQENABLE_MASK));
+		reg = rd32(hw, I40E_VF_ARQBAL1);
 	} else {
 		/* configure the receive queue */
 		wr32(hw, I40E_PF_ARQBAH,
@@ -334,10 +349,17 @@ static void i40e_config_arq_regs(struct i40e_hw *hw)
 		    lower_32_bits(hw->aq.arq.desc_buf.pa));
 		wr32(hw, I40E_PF_ARQLEN, (hw->aq.num_arq_entries |
 					  I40E_PF_ARQLEN_ARQENABLE_MASK));
+		reg = rd32(hw, I40E_PF_ARQBAL);
 	}
 
 	/* Update tail in the HW to post pre-allocated buffers */
 	wr32(hw, hw->aq.arq.tail, hw->aq.num_arq_entries - 1);
+
+	/* Check one register to verify that config was applied */
+	if (reg != lower_32_bits(hw->aq.arq.desc_buf.pa))
+		ret_code = I40E_ERR_ADMIN_QUEUE_ERROR;
+
+	return ret_code;
 }
 
 /**
@@ -385,7 +407,9 @@ static i40e_status i40e_init_asq(struct i40e_hw *hw)
 		goto init_adminq_free_rings;
 
 	/* initialize base registers */
-	i40e_config_asq_regs(hw);
+	ret_code = i40e_config_asq_regs(hw);
+	if (ret_code)
+		goto init_adminq_free_rings;
 
 	/* success! */
 	goto init_adminq_exit;
@@ -442,7 +466,9 @@ static i40e_status i40e_init_arq(struct i40e_hw *hw)
 		goto init_adminq_free_rings;
 
 	/* initialize base registers */
-	i40e_config_arq_regs(hw);
+	ret_code = i40e_config_arq_regs(hw);
+	if (ret_code)
+		goto init_adminq_free_rings;
 
 	/* success! */
 	goto init_adminq_exit;
-- 
1.9.3

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

* [net-next 06/13] i40e/i40evf: add Tx pre queue disable function
  2014-06-06  9:04 [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 Jeff Kirsher
                   ` (4 preceding siblings ...)
  2014-06-06  9:04 ` [net-next 05/13] i40e/i40evf: check AQ register for valid data Jeff Kirsher
@ 2014-06-06  9:04 ` Jeff Kirsher
  2014-06-06  9:04 ` [net-next 07/13] i40e: increase reset wait time Jeff Kirsher
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Jeff Kirsher @ 2014-06-06  9:04 UTC (permalink / raw)
  To: davem; +Cc: Matt Jared, netdev, gospo, sassmann, Shannon Nelson, Jeff Kirsher

From: Matt Jared <matthew.a.jared@intel.com>

Add a function which indicates our intention to enable or disable a particular
Tx queue. Also add a function to notify the device's Tx unit that we're about
to enable or disable a Tx queue.

Change-ID: I6adf3cbb5bb3e3c984d1ec969e06577c19ef296d
Signed-off-by: Matt Jared <matthew.a.jared@intel.com>
Signed-off-by: Shannon Nelson <shannon.nelson@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     | 31 +++++++++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_main.c       |  6 +++++
 drivers/net/ethernet/intel/i40e/i40e_prototype.h  |  1 +
 drivers/net/ethernet/intel/i40e/i40e_register.h   |  8 ++++++
 drivers/net/ethernet/intel/i40evf/i40e_register.h |  8 ++++++
 5 files changed, 54 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index a31e3d7..36607b0 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -657,6 +657,37 @@ i40e_status i40e_get_mac_addr(struct i40e_hw *hw, u8 *mac_addr)
 }
 
 /**
+ * i40e_pre_tx_queue_cfg - pre tx queue configure
+ * @hw: pointer to the HW structure
+ * @queue: target pf queue index
+ * @enable: state change request
+ *
+ * Handles hw requirement to indicate intention to enable
+ * or disable target queue.
+ **/
+void i40e_pre_tx_queue_cfg(struct i40e_hw *hw, u32 queue, bool enable)
+{
+	u32 reg_val = rd32(hw, I40E_PFLAN_QALLOC);
+	u32 first_queue = (reg_val & I40E_PFLAN_QALLOC_FIRSTQ_MASK);
+	u32 abs_queue_idx = first_queue + queue;
+	u32 reg_block = 0;
+
+	if (abs_queue_idx >= 128)
+		reg_block = abs_queue_idx / 128;
+
+	reg_val = rd32(hw, I40E_GLLAN_TXPRE_QDIS(reg_block));
+	reg_val &= ~I40E_GLLAN_TXPRE_QDIS_QINDX_MASK;
+	reg_val |= (abs_queue_idx << I40E_GLLAN_TXPRE_QDIS_QINDX_SHIFT);
+
+	if (enable)
+		reg_val |= I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_MASK;
+	else
+		reg_val |= I40E_GLLAN_TXPRE_QDIS_SET_QDIS_MASK;
+
+	wr32(hw, I40E_GLLAN_TXPRE_QDIS(reg_block), reg_val);
+}
+
+/**
  * i40e_get_media_type - Gets media type
  * @hw: pointer to the hardware structure
  **/
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 105d754..726eceb 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -3183,6 +3183,12 @@ static int i40e_vsi_control_tx(struct i40e_vsi *vsi, bool enable)
 
 	pf_q = vsi->base_queue;
 	for (i = 0; i < vsi->num_queue_pairs; i++, pf_q++) {
+
+		/* warn the TX unit of coming changes */
+		i40e_pre_tx_queue_cfg(&pf->hw, pf_q, enable);
+		if (!enable)
+			udelay(10);
+
 		for (j = 0; j < 50; j++) {
 			tx_reg = rd32(hw, I40E_QTX_ENA(pf_q));
 			if (((tx_reg >> I40E_QTX_ENA_QENA_REQ_SHIFT) & 1) ==
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index 57172f9..58c4e1e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -221,6 +221,7 @@ bool i40e_get_link_status(struct i40e_hw *hw);
 i40e_status i40e_get_mac_addr(struct i40e_hw *hw,
 						u8 *mac_addr);
 i40e_status i40e_validate_mac_addr(u8 *mac_addr);
+void i40e_pre_tx_queue_cfg(struct i40e_hw *hw, u32 queue, bool enable);
 /* prototype for functions used for NVM access */
 i40e_status i40e_init_nvm(struct i40e_hw *hw);
 i40e_status i40e_acquire_nvm(struct i40e_hw *hw,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_register.h b/drivers/net/ethernet/intel/i40e/i40e_register.h
index 25c9286..947de98 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_register.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_register.h
@@ -1585,6 +1585,14 @@
 #define I40E_GLLAN_TSOMSK_M 0x000442DC
 #define I40E_GLLAN_TSOMSK_M_TCPMSKM_SHIFT 0
 #define I40E_GLLAN_TSOMSK_M_TCPMSKM_MASK (0xFFF << I40E_GLLAN_TSOMSK_M_TCPMSKM_SHIFT)
+#define I40E_GLLAN_TXPRE_QDIS(_i) (0x000E6500 + ((_i) * 4)) /* i=0..11 */
+#define I40E_GLLAN_TXPRE_QDIS_QINDX_SHIFT 0
+#define I40E_GLLAN_TXPRE_QDIS_QINDX_MASK (0x7FF << I40E_GLLAN_TXPRE_QDIS_QINDX_SHIFT)
+#define I40E_GLLAN_TXPRE_QDIS_SET_QDIS_SHIFT 30
+#define I40E_GLLAN_TXPRE_QDIS_SET_QDIS_MASK (0x1 << I40E_GLLAN_TXPRE_QDIS_SET_QDIS_SHIFT)
+#define I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_SHIFT 31
+#define I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_MASK (0x1 << I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_SHIFT)
+
 #define I40E_PFLAN_QALLOC 0x001C0400
 #define I40E_PFLAN_QALLOC_FIRSTQ_SHIFT 0
 #define I40E_PFLAN_QALLOC_FIRSTQ_MASK (0x7FF << I40E_PFLAN_QALLOC_FIRSTQ_SHIFT)
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_register.h b/drivers/net/ethernet/intel/i40evf/i40e_register.h
index 7977205..3698396 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_register.h
+++ b/drivers/net/ethernet/intel/i40evf/i40e_register.h
@@ -1585,6 +1585,14 @@
 #define I40E_GLLAN_TSOMSK_M 0x000442DC
 #define I40E_GLLAN_TSOMSK_M_TCPMSKM_SHIFT 0
 #define I40E_GLLAN_TSOMSK_M_TCPMSKM_MASK (0xFFF << I40E_GLLAN_TSOMSK_M_TCPMSKM_SHIFT)
+#define I40E_GLLAN_TXPRE_QDIS(_i) (0x000E6500 + ((_i) * 4)) /* i=0..11 */
+#define I40E_GLLAN_TXPRE_QDIS_QINDX_SHIFT 0
+#define I40E_GLLAN_TXPRE_QDIS_QINDX_MASK (0x7FF << I40E_GLLAN_TXPRE_QDIS_QINDX_SHIFT)
+#define I40E_GLLAN_TXPRE_QDIS_SET_QDIS_SHIFT 30
+#define I40E_GLLAN_TXPRE_QDIS_SET_QDIS_MASK (0x1 << I40E_GLLAN_TXPRE_QDIS_SET_QDIS_SHIFT)
+#define I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_SHIFT 31
+#define I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_MASK (0x1 << I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_SHIFT)
+
 #define I40E_PFLAN_QALLOC 0x001C0400
 #define I40E_PFLAN_QALLOC_FIRSTQ_SHIFT 0
 #define I40E_PFLAN_QALLOC_FIRSTQ_MASK (0x7FF << I40E_PFLAN_QALLOC_FIRSTQ_SHIFT)
-- 
1.9.3

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

* [net-next 07/13] i40e: increase reset wait time
  2014-06-06  9:04 [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 Jeff Kirsher
                   ` (5 preceding siblings ...)
  2014-06-06  9:04 ` [net-next 06/13] i40e/i40evf: add Tx pre queue disable function Jeff Kirsher
@ 2014-06-06  9:04 ` Jeff Kirsher
  2014-06-06  9:04 ` [net-next 08/13] i40e: add vsi x-cast stats Jeff Kirsher
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Jeff Kirsher @ 2014-06-06  9:04 UTC (permalink / raw)
  To: davem; +Cc: Shannon Nelson, netdev, gospo, sassmann, Jeff Kirsher

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

The wait time was originally too optimistic and the resets were failing
after EMPR.  This increases the loop count to wait considerably longer.
This won't delay the actual wait longer than really needed, just allows
us to poll more times as needed.

Change-ID: If7b96f55cc25b8d06cbbe8665259d250188c53d7
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 36607b0..fd2b573 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -734,7 +734,7 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 }
 
 #define I40E_PF_RESET_WAIT_COUNT_A0	200
-#define I40E_PF_RESET_WAIT_COUNT	10
+#define I40E_PF_RESET_WAIT_COUNT	100
 /**
  * i40e_pf_reset - Reset the PF
  * @hw: pointer to the hardware structure
-- 
1.9.3

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

* [net-next 08/13] i40e: add vsi x-cast stats
  2014-06-06  9:04 [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 Jeff Kirsher
                   ` (6 preceding siblings ...)
  2014-06-06  9:04 ` [net-next 07/13] i40e: increase reset wait time Jeff Kirsher
@ 2014-06-06  9:04 ` Jeff Kirsher
  2014-06-06  9:04 ` [net-next 09/13] i40e: add xcast stats for port Jeff Kirsher
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Jeff Kirsher @ 2014-06-06  9:04 UTC (permalink / raw)
  To: davem; +Cc: Shannon Nelson, netdev, gospo, sassmann, Jeff Kirsher

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

Add VSI HW stats for unicast, multicast, and broadcast for Rx and Tx.
Stop printing the netdev multicast value because it doesn't include Tx
and would be confusing.

Change-ID: I08278b6657e7c838fd29a4a1f305f78fe1b150be
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 7f03b23..d910b88 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -58,7 +58,6 @@ static const struct i40e_stats i40e_gstrings_net_stats[] = {
 	I40E_NETDEV_STAT(tx_errors),
 	I40E_NETDEV_STAT(rx_dropped),
 	I40E_NETDEV_STAT(tx_dropped),
-	I40E_NETDEV_STAT(multicast),
 	I40E_NETDEV_STAT(collisions),
 	I40E_NETDEV_STAT(rx_length_errors),
 	I40E_NETDEV_STAT(rx_crc_errors),
@@ -80,9 +79,13 @@ static const struct i40e_stats i40e_gstrings_veb_stats[] = {
 };
 
 static const struct i40e_stats i40e_gstrings_misc_stats[] = {
-	I40E_VSI_STAT("rx_unknown_protocol", eth_stats.rx_unknown_protocol),
+	I40E_VSI_STAT("rx_unicast", eth_stats.rx_unicast),
+	I40E_VSI_STAT("tx_unicast", eth_stats.tx_unicast),
+	I40E_VSI_STAT("rx_multicast", eth_stats.rx_multicast),
+	I40E_VSI_STAT("tx_multicast", eth_stats.tx_multicast),
 	I40E_VSI_STAT("rx_broadcast", eth_stats.rx_broadcast),
 	I40E_VSI_STAT("tx_broadcast", eth_stats.tx_broadcast),
+	I40E_VSI_STAT("rx_unknown_protocol", eth_stats.rx_unknown_protocol),
 };
 
 static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,
-- 
1.9.3

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

* [net-next 09/13] i40e: add xcast stats for port
  2014-06-06  9:04 [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 Jeff Kirsher
                   ` (7 preceding siblings ...)
  2014-06-06  9:04 ` [net-next 08/13] i40e: add vsi x-cast stats Jeff Kirsher
@ 2014-06-06  9:04 ` Jeff Kirsher
  2014-06-06  9:04 ` [net-next 10/13] i40e: print full link message Jeff Kirsher
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Jeff Kirsher @ 2014-06-06  9:04 UTC (permalink / raw)
  To: davem; +Cc: Shannon Nelson, netdev, gospo, sassmann, Jeff Kirsher

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

Add the missing unicast, multicast, and broadcast stats for the port.

Change-ID: Ifc366d7b7745f70eaac9d00eeb0694eb9ec076a9
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c |  6 ++++++
 drivers/net/ethernet/intel/i40e/i40e_main.c    | 26 ++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index d910b88..df3917b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -104,6 +104,12 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,
 static struct i40e_stats i40e_gstrings_stats[] = {
 	I40E_PF_STAT("rx_bytes", stats.eth.rx_bytes),
 	I40E_PF_STAT("tx_bytes", stats.eth.tx_bytes),
+	I40E_PF_STAT("rx_unicast", stats.eth.rx_unicast),
+	I40E_PF_STAT("tx_unicast", stats.eth.tx_unicast),
+	I40E_PF_STAT("rx_multicast", stats.eth.rx_multicast),
+	I40E_PF_STAT("tx_multicast", stats.eth.tx_multicast),
+	I40E_PF_STAT("rx_broadcast", stats.eth.rx_broadcast),
+	I40E_PF_STAT("tx_broadcast", stats.eth.tx_broadcast),
 	I40E_PF_STAT("tx_errors", stats.eth.tx_errors),
 	I40E_PF_STAT("rx_dropped", stats.eth.rx_discards),
 	I40E_PF_STAT("tx_dropped", stats.eth.tx_discards),
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 726eceb..e9cd9bb 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -854,11 +854,37 @@ static void i40e_update_pf_stats(struct i40e_pf *pf)
 			   pf->stat_offsets_loaded,
 			   &osd->eth.tx_discards,
 			   &nsd->eth.tx_discards);
+
+	i40e_stat_update48(hw, I40E_GLPRT_UPRCH(hw->port),
+			   I40E_GLPRT_UPRCL(hw->port),
+			   pf->stat_offsets_loaded,
+			   &osd->eth.rx_unicast,
+			   &nsd->eth.rx_unicast);
 	i40e_stat_update48(hw, I40E_GLPRT_MPRCH(hw->port),
 			   I40E_GLPRT_MPRCL(hw->port),
 			   pf->stat_offsets_loaded,
 			   &osd->eth.rx_multicast,
 			   &nsd->eth.rx_multicast);
+	i40e_stat_update48(hw, I40E_GLPRT_BPRCH(hw->port),
+			   I40E_GLPRT_BPRCL(hw->port),
+			   pf->stat_offsets_loaded,
+			   &osd->eth.rx_broadcast,
+			   &nsd->eth.rx_broadcast);
+	i40e_stat_update48(hw, I40E_GLPRT_UPTCH(hw->port),
+			   I40E_GLPRT_UPTCL(hw->port),
+			   pf->stat_offsets_loaded,
+			   &osd->eth.tx_unicast,
+			   &nsd->eth.tx_unicast);
+	i40e_stat_update48(hw, I40E_GLPRT_MPTCH(hw->port),
+			   I40E_GLPRT_MPTCL(hw->port),
+			   pf->stat_offsets_loaded,
+			   &osd->eth.tx_multicast,
+			   &nsd->eth.tx_multicast);
+	i40e_stat_update48(hw, I40E_GLPRT_BPTCH(hw->port),
+			   I40E_GLPRT_BPTCL(hw->port),
+			   pf->stat_offsets_loaded,
+			   &osd->eth.tx_broadcast,
+			   &nsd->eth.tx_broadcast);
 
 	i40e_stat_update32(hw, I40E_GLPRT_TDOLD(hw->port),
 			   pf->stat_offsets_loaded,
-- 
1.9.3

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

* [net-next 10/13] i40e: print full link message
  2014-06-06  9:04 [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 Jeff Kirsher
                   ` (8 preceding siblings ...)
  2014-06-06  9:04 ` [net-next 09/13] i40e: add xcast stats for port Jeff Kirsher
@ 2014-06-06  9:04 ` Jeff Kirsher
  2014-06-06 12:23   ` Joe Perches
  2014-06-06  9:04 ` [net-next 11/13] i40e: don't remove HMC that doesn't exist Jeff Kirsher
                   ` (3 subsequent siblings)
  13 siblings, 1 reply; 18+ messages in thread
From: Jeff Kirsher @ 2014-06-06  9:04 UTC (permalink / raw)
  To: davem; +Cc: Jesse Brandeburg, netdev, gospo, sassmann, Jeff Kirsher

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

The i40e driver should print link messages like all the
other Intel Ethernet drivers.

Change-ID: Ia88bdb96794e17a3962fcea94db176de01f921f7
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 56 ++++++++++++++++++++++++++---
 1 file changed, 51 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index e9cd9bb..484ada97 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -4135,6 +4135,54 @@ out:
 	return err;
 }
 #endif /* CONFIG_I40E_DCB */
+#define SPEED_SIZE 14
+#define FC_SIZE 8
+/**
+ * i40e_print_link_message - print link up or down
+ * @vsi: the VSI for which link needs a message
+ */
+static void i40e_print_link_message(struct i40e_vsi *vsi, bool isup)
+{
+	char speed[SPEED_SIZE] = "Unknown";
+	char fc[FC_SIZE] = "RX/TX";
+
+	if (!isup) {
+		netdev_info(vsi->netdev, "NIC Link is Down\n");
+		return;
+	}
+
+	switch (vsi->back->hw.phy.link_info.link_speed) {
+	case I40E_LINK_SPEED_40GB:
+		strncpy(speed, "40 Gbps", SPEED_SIZE);
+		break;
+	case I40E_LINK_SPEED_10GB:
+		strncpy(speed, "10 Gbps", SPEED_SIZE);
+		break;
+	case I40E_LINK_SPEED_1GB:
+		strncpy(speed, "1000 Mbps", SPEED_SIZE);
+		break;
+	default:
+		break;
+	}
+
+	switch (vsi->back->hw.fc.current_mode) {
+	case I40E_FC_FULL:
+		strncpy(fc, "RX/TX", FC_SIZE);
+		break;
+	case I40E_FC_TX_PAUSE:
+		strncpy(fc, "TX", FC_SIZE);
+		break;
+	case I40E_FC_RX_PAUSE:
+		strncpy(fc, "RX", FC_SIZE);
+		break;
+	default:
+		strncpy(fc, "None", FC_SIZE);
+		break;
+	}
+
+	netdev_info(vsi->netdev, "NIC Link is Up %s Full Duplex, Flow Control: %s\n",
+		    speed, fc);
+}
 
 /**
  * i40e_up_complete - Finish the last steps of bringing up a connection
@@ -4161,11 +4209,11 @@ static int i40e_up_complete(struct i40e_vsi *vsi)
 
 	if ((pf->hw.phy.link_info.link_info & I40E_AQ_LINK_UP) &&
 	    (vsi->netdev)) {
-		netdev_info(vsi->netdev, "NIC Link is Up\n");
+		i40e_print_link_message(vsi, true);
 		netif_tx_start_all_queues(vsi->netdev);
 		netif_carrier_on(vsi->netdev);
 	} else if (vsi->netdev) {
-		netdev_info(vsi->netdev, "NIC Link is Down\n");
+		i40e_print_link_message(vsi, false);
 	}
 
 	/* replay FDIR SB filters */
@@ -4886,10 +4934,8 @@ static void i40e_link_event(struct i40e_pf *pf)
 
 	if (new_link == old_link)
 		return;
-
 	if (!test_bit(__I40E_DOWN, &pf->vsi[pf->lan_vsi]->state))
-		netdev_info(pf->vsi[pf->lan_vsi]->netdev,
-			    "NIC Link is %s\n", (new_link ? "Up" : "Down"));
+		i40e_print_link_message(pf->vsi[pf->lan_vsi], new_link);
 
 	/* Notify the base of the switch tree connected to
 	 * the link.  Floating VEBs are not notified.
-- 
1.9.3

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

* [net-next 11/13] i40e: don't remove HMC that doesn't exist
  2014-06-06  9:04 [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 Jeff Kirsher
                   ` (9 preceding siblings ...)
  2014-06-06  9:04 ` [net-next 10/13] i40e: print full link message Jeff Kirsher
@ 2014-06-06  9:04 ` Jeff Kirsher
  2014-06-06  9:04 ` [net-next 12/13] i40e: remove irqs only when they are set up Jeff Kirsher
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Jeff Kirsher @ 2014-06-06  9:04 UTC (permalink / raw)
  To: davem; +Cc: Shannon Nelson, netdev, gospo, sassmann, Jeff Kirsher

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

If a reset recovery failed (e.g. firmware is broken), the HMC space won't
get set up.  We don't need to try to delete it if it didn't get set up.
This stops some needless error messages when we already know we need to
just tear things down.

Change-ID: Iac600481765e20b136052b43a544e55d7870268b
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 484ada97..52bd69d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5429,7 +5429,7 @@ static void i40e_fdir_teardown(struct i40e_pf *pf)
 static int i40e_prep_for_reset(struct i40e_pf *pf)
 {
 	struct i40e_hw *hw = &pf->hw;
-	i40e_status ret;
+	i40e_status ret = 0;
 	u32 v;
 
 	clear_bit(__I40E_RESET_INTR_RECEIVED, &pf->state);
@@ -5449,10 +5449,13 @@ static int i40e_prep_for_reset(struct i40e_pf *pf)
 	i40e_shutdown_adminq(&pf->hw);
 
 	/* call shutdown HMC */
-	ret = i40e_shutdown_lan_hmc(hw);
-	if (ret) {
-		dev_info(&pf->pdev->dev, "shutdown_lan_hmc failed: %d\n", ret);
-		clear_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state);
+	if (hw->hmc.hmc_obj) {
+		ret = i40e_shutdown_lan_hmc(hw);
+		if (ret) {
+			dev_warn(&pf->pdev->dev,
+				 "shutdown_lan_hmc failed: %d\n", ret);
+			clear_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state);
+		}
 	}
 	return ret;
 }
@@ -8637,10 +8640,13 @@ static void i40e_remove(struct pci_dev *pdev)
 	}
 
 	/* shutdown and destroy the HMC */
-	ret_code = i40e_shutdown_lan_hmc(&pf->hw);
-	if (ret_code)
-		dev_warn(&pdev->dev,
-			 "Failed to destroy the HMC resources: %d\n", ret_code);
+	if (pf->hw.hmc.hmc_obj) {
+		ret_code = i40e_shutdown_lan_hmc(&pf->hw);
+		if (ret_code)
+			dev_warn(&pdev->dev,
+				 "Failed to destroy the HMC resources: %d\n",
+				 ret_code);
+	}
 
 	/* shutdown the adminq */
 	ret_code = i40e_shutdown_adminq(&pf->hw);
-- 
1.9.3

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

* [net-next 12/13] i40e: remove irqs only when they are set up
  2014-06-06  9:04 [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 Jeff Kirsher
                   ` (10 preceding siblings ...)
  2014-06-06  9:04 ` [net-next 11/13] i40e: don't remove HMC that doesn't exist Jeff Kirsher
@ 2014-06-06  9:04 ` Jeff Kirsher
  2014-06-06  9:04 ` [net-next 13/13] i40e/i40evf: Bump build version Jeff Kirsher
  2014-06-06 20:04 ` [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 David Miller
  13 siblings, 0 replies; 18+ messages in thread
From: Jeff Kirsher @ 2014-06-06  9:04 UTC (permalink / raw)
  To: davem; +Cc: Shannon Nelson, netdev, gospo, sassmann, Jeff Kirsher

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

Use an extra state variable to keep track of when the IRQs are fully
set up.  This keeps us from trying to unhook IRQs that already were
left unhooked in a failed reset recovery, e.g. when firmware is broken.

Change-ID: I073eb081e4ef8aedcbdf1ee0717c0ed64fa172f2
Signed-off-by: Shannon Nelson <shannon.nelson@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 | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 581898f..9c27d8b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -414,6 +414,7 @@ struct i40e_vsi {
 	struct i40e_q_vector **q_vectors;
 	int num_q_vectors;
 	int base_vector;
+	bool irqs_ready;
 
 	u16 seid;            /* HW index of this VSI (absolute index) */
 	u16 id;              /* VSI number */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 52bd69d..029288e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -2790,6 +2790,7 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename)
 				      &q_vector->affinity_mask);
 	}
 
+	vsi->irqs_ready = true;
 	return 0;
 
 free_queue_irqs:
@@ -3349,6 +3350,10 @@ static void i40e_vsi_free_irq(struct i40e_vsi *vsi)
 		if (!vsi->q_vectors)
 			return;
 
+		if (!vsi->irqs_ready)
+			return;
+
+		vsi->irqs_ready = false;
 		for (i = 0; i < vsi->num_q_vectors; i++) {
 			u16 vector = i + base;
 
@@ -5953,6 +5958,7 @@ static int i40e_vsi_mem_alloc(struct i40e_pf *pf, enum i40e_vsi_type type)
 	vsi->netdev_registered = false;
 	vsi->work_limit = I40E_DEFAULT_IRQ_WORK;
 	INIT_LIST_HEAD(&vsi->mac_filter_list);
+	vsi->irqs_ready = false;
 
 	ret = i40e_set_num_rings_in_vsi(vsi);
 	if (ret)
-- 
1.9.3

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

* [net-next 13/13] i40e/i40evf: Bump build version
  2014-06-06  9:04 [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 Jeff Kirsher
                   ` (11 preceding siblings ...)
  2014-06-06  9:04 ` [net-next 12/13] i40e: remove irqs only when they are set up Jeff Kirsher
@ 2014-06-06  9:04 ` Jeff Kirsher
  2014-06-06 20:04 ` [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 David Miller
  13 siblings, 0 replies; 18+ messages in thread
From: Jeff Kirsher @ 2014-06-06  9:04 UTC (permalink / raw)
  To: davem; +Cc: Catherine Sullivan, netdev, gospo, sassmann, Jeff Kirsher

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

Bump i40e to 0.4.3 and i40evf to 0.9.27.

Change-ID: I4141e9f8615bdcfa3b1b5ecbc2ac62603a03b7ad
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 4 ++--
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +-
 2 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 029288e..63147a6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -38,8 +38,8 @@ static const char i40e_driver_string[] =
 #define DRV_KERN "-k"
 
 #define DRV_VERSION_MAJOR 0
-#define DRV_VERSION_MINOR 3
-#define DRV_VERSION_BUILD 46
+#define DRV_VERSION_MINOR 4
+#define DRV_VERSION_BUILD 3
 #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 f6a2bdc..feff317 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 "0.9.23"
+#define DRV_VERSION "0.9.27"
 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] 18+ messages in thread

* Re: [net-next 04/13] i40evf: make messages less dire
  2014-06-06  9:04 ` [net-next 04/13] i40evf: make messages less dire Jeff Kirsher
@ 2014-06-06 12:19   ` Joe Perches
  2014-06-06 17:23     ` Williams, Mitch A
  0 siblings, 1 reply; 18+ messages in thread
From: Joe Perches @ 2014-06-06 12:19 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: davem, Mitch Williams, netdev, gospo, sassmann

On Fri, 2014-06-06 at 02:04 -0700, Jeff Kirsher wrote:
> Depending on the timing of what the PF driver is doing, it make take a
> few tries before the VF driver is able to communicate with the PF driver
> on init or reset recovery. In order to prevent confusion, make the most
> common messages less scary by lowering them to a less terrifying log
> level and indicate that the driver will retry.
[]
> diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
[]
> @@ -1963,7 +1963,7 @@ static void i40evf_init_task(struct work_struct *work)
>  		}
>  		err = i40evf_check_reset_complete(hw);
>  		if (err) {
> -			dev_err(&pdev->dev, "Device is still in reset (%d)\n",
> +			dev_info(&pdev->dev, "Device is still in reset (%d), retrying\n",
>  				err);
>  			goto err;
>  		}
> @@ -1996,7 +1996,7 @@ static void i40evf_init_task(struct work_struct *work)
>  		/* aq msg sent, awaiting reply */
>  		err = i40evf_verify_api_ver(adapter);
>  		if (err) {
> -			dev_err(&pdev->dev, "Unable to verify API version (%d)\n",
> +			dev_info(&pdev->dev, "Unable to verify API version (%d), retrying\n",
>  				err);
>  			goto err;
>  		}

trivia:

It'd be nicer to reindent the multi-line statements.

CHECK: Alignment should match open parenthesis
#73: FILE: drivers/net/ethernet/intel/i40evf/i40evf_main.c:1967:
+			dev_info(&pdev->dev, "Device is still in reset (%d), retrying\n",
 				err);

CHECK: Alignment should match open parenthesis
#82: FILE: drivers/net/ethernet/intel/i40evf/i40evf_main.c:2000:
+			dev_info(&pdev->dev, "Unable to verify API version (%d), retrying\n",
 				err);

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

* Re: [net-next 10/13] i40e: print full link message
  2014-06-06  9:04 ` [net-next 10/13] i40e: print full link message Jeff Kirsher
@ 2014-06-06 12:23   ` Joe Perches
  0 siblings, 0 replies; 18+ messages in thread
From: Joe Perches @ 2014-06-06 12:23 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: davem, Jesse Brandeburg, netdev, gospo, sassmann

On Fri, 2014-06-06 at 02:04 -0700, Jeff Kirsher wrote:
> The i40e driver should print link messages like all the
> other Intel Ethernet drivers.
[]
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
[]
> @@ -4135,6 +4135,54 @@ out:
>  	return err;
>  }
>  #endif /* CONFIG_I40E_DCB */
> +#define SPEED_SIZE 14
> +#define FC_SIZE 8
> +/**
> + * i40e_print_link_message - print link up or down
> + * @vsi: the VSI for which link needs a message
> + */
> +static void i40e_print_link_message(struct i40e_vsi *vsi, bool isup)
> +{
> +	char speed[SPEED_SIZE] = "Unknown";
> +	char fc[FC_SIZE] = "RX/TX";

It'd be better to use const char *,
smaller code, no unnecessary strncpys.

> +
> +	if (!isup) {
> +		netdev_info(vsi->netdev, "NIC Link is Down\n");
> +		return;
> +	}
> +
> +	switch (vsi->back->hw.phy.link_info.link_speed) {
> +	case I40E_LINK_SPEED_40GB:
> +		strncpy(speed, "40 Gbps", SPEED_SIZE);
> +		break;
> +	case I40E_LINK_SPEED_10GB:
> +		strncpy(speed, "10 Gbps", SPEED_SIZE);
> +		break;
> +	case I40E_LINK_SPEED_1GB:
> +		strncpy(speed, "1000 Mbps", SPEED_SIZE);
> +		break;
> +	default:
> +		break;
> +	}
> +
> +	switch (vsi->back->hw.fc.current_mode) {
> +	case I40E_FC_FULL:
> +		strncpy(fc, "RX/TX", FC_SIZE);
> +		break;
> +	case I40E_FC_TX_PAUSE:
> +		strncpy(fc, "TX", FC_SIZE);
> +		break;
> +	case I40E_FC_RX_PAUSE:
> +		strncpy(fc, "RX", FC_SIZE);
> +		break;
> +	default:
> +		strncpy(fc, "None", FC_SIZE);
> +		break;
> +	}
> +
> +	netdev_info(vsi->netdev, "NIC Link is Up %s Full Duplex, Flow Control: %s\n",
> +		    speed, fc);
> +}

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

* RE: [net-next 04/13] i40evf: make messages less dire
  2014-06-06 12:19   ` Joe Perches
@ 2014-06-06 17:23     ` Williams, Mitch A
  0 siblings, 0 replies; 18+ messages in thread
From: Williams, Mitch A @ 2014-06-06 17:23 UTC (permalink / raw)
  To: Joe Perches, Kirsher, Jeffrey T
  Cc: davem@davemloft.net, netdev@vger.kernel.org, gospo@redhat.com,
	sassmann@redhat.com



> -----Original Message-----
> From: Joe Perches [mailto:joe@perches.com]
> Sent: Friday, June 06, 2014 5:19 AM
> To: Kirsher, Jeffrey T
> Cc: davem@davemloft.net; Williams, Mitch A; netdev@vger.kernel.org;
> gospo@redhat.com; sassmann@redhat.com
> Subject: Re: [net-next 04/13] i40evf: make messages less dire
> 
> On Fri, 2014-06-06 at 02:04 -0700, Jeff Kirsher wrote:
> > Depending on the timing of what the PF driver is doing, it make take a
> > few tries before the VF driver is able to communicate with the PF driver
> > on init or reset recovery. In order to prevent confusion, make the most
> > common messages less scary by lowering them to a less terrifying log
> > level and indicate that the driver will retry.
> []
> > diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
> b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
> []
> > @@ -1963,7 +1963,7 @@ static void i40evf_init_task(struct work_struct
> *work)
> >  		}
> >  		err = i40evf_check_reset_complete(hw);
> >  		if (err) {
> > -			dev_err(&pdev->dev, "Device is still in reset (%d)\n",
> > +			dev_info(&pdev->dev, "Device is still in reset (%d),
> retrying\n",
> >  				err);
> >  			goto err;
> >  		}
> > @@ -1996,7 +1996,7 @@ static void i40evf_init_task(struct work_struct
> *work)
> >  		/* aq msg sent, awaiting reply */
> >  		err = i40evf_verify_api_ver(adapter);
> >  		if (err) {
> > -			dev_err(&pdev->dev, "Unable to verify API version (%d)\n",
> > +			dev_info(&pdev->dev, "Unable to verify API version (%d),
> retrying\n",
> >  				err);
> >  			goto err;
> >  		}
> 
> trivia:
> 
> It'd be nicer to reindent the multi-line statements.
> 
> CHECK: Alignment should match open parenthesis
> #73: FILE: drivers/net/ethernet/intel/i40evf/i40evf_main.c:1967:
> +			dev_info(&pdev->dev, "Device is still in reset (%d),
> retrying\n",
>  				err);
> 
> CHECK: Alignment should match open parenthesis
> #82: FILE: drivers/net/ethernet/intel/i40evf/i40evf_main.c:2000:
> +			dev_info(&pdev->dev, "Unable to verify API version (%d),
> retrying\n",
>  				err);
> 

Thanks, Joe. Thought I had those correct, but obviously I'm one character off here.

Now that checkpatch has been switch to pedantic mode, I think what I'll do is (once I get everything else working) run the entire driver through checkpatch and send out a single patch that fixes all of the formatting niggles.

-Mitch

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

* Re: [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06
  2014-06-06  9:04 [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 Jeff Kirsher
                   ` (12 preceding siblings ...)
  2014-06-06  9:04 ` [net-next 13/13] i40e/i40evf: Bump build version Jeff Kirsher
@ 2014-06-06 20:04 ` David Miller
  13 siblings, 0 replies; 18+ messages in thread
From: David Miller @ 2014-06-06 20:04 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri,  6 Jun 2014 02:04:09 -0700

> This series contains updates to i40e and i40evf.

Pulled, thanks Jeff.

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

end of thread, other threads:[~2014-06-06 20:04 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-06  9:04 [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 Jeff Kirsher
2014-06-06  9:04 ` [net-next 01/13] i40e: set lan_veb index Jeff Kirsher
2014-06-06  9:04 ` [net-next 02/13] i40e: add VEB stats to ethtool Jeff Kirsher
2014-06-06  9:04 ` [net-next 03/13] i40e: print message for pre-production hardware Jeff Kirsher
2014-06-06  9:04 ` [net-next 04/13] i40evf: make messages less dire Jeff Kirsher
2014-06-06 12:19   ` Joe Perches
2014-06-06 17:23     ` Williams, Mitch A
2014-06-06  9:04 ` [net-next 05/13] i40e/i40evf: check AQ register for valid data Jeff Kirsher
2014-06-06  9:04 ` [net-next 06/13] i40e/i40evf: add Tx pre queue disable function Jeff Kirsher
2014-06-06  9:04 ` [net-next 07/13] i40e: increase reset wait time Jeff Kirsher
2014-06-06  9:04 ` [net-next 08/13] i40e: add vsi x-cast stats Jeff Kirsher
2014-06-06  9:04 ` [net-next 09/13] i40e: add xcast stats for port Jeff Kirsher
2014-06-06  9:04 ` [net-next 10/13] i40e: print full link message Jeff Kirsher
2014-06-06 12:23   ` Joe Perches
2014-06-06  9:04 ` [net-next 11/13] i40e: don't remove HMC that doesn't exist Jeff Kirsher
2014-06-06  9:04 ` [net-next 12/13] i40e: remove irqs only when they are set up Jeff Kirsher
2014-06-06  9:04 ` [net-next 13/13] i40e/i40evf: Bump build version Jeff Kirsher
2014-06-06 20:04 ` [net-next 00/13][pull request] Intel Wired LAN Driver Updates 2014-06-06 David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).