Skip to contentSkip to conversation

i40e/i40evf updates

PATCH New Catherine Sullivan 2 participants 31 messages Aug 26, 2015 – Sep 11, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover i40e/i40evf updates

Carolyn fixes an interrupt name that was truncated.

Catherine adds a check that will not allow speed get set to 0 in get_settings.

Jesse adds a little endian conversion for the checksum, and fixes up the return value for get_link_status.

Mitch Williams adds a patch to stop VF rings when SR-IOV is disabled.

Paul increases the amount of time we wait for a reset to complete.

Shannon enables WoL operation by default, adds driver support for a new device, fixes a potential type compare issue, fixes a CEE status shift value that was incorrect, changes i40e_init_pf_fcoe to a void return, zeros the clean asq status report to get rid of stale errors, removes some __func__ references, and fixes the unicast mac address add.

 drivers/net/ethernet/intel/i40e/i40e.h             |  5 +-
 drivers/net/ethernet/intel/i40e/i40e_adminq.c      |  2 +
 drivers/net/ethernet/intel/i40e/i40e_adminq.h      |  3 +-
 drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h  |  3 +-
 drivers/net/ethernet/intel/i40e/i40e_common.c      |  3 +-
 drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c      |  5 +-
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |  8 +++
 drivers/net/ethernet/intel/i40e/i40e_fcoe.c        | 10 ++--
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 65 +++++++++++-----------
 drivers/net/ethernet/intel/i40e/i40e_nvm.c         |  4 +-
 drivers/net/ethernet/intel/i40e/i40e_type.h        |  1 +
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |  5 ++
 drivers/net/ethernet/intel/i40evf/i40e_adminq.c    |  2 +
 drivers/net/ethernet/intel/i40evf/i40e_adminq.h    |  3 +-
 drivers/net/ethernet/intel/i40evf/i40e_common.c    |  1 +
 drivers/net/ethernet/intel/i40evf/i40e_type.h      |  1 +
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    |  2 +-
 17 files changed, 70 insertions(+), 53 deletions(-)
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/15 i40e: Increase the amount of time we wait for reset to be done

From: Paul M Stillwell Jr <[email protected]>

In some rare cases the reset can take longer to complete so increase the amount of time we wait.

Change-ID Ib5628ec54b526a811ee33d1214fe763226406671
---
 drivers/net/ethernet/intel/i40e/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_common.c +1 -1
index 6833717..1e81f4e 100644
@@ -1256,7 +1256,7 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw)
 	grst_del = (rd32(hw, I40E_GLGEN_RSTCTL) &
 		    I40E_GLGEN_RSTCTL_GRSTDEL_MASK) >>
 		    I40E_GLGEN_RSTCTL_GRSTDEL_SHIFT;
-	for (cnt = 0; cnt < grst_del + 2; cnt++) {
+	for (cnt = 0; cnt < grst_del + 10; cnt++) {
 		reg = rd32(hw, I40E_GLGEN_RSTAT);
 		if (!(reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK))
 			break;
Signature · 1 line
1.9.3
#2 lore raw

PATCH 1/15 i40e: Increase the amount of time we wait for reset to be done

Quoted 11 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Wednesday, August 26, 2015 12:14 PM
To: intel-wired-lan at lists.osuosl.org
Cc: Stillwell Jr, Paul M
Subject: [Intel-wired-lan] [next PATCH S11 01/15] i40e: Increase the amount of time we wait for reset to be done

From: Paul M Stillwell Jr <[email protected]>

Quoted 8 lines

In some rare cases the reset can take longer to complete so increase the amount of time we wait.

Change-ID Ib5628ec54b526a811ee33d1214fe763226406671
---
 drivers/net/ethernet/intel/i40e/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Code changes present in tree

#3 lore raw

PATCH 2/15 i40e: enable WoL operation if config bit show WoL capable

In reply to Catherine Sullivan

From: Shannon Nelson <[email protected]>

The driver was disabling Wake-on-LAN by default and waiting for the user to expressly turn it on. This patch has the driver turning on WoL from the start if enabled in the hardware config, which matches the behavior of our other drivers.

Change-ID I43faedb907f8ba4d1a61b72a7c86072b97af12b1
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +7 -2
index 7b41e1a..28ab759 100644
@@ -9876,6 +9876,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	struct i40e_pf *pf;
 	struct i40e_hw *hw;
 	static u16 pfs_found;
+	u16 wol_nvm_bits;
 	u16 link_status;
 	int err = 0;
 	u32 len;
@@ -10093,8 +10094,12 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	pf->flags |= I40E_FLAG_NEED_LINK_UPDATE;
 	pf->link_check_timeout = jiffies;
 
-	/* WoL defaults to disabled */
-	pf->wol_en = false;
+	/* NVM bit on means WoL disabled for the port */
+	i40e_read_nvm_word(hw, I40E_SR_NVM_WAKE_ON_LAN, &wol_nvm_bits);
+	if ((1 << hw->port) & wol_nvm_bits || hw->partition_id != 1)
+		pf->wol_en = false;
+	else
+		pf->wol_en = true;
 	device_set_wakeup_enable(&pf->pdev->dev, pf->wol_en);
 
 	/* set up the main switch operations */
Signature · 1 line
1.9.3
#4 lore raw

PATCH 2/15 i40e: enable WoL operation if config bit show WoL capable

Quoted 15 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Wednesday, August 26, 2015 12:14 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S11 02/15] i40e: enable WoL operation if config bit show WoL capable

From: Shannon Nelson <[email protected]>

The driver was disabling Wake-on-LAN by default and waiting for the user to expressly turn it on. This patch has the driver turning on WoL from the start if enabled in the hardware config, which matches the behavior of our other drivers.

Quoted 5 lines
Change-ID I43faedb907f8ba4d1a61b72a7c86072b97af12b1
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

WoL shows "g" in ethtool on initial setup, old driver showed "d" unless it was specifically enabled with ethtool. Code changes present in tree.

#5 lore raw

PATCH 3/15 i40e: stop VF rings

In reply to Catherine Sullivan

From: Mitch Williams <[email protected]>

Explicitly stop the rings belonging to each VF when disabling SR-IOV. Even though the VFs were gone, and the associated VSIs were removed, the rings were not stopped, and in some circumstances the hardware would continue to access the memory formerly used by the rings, causing memory corruption or DMAR errors, both of which would lead to general malaise of the kernel.

To relieve this condition, explicitly stop all the rings associated with each VF before releasing its resources.

Change-ID I78c05d562c66e7b594b7e48d67860f49b3e5b6ec
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +5 -0
index f60cd43..63fd6b7 100644
@@ -872,6 +872,11 @@ void i40e_free_vfs(struct i40e_pf *pf)
 			i40e_vsi_control_rings(pf->vsi[pf->vf[i].lan_vsi_idx],
 					       false);
 
+	for (i = 0; i < pf->num_alloc_vfs; i++)
+		if (test_bit(I40E_VF_STAT_INIT, &pf->vf[i].vf_states))
+			i40e_vsi_control_rings(pf->vsi[pf->vf[i].lan_vsi_idx],
+					       false);
+
 	/* Disable IOV before freeing resources. This lets any VF drivers
 	 * running in the host get themselves cleaned up before we yank
 	 * the carpet out from underneath their feet.
Signature · 1 line
1.9.3
#6 lore raw

PATCH 3/15 i40e: stop VF rings

Quoted 16 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Wednesday, August 26, 2015 12:14 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S11 03/15] i40e: stop VF rings

From: Mitch Williams <[email protected]>

Explicitly stop the rings belonging to each VF when disabling SR-IOV. Even though the VFs were gone, and the associated VSIs were removed, the rings were not stopped, and in some circumstances the hardware would continue to access the memory formerly used by the rings, causing memory corruption or DMAR errors, both of which would lead to general malaise of the kernel.

Quoted 8 lines

To relieve this condition, explicitly stop all the rings associated with each VF before releasing its resources.

Change-ID I78c05d562c66e7b594b7e48d67860f49b3e5b6ec
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 5 +++++
 1 file changed, 5 insertions(+)

Code changes present in tree, memory released when VFs are removed.

#7 lore raw

PATCH 4/15 i40e/i40evf: add driver support for new device ids

In reply to Catherine Sullivan

From: Shannon Nelson <[email protected]>

Early addition of new a device id.

Change-ID I61a8c8556fdf4f5714be4e4089689e374f30293c
---
 drivers/net/ethernet/intel/i40e/i40e_common.c   | 1 +
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c  | 1 +
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 1 +
 drivers/net/ethernet/intel/i40e/i40e_type.h     | 1 +
 drivers/net/ethernet/intel/i40evf/i40e_common.c | 1 +
 drivers/net/ethernet/intel/i40evf/i40e_type.h   | 1 +
 6 files changed, 6 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_common.c +1 -0
index 1e81f4e..7a70abc 100644
@@ -51,6 +51,7 @@ static i40e_status i40e_set_mac_type(struct i40e_hw *hw)
 		case I40E_DEV_ID_QSFP_B:
 		case I40E_DEV_ID_QSFP_C:
 		case I40E_DEV_ID_10G_BASE_T:
+		case I40E_DEV_ID_10G_BASE_T4:
 		case I40E_DEV_ID_20G_KR2:
 		case I40E_DEV_ID_20G_KR2_A:
 			hw->mac.type = I40E_MAC_XL710;
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +1 -0
index 1345de2..928bd5a 100644
@@ -425,6 +425,7 @@ static void i40e_get_settings_link_down(struct i40e_hw *hw,
 		ecmd->advertising = ADVERTISED_10000baseKR_Full;
 		break;
 	case I40E_DEV_ID_10G_BASE_T:
+	case I40E_DEV_ID_10G_BASE_T4:
 		ecmd->supported = SUPPORTED_10000baseT_Full |
 				  SUPPORTED_1000baseT_Full |
 				  SUPPORTED_100baseT_Full;
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -0
index 28ab759..bf181e9 100644
@@ -76,6 +76,7 @@ static const struct pci_device_id i40e_pci_tbl[] = {
 	{PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_B), 0},
 	{PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_C), 0},
 	{PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T), 0},
+	{PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T4), 0},
 	{PCI_VDEVICE(INTEL, I40E_DEV_ID_20G_KR2), 0},
 	{PCI_VDEVICE(INTEL, I40E_DEV_ID_SFP_X722), 0},
 	{PCI_VDEVICE(INTEL, I40E_DEV_ID_1G_BASE_T_X722), 0},
drivers/net/ethernet/intel/i40e/i40e_type.h +1 -0
index 91d0b9e..f45f372 100644
@@ -46,6 +46,7 @@
 #define I40E_DEV_ID_10G_BASE_T		0x1586
 #define I40E_DEV_ID_20G_KR2		0x1587
 #define I40E_DEV_ID_20G_KR2_A		0x1588
+#define I40E_DEV_ID_10G_BASE_T4		0x1589
 #define I40E_DEV_ID_VF			0x154C
 #define I40E_DEV_ID_VF_HV		0x1571
 #define I40E_DEV_ID_SFP_X722		0x37D0
drivers/net/ethernet/intel/i40evf/i40e_common.c +1 -0
index 1950db1..96e48ee 100644
@@ -51,6 +51,7 @@ i40e_status i40e_set_mac_type(struct i40e_hw *hw)
 		case I40E_DEV_ID_QSFP_B:
 		case I40E_DEV_ID_QSFP_C:
 		case I40E_DEV_ID_10G_BASE_T:
+		case I40E_DEV_ID_10G_BASE_T4:
 		case I40E_DEV_ID_20G_KR2:
 		case I40E_DEV_ID_20G_KR2_A:
 			hw->mac.type = I40E_MAC_XL710;
drivers/net/ethernet/intel/i40evf/i40e_type.h +1 -0
index ae9498c..43782ed 100644
@@ -46,6 +46,7 @@
 #define I40E_DEV_ID_10G_BASE_T		0x1586
 #define I40E_DEV_ID_20G_KR2		0x1587
 #define I40E_DEV_ID_20G_KR2_A		0x1588
+#define I40E_DEV_ID_10G_BASE_T4		0x1589
 #define I40E_DEV_ID_VF			0x154C
 #define I40E_DEV_ID_VF_HV		0x1571
 #define I40E_DEV_ID_SFP_X722		0x37D0
Signature · 1 line
1.9.3
#8 lore raw

PATCH 4/15 i40e/i40evf: add driver support for new device ids

Quoted 14 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Wednesday, August 26, 2015 12:14 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S11 04/15] i40e/i40evf: add driver support for new device ids

From: Shannon Nelson <[email protected]>

Early addition of new a device id.

Change-ID I61a8c8556fdf4f5714be4e4089689e374f30293c
Quoted 8 lines
---
 drivers/net/ethernet/intel/i40e/i40e_common.c   | 1 +
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c  | 1 +
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 1 +
 drivers/net/ethernet/intel/i40e/i40e_type.h     | 1 +
 drivers/net/ethernet/intel/i40evf/i40e_common.c | 1 +
 drivers/net/ethernet/intel/i40evf/i40e_type.h   | 1 +
 6 files changed, 6 insertions(+)

Code changes present in tree, modinfo shows additional device ID for i40e

#9 lore raw

PATCH 5/15 i40e/i40evf: fix a potential type compare issue

In reply to Catherine Sullivan

From: Shannon Nelson <[email protected]>

Rework an if expression to assure there is no type compare problem between a size and a possible negative number.

Change-ID I4921fcc96abfcf69490efce020a9e4007f251c99
---
 drivers/net/ethernet/intel/i40e/i40e_adminq.h   | 3 +--
 drivers/net/ethernet/intel/i40evf/i40e_adminq.h | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_adminq.h +1 -2
index 299e3d3..fa5c2cd 100644
@@ -143,8 +143,7 @@ static inline int i40e_aq_rc_to_posix(int aq_ret, int aq_rc)
 	if (aq_ret == I40E_ERR_ADMIN_QUEUE_TIMEOUT)
 		return -EAGAIN;
 
-	if (aq_rc >= (sizeof(aq_to_posix) / sizeof((aq_to_posix)[0])) ||
-	    aq_rc < 0)
+	if (!((u32)aq_rc < (sizeof(aq_to_posix) / sizeof((aq_to_posix)[0]))))
 		return -ERANGE;
 
 	return aq_to_posix[aq_rc];
drivers/net/ethernet/intel/i40evf/i40e_adminq.h +1 -2
index c4efa6b..81f9ffa 100644
@@ -143,8 +143,7 @@ static inline int i40e_aq_rc_to_posix(int aq_ret, int aq_rc)
 	if (aq_ret == I40E_ERR_ADMIN_QUEUE_TIMEOUT)
 		return -EAGAIN;
 
-	if (aq_rc >= (sizeof(aq_to_posix) / sizeof((aq_to_posix)[0])) ||
-	    aq_rc < 0)
+	if (!((u32)aq_rc < (sizeof(aq_to_posix) / sizeof((aq_to_posix)[0]))))
 		return -ERANGE;
 
 	return aq_to_posix[aq_rc];
Signature · 1 line
1.9.3
#10 lore raw

PATCH 5/15 i40e/i40evf: fix a potential type compare issue

Quoted 13 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Wednesday, August 26, 2015 12:14 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S11 05/15] i40e/i40evf: fix a potential type compare issue

From: Shannon Nelson <[email protected]>

Rework an if expression to assure there is no type compare problem between a size and a possible negative number.

Quoted 7 lines
Change-ID I4921fcc96abfcf69490efce020a9e4007f251c99
---
 drivers/net/ethernet/intel/i40e/i40e_adminq.h   | 3 +--
 drivers/net/ethernet/intel/i40evf/i40e_adminq.h | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

Code changes present in tree

#11 lore raw

PATCH 6/15 i40e: fix bad CEE status shift value

In reply to Catherine Sullivan

From: Shannon Nelson <[email protected]>

Fix a shift value that was wrong, ending up with a bad bitmask. Also add a blank line between two sets of #defines for better readability.

Change-ID I3e41fa2a2ab904d3a4e6cbf13972ab0036a10601
---
 drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +2 -1
index b840fab..785b3db 100644
@@ -2062,6 +2062,7 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start);
 #define I40E_AQC_CEE_APP_ISCSI_MASK	(0x7 << I40E_AQC_CEE_APP_ISCSI_SHIFT)
 #define I40E_AQC_CEE_APP_FIP_SHIFT	0x8
 #define I40E_AQC_CEE_APP_FIP_MASK	(0x7 << I40E_AQC_CEE_APP_FIP_SHIFT)
+
 #define I40E_AQC_CEE_PG_STATUS_SHIFT	0x0
 #define I40E_AQC_CEE_PG_STATUS_MASK	(0x7 << I40E_AQC_CEE_PG_STATUS_SHIFT)
 #define I40E_AQC_CEE_PFC_STATUS_SHIFT	0x3
@@ -2070,7 +2071,7 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start);
 #define I40E_AQC_CEE_APP_STATUS_MASK	(0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT)
 #define I40E_AQC_CEE_FCOE_STATUS_SHIFT	0x8
 #define I40E_AQC_CEE_FCOE_STATUS_MASK	(0x7 << I40E_AQC_CEE_FCOE_STATUS_SHIFT)
-#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT	0xA
+#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT	0xB
 #define I40E_AQC_CEE_ISCSI_STATUS_MASK	(0x7 << I40E_AQC_CEE_ISCSI_STATUS_SHIFT)
 #define I40E_AQC_CEE_FIP_STATUS_SHIFT	0x10
 #define I40E_AQC_CEE_FIP_STATUS_MASK	(0x7 << I40E_AQC_CEE_FIP_STATUS_SHIFT)
Signature · 1 line
1.9.3
#12 lore raw

PATCH 6/15 i40e: fix bad CEE status shift value

Quoted 10 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Wednesday, August 26, 2015 12:14 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S11 06/15] i40e: fix bad CEE status shift value

From: Shannon Nelson <[email protected]>

Quoted 8 lines

Fix a shift value that was wrong, ending up with a bad bitmask. Also add a blank line between two sets of #defines for better readability.

Change-ID I3e41fa2a2ab904d3a4e6cbf13972ab0036a10601
---
 drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Code changes present in tree

#13 lore raw

PATCH 7/15 i40e: make i40e_init_pf_fcoe to void

In reply to Catherine Sullivan

From: Shannon Nelson <[email protected]>

i40e_init_pf_fcoe() didn't return anything except 0, it prints enough error info already, and no driver logic depends on the return value, so this can be void.

Change-ID Ie6afad849857d87a7064c42c3cce14c74c2f29d8
---
 drivers/net/ethernet/intel/i40e/i40e.h      |  2 +-
 drivers/net/ethernet/intel/i40e/i40e_fcoe.c | 10 ++++------
 drivers/net/ethernet/intel/i40e/i40e_main.c |  8 ++------
 3 files changed, 7 insertions(+), 13 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +1 -1
index 12c96da..5e546f9 100644
@@ -742,7 +742,7 @@ int i40e_fcoe_vsi_init(struct i40e_vsi *vsi, struct i40e_vsi_context *ctxt);
 u8 i40e_get_fcoe_tc_map(struct i40e_pf *pf);
 void i40e_fcoe_config_netdev(struct net_device *netdev, struct i40e_vsi *vsi);
 void i40e_fcoe_vsi_setup(struct i40e_pf *pf);
-int i40e_init_pf_fcoe(struct i40e_pf *pf);
+void i40e_init_pf_fcoe(struct i40e_pf *pf);
 int i40e_fcoe_setup_ddp_resources(struct i40e_vsi *vsi);
 void i40e_fcoe_free_ddp_resources(struct i40e_vsi *vsi);
 int i40e_fcoe_handle_offload(struct i40e_ring *rx_ring,
drivers/net/ethernet/intel/i40e/i40e_fcoe.c +4 -6
index 5ea75dd..2398d9b 100644
@@ -272,10 +272,8 @@ out:
 /**
  * i40e_fcoe_sw_init - sets up the HW for FCoE
  * @pf: pointer to PF
- *
- * Returns 0 if FCoE is supported otherwise the error code
  **/
-int i40e_init_pf_fcoe(struct i40e_pf *pf)
+void i40e_init_pf_fcoe(struct i40e_pf *pf)
 {
 	struct i40e_hw *hw = &pf->hw;
 	u32 val;
@@ -287,13 +285,13 @@ int i40e_init_pf_fcoe(struct i40e_pf *pf)
 
 	if (!pf->hw.func_caps.fcoe) {
 		dev_info(&pf->pdev->dev, "FCoE capability is disabled\n");
-		return 0;
+		return;
 	}
 
 	if (!pf->hw.func_caps.dcb) {
 		dev_warn(&pf->pdev->dev,
 			 "Hardware is not DCB capable not enabling FCoE.\n");
-		return 0;
+		return;
 	}
 
 	/* enable FCoE hash filter */
@@ -326,7 +324,7 @@ int i40e_init_pf_fcoe(struct i40e_pf *pf)
 	wr32(hw, I40E_GLFCOE_RCTL, val);
 
 	dev_info(&pf->pdev->dev, "FCoE is supported.\n");
-	return 0;
+	return;
 }
 
 /**
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -6
index bf181e9..f7da41b 100644
@@ -6426,9 +6426,7 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
 	}
 #endif /* CONFIG_I40E_DCB */
 #ifdef I40E_FCOE
-	ret = i40e_init_pf_fcoe(pf);
-	if (ret)
-		dev_info(&pf->pdev->dev, "init_pf_fcoe failed: %d\n", ret);
+	i40e_init_pf_fcoe(pf);
 
 #endif
 	/* do basic switch setup */
@@ -7824,9 +7822,7 @@ static int i40e_sw_init(struct i40e_pf *pf)
 	}
 
 #ifdef I40E_FCOE
-	err = i40e_init_pf_fcoe(pf);
-	if (err)
-		dev_info(&pf->pdev->dev, "init_pf_fcoe failed: %d\n", err);
+	i40e_init_pf_fcoe(pf);
 
 #endif /* I40E_FCOE */
 #ifdef CONFIG_PCI_IOV
Signature · 1 line
1.9.3
#14 lore raw

PATCH 7/15 i40e: make i40e_init_pf_fcoe to void

Quoted 14 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Wednesday, August 26, 2015 12:14 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S11 07/15] i40e: make i40e_init_pf_fcoe to void

From: Shannon Nelson <[email protected]>

i40e_init_pf_fcoe() didn't return anything except 0, it prints enough error info already, and no driver logic depends on the return value, so this can be void.

Quoted 7 lines
Change-ID Ie6afad849857d87a7064c42c3cce14c74c2f29d8
---
 drivers/net/ethernet/intel/i40e/i40e.h      |  2 +-
 drivers/net/ethernet/intel/i40e/i40e_fcoe.c | 10 ++++------
drivers/net/ethernet/intel/i40e/i40e_main.c |  8 ++------
 3 files changed, 7 insertions(+), 13 deletions(-)

Code changes present in tree

#15 lore raw

PATCH 8/15 i40e/i40evf: assure clean asq status report

In reply to Catherine Sullivan

From: Shannon Nelson <[email protected]>

There was a possibility where the asq_last_status could get through without update and thus report a previous error. I don't think we've actually seen this happen, but this patch will help make sure it doesn't.

Change-ID I9e33927052a5ee6ea21f80b66d4c4b76c2760b17
---
 drivers/net/ethernet/intel/i40e/i40e_adminq.c   | 2 ++
 drivers/net/ethernet/intel/i40evf/i40e_adminq.c | 2 ++
 2 files changed, 4 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_adminq.c +2 -0
index 3e0d200..f5692e1 100644
@@ -742,6 +742,8 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
 	u16  retval = 0;
 	u32  val = 0;
 
+	hw->aq.asq_last_status = I40E_AQ_RC_OK;
+
 	val = rd32(hw, hw->aq.asq.head);
 	if (val >= hw->aq.num_asq_entries) {
 		i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
drivers/net/ethernet/intel/i40evf/i40e_adminq.c +2 -0
index f08450b..21ce9a1 100644
@@ -682,6 +682,8 @@ i40e_status i40evf_asq_send_command(struct i40e_hw *hw,
 	u16  retval = 0;
 	u32  val = 0;
 
+	hw->aq.asq_last_status = I40E_AQ_RC_OK;
+
 	val = rd32(hw, hw->aq.asq.head);
 	if (val >= hw->aq.num_asq_entries) {
 		i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
Signature · 1 line
1.9.3
#16 lore raw

PATCH 8/15 i40e/i40evf: assure clean asq status report

Quoted 15 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Wednesday, August 26, 2015 12:14 PM
To: intel-wired-lan at lists.osuosl.org
Cc: Pau, Christopher
Subject: [Intel-wired-lan] [next PATCH S11 08/15] i40e/i40evf: assure clean asq status report

From: Shannon Nelson <[email protected]>

There was a possibility where the asq_last_status could get through without update and thus report a previous error. I don't think we've actually seen this happen, but this patch will help make sure it doesn't.

Quoted 7 lines
Change-ID I9e33927052a5ee6ea21f80b66d4c4b76c2760b17
---
 drivers/net/ethernet/intel/i40e/i40e_adminq.c   | 2 ++
 drivers/net/ethernet/intel/i40evf/i40e_adminq.c | 2 ++
 2 files changed, 4 insertions(+)

Code changes present in tree

#17 lore raw

PATCH 9/15 i40e: Fix for truncated interrupt name

In reply to Catherine Sullivan

From: Carolyn Wyborny <[email protected]>

This patch extends the size of the text available for the interrupt names. Without this patch, all the descriptive data available for the Flow Director interrupts is truncated.

Change-ID I2ac458f23ac3b4ea8f1edf73edc283b1d3704c7f
---
 drivers/net/ethernet/intel/i40e/i40e.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e.h +1 -1
index 5e546f9..3d4f2e4 100644
@@ -97,7 +97,7 @@
 #define I40E_MAX_USER_PRIORITY        8
 #define I40E_DEFAULT_MSG_ENABLE       4
 #define I40E_QUEUE_WAIT_RETRY_LIMIT   10
-#define I40E_INT_NAME_STR_LEN        (IFNAMSIZ + 9)
+#define I40E_INT_NAME_STR_LEN        (IFNAMSIZ + 16)
 
 /* Ethtool Private Flags */
 #define I40E_PRIV_FLAGS_NPAR_FLAG	BIT(0)
Signature · 1 line
1.9.3
#18 lore raw

PATCH 9/15 i40e: Fix for truncated interrupt name

Quoted 14 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Wednesday, August 26, 2015 12:14 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S11 09/15] i40e: Fix for truncated interrupt name

From: Carolyn Wyborny <[email protected]>

This patch extends the size of the text available for the interrupt names. Without this patch, all the descriptive data available for the Flow Director interrupts is truncated.

Quoted 5 lines
Change-ID I2ac458f23ac3b4ea8f1edf73edc283b1d3704c7f
---
 drivers/net/ethernet/intel/i40e/i40e.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

code changes present in tree, "cat /proc/interrupts" shows untruncated interrupt names for i40e.

#19 lore raw

PATCH 10/15 i40e: Never let speed get set to 0 in get_settings

In reply to Catherine Sullivan

In ethtool, there is a possibility of speed getting set to 0 if advertise is set to 0 (which it is when autoneg is disabled). We never want this to happen as the firmware will actually attempt to set the speed to 0 sending link down, so add an extra check to make sure this doesn't happen.

Change-ID I62e0eeee2cbf043d8e6f5c9c9f0b92794e877f01
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +7 -0
index 928bd5a..930369c 100644
@@ -666,6 +666,13 @@ static int i40e_set_settings(struct net_device *netdev,
 	    advertise & ADVERTISED_40000baseLR4_Full)
 		config.link_speed |= I40E_LINK_SPEED_40GB;
 
+	/* If speed didn't get set, set it to what it currently is.
+	 * This is needed because if advertise is 0 (as it is when autoneg
+	 * is disabled) then speed won't get set.
+	 */
+	if (!config.link_speed)
+		config.link_speed = abilities.link_speed;
+
 	if (change || (abilities.link_speed != config.link_speed)) {
 		/* copy over the rest of the abilities */
 		config.phy_type = abilities.phy_type;
Signature · 1 line
1.9.3
#20 lore raw

PATCH 10/15 i40e: Never let speed get set to 0 in get_settings

Quoted 14 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Wednesday, August 26, 2015 12:14 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S11 10/15] i40e: Never let speed get set to 0 in get_settings

In ethtool, there is a possibility of speed getting set to 0 if advertise is set to 0 (which it is when autoneg is disabled).
We never want this to happen as the firmware will actually attempt to set the speed to 0 sending link down, so add an extra check to make sure this doesn't happen.

Quoted 5 lines
Change-ID I62e0eeee2cbf043d8e6f5c9c9f0b92794e877f01
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 7 +++++++
 1 file changed, 7 insertions(+)

Code changes present in tree, speed does not get set to 0 with autoneg off (shows proper speed)

#21 lore raw

PATCH 11/15 i40e/i40evf: give up the __func__

In reply to Catherine Sullivan

From: Shannon Nelson <[email protected]>

During early development, we added the function name to all of the error strings to make debugging simpler. Now that we've released the driver, our users should have more comprehensible error messages. So tear the roof off and give up the __func__. Ow.

Change-ID I7e1766252c7a032b9af6520da6aff536bdfd533c
---
 drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c      |  5 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 40 ++++++---------
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    |  9 ++--
 .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    | 59 ++++++++++------------
 4 files changed, 47 insertions(+), 66 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c +2 -3
index 1c51f73..dbadad7 100644
@@ -240,9 +240,8 @@ static void i40e_dcbnl_del_app(struct i40e_pf *pf,
 		if (pf->vsi[v] && pf->vsi[v]->netdev) {
 			err = i40e_dcbnl_vsi_del_app(pf->vsi[v], app);
 			if (err)
-				dev_info(&pf->pdev->dev, "%s: Failed deleting app for VSI seid=%d err=%d sel=%d proto=0x%x prio=%d\n",
-					 __func__, pf->vsi[v]->seid,
-					 err, app->selector,
+				dev_info(&pf->pdev->dev, "Failed deleting app for VSI seid=%d err=%d sel=%d proto=0x%x prio=%d\n",
+					 pf->vsi[v]->seid, err, app->selector,
 					 app->protocolid, app->priority);
 		}
 	}
drivers/net/ethernet/intel/i40e/i40e_main.c +15 -25
index f7da41b..6af199a 100644
@@ -3049,8 +3049,7 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename)
 				  q_vector);
 		if (err) {
 			dev_info(&pf->pdev->dev,
-				 "%s: request_irq failed, error: %d\n",
-				 __func__, err);
+				 "MSIX request_irq failed, error: %d\n", err);
 			goto free_queue_irqs;
 		}
 		/* assign the mask for this irq */
@@ -3574,9 +3573,8 @@ static int i40e_vsi_control_tx(struct i40e_vsi *vsi, bool enable)
 		ret = i40e_pf_txq_wait(pf, pf_q, enable);
 		if (ret) {
 			dev_info(&pf->pdev->dev,
-				 "%s: VSI seid %d Tx ring %d %sable timeout\n",
-				 __func__, vsi->seid, pf_q,
-				 (enable ? "en" : "dis"));
+				 "VSI seid %d Tx ring %d %sable timeout\n",
+				 vsi->seid, pf_q, (enable ? "en" : "dis"));
 			break;
 		}
 	}
@@ -3652,9 +3650,8 @@ static int i40e_vsi_control_rx(struct i40e_vsi *vsi, bool enable)
 		ret = i40e_pf_rxq_wait(pf, pf_q, enable);
 		if (ret) {
 			dev_info(&pf->pdev->dev,
-				 "%s: VSI seid %d Rx ring %d %sable timeout\n",
-				 __func__, vsi->seid, pf_q,
-				 (enable ? "en" : "dis"));
+				 "VSI seid %d Rx ring %d %sable timeout\n",
+				 vsi->seid, pf_q, (enable ? "en" : "dis"));
 			break;
 		}
 	}
@@ -3948,8 +3945,7 @@ static void i40e_quiesce_vsi(struct i40e_vsi *vsi)
 	if ((test_bit(__I40E_PORT_TX_SUSPENDED, &vsi->back->state)) &&
 	    vsi->type == I40E_VSI_FCOE) {
 		dev_dbg(&vsi->back->pdev->dev,
-			"%s: VSI seid %d skipping FCoE VSI disable\n",
-			 __func__, vsi->seid);
+			 "VSI seid %d skipping FCoE VSI disable\n", vsi->seid);
 		return;
 	}
 
@@ -4023,8 +4019,8 @@ static int i40e_vsi_wait_txq_disabled(struct i40e_vsi *vsi)
 		ret = i40e_pf_txq_wait(pf, pf_q, false);
 		if (ret) {
 			dev_info(&pf->pdev->dev,
-				 "%s: VSI seid %d Tx ring %d disable timeout\n",
-				 __func__, vsi->seid, pf_q);
+				 "VSI seid %d Tx ring %d disable timeout\n",
+				 vsi->seid, pf_q);
 			return ret;
 		}
 	}
@@ -5213,8 +5209,7 @@ bool i40e_dcb_need_reconfig(struct i40e_pf *pf,
 		dev_dbg(&pf->pdev->dev, "APP Table change detected.\n");
 	}
 
-	dev_dbg(&pf->pdev->dev, "%s: need_reconfig=%d\n", __func__,
-		need_reconfig);
+	dev_dbg(&pf->pdev->dev, "dcb need_reconfig=%d\n", need_reconfig);
 	return need_reconfig;
 }
 
@@ -5241,16 +5236,14 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,
 	/* Ignore if event is not for Nearest Bridge */
 	type = ((mib->type >> I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT)
 		& I40E_AQ_LLDP_BRIDGE_TYPE_MASK);
-	dev_dbg(&pf->pdev->dev,
-		"%s: LLDP event mib bridge type 0x%x\n", __func__, type);
+	dev_dbg(&pf->pdev->dev, "LLDP event mib bridge type 0x%x\n", type);
 	if (type != I40E_AQ_LLDP_BRIDGE_TYPE_NEAREST_BRIDGE)
 		return ret;
 
 	/* Check MIB Type and return if event for Remote MIB update */
 	type = mib->type & I40E_AQ_LLDP_MIB_TYPE_MASK;
 	dev_dbg(&pf->pdev->dev,
-		"%s: LLDP event mib type %s\n", __func__,
-		type ? "remote" : "local");
+		"LLDP event mib type %s\n", type ? "remote" : "local");
 	if (type == I40E_AQ_LLDP_MIB_REMOTE) {
 		/* Update the remote cached instance and return */
 		ret = i40e_aq_get_dcb_config(hw, I40E_AQ_LLDP_MIB_REMOTE,
@@ -8983,8 +8976,7 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
 		if (veb) {
 			if (vsi->seid != pf->vsi[pf->lan_vsi]->seid) {
 				dev_info(&vsi->back->pdev->dev,
-					 "%s: New VSI creation error, uplink seid of LAN VSI expected.\n",
-					 __func__);
+					 "New VSI creation error, uplink seid of LAN VSI expected.\n");
 				return NULL;
 			}
 			/* We come up by default in VEPA mode if SRIOV is not
@@ -10428,7 +10420,7 @@ static pci_ers_result_t i40e_pci_error_slot_reset(struct pci_dev *pdev)
 	int err;
 	u32 reg;
 
-	dev_info(&pdev->dev, "%s\n", __func__);
+	dev_dbg(&pdev->dev, "%s\n", __func__);
 	if (pci_enable_device_mem(pdev)) {
 		dev_info(&pdev->dev,
 			 "Cannot re-enable PCI device after reset.\n");
@@ -10468,7 +10460,7 @@ static void i40e_pci_error_resume(struct pci_dev *pdev)
 {
 	struct i40e_pf *pf = pci_get_drvdata(pdev);
 
-	dev_info(&pdev->dev, "%s\n", __func__);
+	dev_dbg(&pdev->dev, "%s\n", __func__);
 	if (test_bit(__I40E_SUSPENDED, &pf->state))
 		return;
 
@@ -10560,9 +10552,7 @@ static int i40e_resume(struct pci_dev *pdev)
 
 	err = pci_enable_device_mem(pdev);
 	if (err) {
-		dev_err(&pdev->dev,
-			"%s: Cannot enable PCI device from suspend\n",
-			__func__);
+		dev_err(&pdev->dev, "Cannot enable PCI device from suspend\n");
 		return err;
 	}
 	pci_set_master(pdev);
drivers/net/ethernet/intel/i40evf/i40evf_main.c +3 -6
index d5d099b9..3fc5606 100644
@@ -411,8 +411,7 @@ i40evf_request_traffic_irqs(struct i40evf_adapter *adapter, char *basename)
 			q_vector);
 		if (err) {
 			dev_info(&adapter->pdev->dev,
-				 "%s: request_irq failed, error: %d\n",
-				__func__, err);
+				 "Request_irq failed, error: %d\n", err);
 			goto free_queue_irqs;
 		}
 		/* assign the mask for this irq */
@@ -1775,8 +1774,7 @@ static int i40evf_setup_all_tx_resources(struct i40evf_adapter *adapter)
 		if (!err)
 			continue;
 		dev_err(&adapter->pdev->dev,
-			"%s: Allocation for Tx Queue %u failed\n",
-			__func__, i);
+			"Allocation for Tx Queue %u failed\n", i);
 		break;
 	}
 
@@ -1803,8 +1801,7 @@ static int i40evf_setup_all_rx_resources(struct i40evf_adapter *adapter)
 		if (!err)
 			continue;
 		dev_err(&adapter->pdev->dev,
-			"%s: Allocation for Rx Queue %u failed\n",
-			__func__, i);
+			"Allocation for Rx Queue %u failed\n", i);
 		break;
 	}
 	return err;
drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c +27 -32

148 lines not on this page · raw message

Signature · 1 line
1.9.3
#22 lore raw

PATCH 11/15 i40e/i40evf: give up the __func__

Quoted 18 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Wednesday, August 26, 2015 12:14 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S11 11/15] i40e/i40evf: give up the __func__

From: Shannon Nelson <[email protected]>

During early development, we added the function name to all of the error strings to make debugging simpler. Now that we've released the driver, our users should have more comprehensible error messages. So tear the roof off and give up the __func__. Ow.

Change-ID I7e1766252c7a032b9af6520da6aff536bdfd533c
Quoted 6 lines
---
 drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c      |  5 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 40 ++++++---------
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    |  9 ++--
 .../net/ethernet/intel/i40evf/i40evf_virtchnl.c    | 59 ++++++++++------------
 4 files changed, 47 insertions(+), 66 deletions(-)

Code changes present in tree.

#23 lore raw

PATCH 12/15 i40e: add little endian conversion for checksum

In reply to Catherine Sullivan

From: Jesse Brandeburg <[email protected]>

The checksum is not correct on big endian machines so add code to swap it correctly.

Change-ID Ic92b886d172a2cbe49f5d7eee1bc78e447023c7b
---
 drivers/net/ethernet/intel/i40e/i40e_nvm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_nvm.c +3 -1
index 3f2fec9..5475454 100644
@@ -543,11 +543,13 @@ i40e_status i40e_update_nvm_checksum(struct i40e_hw *hw)
 {
 	i40e_status ret_code = 0;
 	u16 checksum;
+	__le16 le_sum;
 
 	ret_code = i40e_calc_nvm_checksum(hw, &checksum);
+	le_sum = cpu_to_le16(checksum);
 	if (!ret_code)
 		ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD,
-					     1, &checksum, true);
+					     1, &le_sum, true);
 
 	return ret_code;
 }
Signature · 1 line
1.9.3
#24 lore raw

PATCH 12/15 i40e: add little endian conversion for checksum

Quoted 14 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Wednesday, August 26, 2015 12:14 PM
To: intel-wired-lan at lists.osuosl.org
Cc: Stillwell Jr, Paul M
Subject: [Intel-wired-lan] [next PATCH S11 12/15] i40e: add little endian conversion for checksum

From: Jesse Brandeburg <[email protected]>

The checksum is not correct on big endian machines so add code to swap it correctly.

Quoted 6 lines
Change-ID Ic92b886d172a2cbe49f5d7eee1bc78e447023c7b
---
 drivers/net/ethernet/intel/i40e/i40e_nvm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Code present in tree

#25 lore raw

PATCH 13/15 i40e: fix bug in return from get_link_status and avoid spurious link messages

In reply to Catherine Sullivan

From: Jesse Brandeburg <[email protected]>

Previously, the driver could call this function and have only true/false returned, but false could mean multiple things like failure to read or link was down. This change allows the caller to get all return values in the call chain bubbled back to the source, which keeps information about failures from being lost.

Also, in some unlikely scenarios, the firmware can become slow to respond to admin queue (AQ) queries for link state. Should the AQ time out, the driver can detect the state and avoid a link change when there may have been none.

Change-ID Ib2ac38407b7880750fb891b392fa77457fe6c21c
---
 drivers/net/ethernet/intel/i40e/i40e_common.c    | 15 ++++++++-------
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c   | 11 ++++++++++-
 drivers/net/ethernet/intel/i40e/i40e_main.c      | 12 ++++++++++--
 drivers/net/ethernet/intel/i40e/i40e_prototype.h |  2 +-
 4 files changed, 29 insertions(+), 11 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_common.c +8 -7
index 7a70abc..2839ea5 100644
@@ -2235,27 +2235,28 @@ i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw,
 /**
  * i40e_get_link_status - get status of the HW network link
  * @hw: pointer to the hw struct
+ * @link_up: pointer to bool (true/false = linkup/linkdown)
  *
- * Returns true if link is up, false if link is down.
+ * Variable link_up true if link is up, false if link is down.
+ * The variable link_up is invalid if returned value of status != 0
  *
  * Side effect: LinkStatusEvent reporting becomes enabled
  **/
-bool i40e_get_link_status(struct i40e_hw *hw)
+i40e_status i40e_get_link_status(struct i40e_hw *hw, bool *link_up)
 {
 	i40e_status status = 0;
-	bool link_status = false;
 
 	if (hw->phy.get_link_info) {
 		status = i40e_aq_get_link_info(hw, true, NULL, NULL);
 
 		if (status)
-			goto i40e_get_link_status_exit;
+			i40e_debug(hw, I40E_DEBUG_LINK, "get link failed: status %d\n",
+				   status);
 	}
 
-	link_status = hw->phy.link_info.link_info & I40E_AQ_LINK_UP;
+	*link_up = hw->phy.link_info.link_info & I40E_AQ_LINK_UP;
 
-i40e_get_link_status_exit:
-	return link_status;
+	return status;
 }
 
 /**
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +10 -1
index 930369c..1fa38f6 100644
@@ -1516,9 +1516,18 @@ static int i40e_link_test(struct net_device *netdev, u64 *data)
 {
 	struct i40e_netdev_priv *np = netdev_priv(netdev);
 	struct i40e_pf *pf = np->vsi->back;
+	i40e_status status;
+	bool link_up = false;
 
 	netif_info(pf, hw, netdev, "link test\n");
-	if (i40e_get_link_status(&pf->hw))
+	status = i40e_get_link_status(&pf->hw, &link_up);
+	if (status) {
+		netif_err(pf, drv, netdev, "link query timed out, please retry test\n");
+		*data = 1;
+		return *data;
+	}
+
+	if (link_up)
 		*data = 0;
 	else
 		*data = 1;
drivers/net/ethernet/intel/i40e/i40e_main.c +10 -2
index 6af199a..1165460 100644
@@ -5626,15 +5626,23 @@ static void i40e_veb_link_event(struct i40e_veb *veb, bool link_up)
  **/
 static void i40e_link_event(struct i40e_pf *pf)
 {
-	bool new_link, old_link;
 	struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
 	u8 new_link_speed, old_link_speed;
+	i40e_status status;
+	bool new_link, old_link;
 
 	/* set this to force the get_link_status call to refresh state */
 	pf->hw.phy.get_link_info = true;
 
 	old_link = (pf->hw.phy.link_info_old.link_info & I40E_AQ_LINK_UP);
-	new_link = i40e_get_link_status(&pf->hw);
+
+	status = i40e_get_link_status(&pf->hw, &new_link);
+	if (status) {
+		dev_dbg(&pf->pdev->dev, "couldn't get link state, status: %d\n",
+			status);
+		return;
+	}
+
 	old_link_speed = pf->hw.phy.link_info_old.link_speed;
 	new_link_speed = pf->hw.phy.link_info.link_speed;
 
drivers/net/ethernet/intel/i40e/i40e_prototype.h +1 -1
index dcb72a8..e51e156 100644
@@ -258,7 +258,7 @@ i40e_status i40e_init_shared_code(struct i40e_hw *hw);
 i40e_status i40e_pf_reset(struct i40e_hw *hw);
 void i40e_clear_hw(struct i40e_hw *hw);
 void i40e_clear_pxe_mode(struct i40e_hw *hw);
-bool i40e_get_link_status(struct i40e_hw *hw);
+i40e_status i40e_get_link_status(struct i40e_hw *hw, bool *link_up);
 i40e_status i40e_get_mac_addr(struct i40e_hw *hw, u8 *mac_addr);
 i40e_status i40e_read_bw_from_alt_ram(struct i40e_hw *hw,
 				      u32 *max_bw, u32 *min_bw, bool *min_valid,
Signature · 1 line
1.9.3
#26 lore raw

PATCH 13/15 i40e: fix bug in return from get_link_status and avoid spurious link messages

Quoted 21 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Wednesday, August 26, 2015 12:14 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S11 13/15] i40e: fix bug in return from get_link_status and avoid spurious link messages

From: Jesse Brandeburg <[email protected]>

Previously, the driver could call this function and have only true/false returned, but false could mean multiple things like failure to read or link was down. This change allows the caller to get all return values in the call chain bubbled back to the source, which keeps information about failures from being lost.

Also, in some unlikely scenarios, the firmware can become slow to respond to admin queue (AQ) queries for link state. Should the AQ time out, the driver can detect the state and avoid a link change when there may have been none.

Quoted 8 lines
Change-ID Ib2ac38407b7880750fb891b392fa77457fe6c21c
---
 drivers/net/ethernet/intel/i40e/i40e_common.c    | 15 ++++++++-------
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c   | 11 ++++++++++-
 drivers/net/ethernet/intel/i40e/i40e_main.c      | 12 ++++++++++--
 drivers/net/ethernet/intel/i40e/i40e_prototype.h |  2 +-
 4 files changed, 29 insertions(+), 11 deletions(-)

Code changes present in tree

#27 lore raw

PATCH 14/15 i40e/i40evf: fix unicast mac address add

In reply to Catherine Sullivan

From: Shannon Nelson <[email protected]>

When using something like "ip maddr add ..." to add another unicast mac address to the netdev, the mac address comes into the set_rx_mode handler in the multicast list whether it is a unicast or multicast address. This was confusing the code when it was trying to search for addresses that needed to be deleted from the VSI, because it was looking for the VSI unicast address in the netdev unicast list. The result was that a new unicast address would get added to the VSI list and then immediately removed, and would never actually make it down into the hardware.

This patch removes the separation from unicast and multicast in the search for filters to be deleted. It also simplifies the logic a little with a jump to the bottom of the loop when an address is found. Now it doesn't matter which netdev list the address is hiding in, we'll check them all.

Change-ID Ie3685a92427ae7d2212bf948919ce295bc7a874c
---
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 41 +++++++++-------------
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 45 ++++++++++++-------------
 2 files changed, 38 insertions(+), 48 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +16 -25
index 1165460..2b0a5ce 100644
@@ -1643,36 +1643,27 @@ static void i40e_set_rx_mode(struct net_device *netdev)
 
 	/* remove filter if not in netdev list */
 	list_for_each_entry_safe(f, ftmp, &vsi->mac_filter_list, list) {
-		bool found = false;
 
 		if (!f->is_netdev)
 			continue;
 
-		if (is_multicast_ether_addr(f->macaddr)) {
-			netdev_for_each_mc_addr(mca, netdev) {
-				if (ether_addr_equal(mca->addr, f->macaddr)) {
-					found = true;
-					break;
-				}
-			}
-		} else {
-			netdev_for_each_uc_addr(uca, netdev) {
-				if (ether_addr_equal(uca->addr, f->macaddr)) {
-					found = true;
-					break;
-				}
-			}
+		netdev_for_each_mc_addr(mca, netdev)
+			if (ether_addr_equal(mca->addr, f->macaddr))
+				goto bottom_of_search_loop;
 
-			for_each_dev_addr(netdev, ha) {
-				if (ether_addr_equal(ha->addr, f->macaddr)) {
-					found = true;
-					break;
-				}
-			}
-		}
-		if (!found)
-			i40e_del_filter(
-			   vsi, f->macaddr, I40E_VLAN_ANY, false, true);
+		netdev_for_each_uc_addr(uca, netdev)
+			if (ether_addr_equal(uca->addr, f->macaddr))
+				goto bottom_of_search_loop;
+
+		for_each_dev_addr(netdev, ha)
+			if (ether_addr_equal(ha->addr, f->macaddr))
+				goto bottom_of_search_loop;
+
+		/* f->macaddr wasn't found in uc, mc, or ha list so delete it */
+		i40e_del_filter(vsi, f->macaddr, I40E_VLAN_ANY, false, true);
+
+bottom_of_search_loop:
+		continue;
 	}
 
 	/* check for other flag changes */
drivers/net/ethernet/intel/i40evf/i40evf_main.c +22 -23

57 lines not on this page · raw message

Signature · 1 line
1.9.3
#28 lore raw

PATCH 14/15 i40e/i40evf: fix unicast mac address add

Quoted 24 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Wednesday, August 26, 2015 12:14 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S11 14/15] i40e/i40evf: fix unicast mac address add

From: Shannon Nelson <[email protected]>

When using something like "ip maddr add ..." to add another unicast mac address to the netdev, the mac address comes into the set_rx_mode handler in the multicast list whether it is a unicast or multicast address. This was confusing the code when it was trying to search for addresses that needed to be deleted from the VSI, because it was looking for the VSI unicast address in the netdev unicast list. The result was that a new unicast address would get added to the VSI list and then immediately removed, and would never actually make it down into the hardware.

This patch removes the separation from unicast and multicast in the search for filters to be deleted. It also simplifies the logic a little with a jump to the bottom of the loop when an address is found. Now it doesn't matter which netdev list the address is hiding in, we'll check them all.

Quoted 7 lines
Change-ID Ie3685a92427ae7d2212bf948919ce295bc7a874c
---
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 41 +++++++++-------------
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 45 ++++++++++++--------
-----
 2 files changed, 38 insertions(+), 48 deletions(-)

Code changes present in tree

#29 lore raw

PATCH 15/15 i40e/i40evf: Bump i40e to 1.3.14 and i40evf to 1.3.8

In reply to Catherine Sullivan

Bump.

Change-ID If10c8aaac70f7ec7cc01509260e65015feba5d36
---
 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(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
index 2b0a5ce..d6ba5f6 100644
@@ -40,7 +40,7 @@ static const char i40e_driver_string[] =
 
 #define DRV_VERSION_MAJOR 1
 #define DRV_VERSION_MINOR 3
-#define DRV_VERSION_BUILD 12
+#define DRV_VERSION_BUILD 14
 #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
 	     __stringify(DRV_VERSION_MINOR) "." \
 	     __stringify(DRV_VERSION_BUILD)    DRV_KERN
drivers/net/ethernet/intel/i40evf/i40evf_main.c +1 -1
index b2d07f2..a98fa20 100644
@@ -35,7 +35,7 @@ char i40evf_driver_name[] = "i40evf";
 static const char i40evf_driver_string[] =
 	"Intel(R) XL710/X710 Virtual Function Network Driver";
 
-#define DRV_VERSION "1.3.6"
+#define DRV_VERSION "1.3.8"
 const char i40evf_driver_version[] = DRV_VERSION;
 static const char i40evf_copyright[] =
 	"Copyright (c) 2013 - 2015 Intel Corporation.";
Signature · 1 line
1.9.3
#30 lore raw

PATCH 15/15 i40e/i40evf: Bump i40e to 1.3.14 and i40evf to 1.3.8

Quoted 8 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Wednesday, August 26, 2015 12:14 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S11 15/15] i40e/i40evf: Bump i40e to 1.3.14 and i40evf to 1.3.8

Quoted 8 lines

Bump.

Change-ID If10c8aaac70f7ec7cc01509260e65015feba5d36
---
 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(-)

Code changes present in tree, superseded by subsequent version bump to 1.3.18 and 1.3.10