Skip to contentSkip to conversation

i40e/i40evf updates

PATCH New Catherine Sullivan 2 participants 21 messages Oct 1, 2015 – Oct 15, 2015

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

cover i40e/i40evf updates

Akeem fixes VEB/VEPA bridge mode mismatch issue and disables VEB bridge mode when there is an SR-IOV failure.

Anjali adds a workaround to drop all flow control frames, fixes a bug in debugfs with add/del macaddr.

Carolyn fixes an incorrect OEM version string.

Helin fixes inconsistent statuses after a PF reset.

Mitch uses correct struct for list manipulation.

 drivers/net/ethernet/intel/i40e/i40e.h             | 17 +++++--
 drivers/net/ethernet/intel/i40e/i40e_common.c      | 22 +++++++++
 drivers/net/ethernet/intel/i40e/i40e_debugfs.c     |  4 ++
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 56 ++++++++++++++++++++--
 drivers/net/ethernet/intel/i40e/i40e_prototype.h   |  2 +
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |  1 +
 drivers/net/ethernet/intel/i40evf/i40e_prototype.h |  2 +
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    |  7 +--
 8 files changed, 100 insertions(+), 11 deletions(-)
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/8 i40e/i40evf: Add a workaround to drop all flow control frames

From: Anjali Singhai Jain <[email protected]>

This patch adds a workaround to drop any flow control frames from being transmitted from any VSI. FW can still send flow control frames if flow control is enabled.

With this patch in place a malicious VF cannot send flow control or PFC packets out on the wire.

Change-ID I4303b24e98b93066d2767fec24dfe78be591c277
---
 drivers/net/ethernet/intel/i40e/i40e_common.c      | 22 ++++++++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 18 ++++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_prototype.h   |  2 ++
 drivers/net/ethernet/intel/i40evf/i40e_prototype.h |  2 ++
 4 files changed, 44 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_common.c +22 -0
index a1cfb16..0958da8 100644
@@ -3897,6 +3897,28 @@ i40e_status i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw,
 }
 
 /**
+ * i40e_add_filter_to_drop_tx_flow_control_frames- filter to drop flow control
+ * @hw: pointer to the hw struct
+ * @seid: VSI seid to add ethertype filter from
+ **/
+#define I40E_FLOW_CONTROL_ETHTYPE 0x8808
+void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw,
+						    u16 seid)
+{
+	u16 flag = I40E_AQC_ADD_CONTROL_PACKET_FLAGS_IGNORE_MAC |
+		   I40E_AQC_ADD_CONTROL_PACKET_FLAGS_DROP |
+		   I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TX;
+	u16 ethtype = I40E_FLOW_CONTROL_ETHTYPE;
+	i40e_status status;
+
+	status = i40e_aq_add_rem_control_packet_filter(hw, NULL, ethtype, flag,
+						       seid, 0, true, NULL,
+						       NULL);
+	if (status)
+		hw_dbg(hw, "Ethtype Filter Add failed: Error pruning Tx flow control frames\n");
+}
+
+/**
  * i40e_aq_alternate_read
  * @hw: pointer to the hardware structure
  * @reg_addr0: address of first dword to be read
drivers/net/ethernet/intel/i40e/i40e_main.c +18 -0
index eda14cf..d341f56 100644
@@ -6856,6 +6856,15 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
 	if (pf->flags & I40E_FLAG_MSIX_ENABLED)
 		ret = i40e_setup_misc_vector(pf);
 
+	/* Add a filter to drop all Flow control frames from any VSI from being
+	 * transmitted. By doing so we stop a malicious VF from sending out
+	 * PAUSE or PFC frames and potentially controlling traffic for other
+	 * PF/VF VSIs.
+	 * The FW can still send Flow control frames if enabled.
+	 */
+	i40e_add_filter_to_drop_tx_flow_control_frames(&pf->hw,
+						       pf->main_vsi_seid);
+
 	/* restart the VSIs that were rebuilt and running before the reset */
 	i40e_pf_unquiesce_all_vsi(pf);
 
@@ -10602,6 +10611,15 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 			i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status));
 	pf->hw.phy.phy_types = le32_to_cpu(abilities.phy_type);
 
+	/* Add a filter to drop all Flow control frames from any VSI from being
+	 * transmitted. By doing so we stop a malicious VF from sending out
+	 * PAUSE or PFC frames and potentially controlling traffic for other
+	 * PF/VF VSIs.
+	 * The FW can still send Flow control frames if enabled.
+	 */
+	i40e_add_filter_to_drop_tx_flow_control_frames(&pf->hw,
+						       pf->main_vsi_seid);
+
 	/* print a string summarizing features */
 	i40e_print_features(pf);
 
drivers/net/ethernet/intel/i40e/i40e_prototype.h +2 -0
index 642c9aa5..a17cd55 100644
@@ -328,4 +328,6 @@ i40e_status i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id,
 			       void *buff, u16 *ret_buff_size,
 			       u8 *ret_next_table, u32 *ret_next_index,
 			       struct i40e_asq_cmd_details *cmd_details);
+void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw,
+						    u16 vsi_seid);
 #endif /* _I40E_PROTOTYPE_H_ */
drivers/net/ethernet/intel/i40evf/i40e_prototype.h +2 -0
index 8ed0edf..cbd9a1b 100644
@@ -101,4 +101,6 @@ i40e_status i40e_aq_add_rem_control_packet_filter(struct i40e_hw *hw,
 				u16 vsi_seid, u16 queue, bool is_add,
 				struct i40e_control_filter_stats *stats,
 				struct i40e_asq_cmd_details *cmd_details);
+void i40e_add_filter_to_drop_tx_flow_control_frames(struct i40e_hw *hw,
+						    u16 vsi_seid);
 #endif /* _I40E_PROTOTYPE_H_ */
Signature · 1 line
1.9.3
#2 lore raw

PATCH 1/8 i40e/i40evf: Add a workaround to drop all flow control frames

Quoted 19 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Thursday, October 01, 2015 11:38 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S18 1/8] i40e/i40evf: Add a workaround to drop all flow control frames

From: Anjali Singhai Jain <[email protected]>

This patch adds a workaround to drop any flow control frames from being transmitted from any VSI. FW can still send flow control frames if flow control is enabled.

With this patch in place a malicious VF cannot send flow control or PFC packets out on the wire.

Change-ID I4303b24e98b93066d2767fec24dfe78be591c277
Quoted 8 lines
---
 drivers/net/ethernet/intel/i40e/i40e_common.c      | 22
++++++++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 18
++++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_prototype.h   |  2 ++
 drivers/net/ethernet/intel/i40evf/i40e_prototype.h |  2 ++
 4 files changed, 44 insertions(+)

Patch code changes correctly applied

#3 lore raw

PATCH 2/8 i40e: fix a bug in debugfs with add/del macaddr

In reply to Catherine Sullivan

From: Anjali Singhai Jain <[email protected]>

The new code flow requires us to grab the filter list lock before adding/deleting the filter.

Change-ID I4eaef508ab4da2d1b2e23f20f2a78d931d5b6aeb

---
Testing-hints: 5645669

 drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_debugfs.c +4 -0
index c38e9ee..6baeefc 100644
@@ -1137,7 +1137,9 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
 			goto command_write_done;
 		}
 
+		spin_lock_bh(&vsi->mac_filter_list_lock);
 		f = i40e_add_filter(vsi, ma, vlan, false, false);
+		spin_unlock_bh(&vsi->mac_filter_list_lock);
 		ret = i40e_sync_vsi_filters(vsi, true);
 		if (f && !ret)
 			dev_info(&pf->pdev->dev,
@@ -1174,7 +1176,9 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
 			goto command_write_done;
 		}
 
+		spin_lock_bh(&vsi->mac_filter_list_lock);
 		i40e_del_filter(vsi, ma, vlan, false, false);
+		spin_unlock_bh(&vsi->mac_filter_list_lock);
 		ret = i40e_sync_vsi_filters(vsi, true);
 		if (!ret)
 			dev_info(&pf->pdev->dev,
Signature · 1 line
1.9.3
#4 lore raw

PATCH 2/8 i40e: fix a bug in debugfs with add/del macaddr

Quoted 13 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Thursday, October 01, 2015 11:38 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S18 2/8] i40e: fix a bug in debugfs with add/del macaddr

From: Anjali Singhai Jain <[email protected]>

The new code flow requires us to grab the filter list lock before adding/deleting the filter.

Quoted 7 lines
Change-ID I4eaef508ab4da2d1b2e23f20f2a78d931d5b6aeb

---
Testing-hints: 5645669

 drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch code changes correctly applied, driver no longer crashes when adding/removing MAC addresses via admin queue/debugfs commands.

#5 lore raw

PATCH 3/8 i40e: Fix VEB/VEPA bridge mode mismatch issue

In reply to Catherine Sullivan

From: Akeem G Abodunrin <[email protected]>

Fix i40e_is_vsi_uplink_mode_veb to check if bridge is actually in VEB mode before allowing LB in the add vsi routine, instead of unconditionally returning VEB bridge mode.

Change-ID I162397b1bdd02367735fe9baaeb51465be2a3ce9
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +13 -3
index d341f56..a56aefe 100644
@@ -8758,12 +8758,22 @@ int i40e_is_vsi_uplink_mode_veb(struct i40e_vsi *vsi)
 		return 1;
 
 	veb = pf->veb[vsi->veb_idx];
+	if (!veb) {
+		dev_info(&pf->pdev->dev,
+			 "There is no veb associated with the bridge\n");
+		return -ENOENT;
+	}
+
 	/* Uplink is a bridge in VEPA mode */
-	if (veb && (veb->bridge_mode & BRIDGE_MODE_VEPA))
+	if (veb->bridge_mode & BRIDGE_MODE_VEPA) {
 		return 0;
+	} else {
+		/* Uplink is a bridge in VEB mode */
+		return 1;
+	}
 
-	/* Uplink is a bridge in VEB mode */
-	return 1;
+	/* VEPA is now default bridge, so return 0 */
+	return 0;
 }
 
 /**
Signature · 1 line
1.9.3
#6 lore raw

PATCH 3/8 i40e: Fix VEB/VEPA bridge mode mismatch issue

Quoted 28 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Thursday, October 01, 2015 11:38 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Abodunrin, Akeem G <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S18 3/8] i40e: Fix VEB/VEPA bridge mode mismatch issue

From: Akeem G Abodunrin <[email protected]>

Fix i40e_is_vsi_uplink_mode_veb to check if bridge is actually in VEB mode before allowing LB in the add vsi routine, instead of unconditionally returning VEB bridge mode.

Change-ID I162397b1bdd02367735fe9baaeb51465be2a3ce9
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +0 -0
index d341f56..a56aefe 100644

drivers/net/ethernet/intel/i40e/i40e_main.c int i40e_is_vsi_uplink_mode_veb(struct i40e_vsi · line 8767

Quoted 10 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +6 -0
@@ -8758,12 +8758,22 @@ int i40e_is_vsi_uplink_mode_veb(struct i40e_vsi
 *vsi)
 		return 1;
 
 	veb = pf->veb[vsi->veb_idx];
+	if (!veb) {
+		dev_info(&pf->pdev->dev,
+			 "There is no veb associated with the bridge\n");
+		return -ENOENT;
+	}
+

This introduces a subtle bug into the code - the caller of i40e_is_vsi_uplink_mode_veb() is looking for 0/non-0, not looking for an error condition.

sln

Quoted 23 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +7 -3
 	/* Uplink is a bridge in VEPA mode */
-	if (veb && (veb->bridge_mode & BRIDGE_MODE_VEPA))
+	if (veb->bridge_mode & BRIDGE_MODE_VEPA) {
 		return 0;
+	} else {
+		/* Uplink is a bridge in VEB mode */
+		return 1;
+	}
 
-	/* Uplink is a bridge in VEB mode */
-	return 1;
+	/* VEPA is now default bridge, so return 0 */
+	return 0;
 }
 

/**
--
1.9.3

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan at lists.osuosl.org
http://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#7 lore raw

PATCH 3/8 i40e: Fix VEB/VEPA bridge mode mismatch issue

Quoted 55 lines

-----Original Message-----
From: Nelson, Shannon
Sent: Thursday, October 01, 2015 12:06 PM
To: Sullivan, Catherine; intel-wired-lan at lists.osuosl.org
Cc: Abodunrin, Akeem G
Subject: RE: [Intel-wired-lan] [next PATCH S18 3/8] i40e: Fix VEB/VEPA bridge mode mismatch issue

Quoted 30 lines

-----Original Message-----
From: Intel-wired-lan
[mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Thursday, October 01, 2015 11:38 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Abodunrin, Akeem G <[email protected]>
Subject: [Intel-wired-lan] [next PATCH S18 3/8] i40e: Fix VEB/VEPA bridge mode mismatch issue

From: Akeem G Abodunrin <[email protected]>

Fix i40e_is_vsi_uplink_mode_veb to check if bridge is actually in VEB mode before allowing LB in the add vsi routine, instead of unconditionally returning VEB bridge mode.

Change-ID I162397b1bdd02367735fe9baaeb51465be2a3ce9
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +0 -0
index d341f56..a56aefe 100644
@@ -8758,12 +8758,22 @@ int i40e_is_vsi_uplink_mode_veb(struct

i40e_vsi
*vsi)

drivers/net/ethernet/intel/i40e/i40e_main.c int i40e_is_vsi_uplink_mode_veb(struct i40e_vsi *vsi) · line 8766

Quoted 9 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +6 -0
 		return 1;
 
 	veb = pf->veb[vsi->veb_idx];
+	if (!veb) {
+		dev_info(&pf->pdev->dev,
+			 "There is no veb associated with the bridge\n");
+		return -ENOENT;
+	}
+

This introduces a subtle bug into the code - the caller of i40e_is_vsi_uplink_mode_veb() is looking for 0/non-0, not looking for an error condition.

Quoted 1 line

sln

So, we need to make sure that caller knows how to handle instance of non-existence of VEB or we are guaranteed there is always going to be VEB, then we can just forget checking for error? Please, let me know...

Thanks,
~Akeem

Quoted 24 lines
Quoted 24 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +7 -4
 	/* Uplink is a bridge in VEPA mode */
-	if (veb && (veb->bridge_mode & BRIDGE_MODE_VEPA))
+	if (veb->bridge_mode & BRIDGE_MODE_VEPA) {
 		return 0;
+	} else {
+		/* Uplink is a bridge in VEB mode */
+		return 1;
+	}
 
-	/* Uplink is a bridge in VEB mode */
-	return 1;
+	/* VEPA is now default bridge, so return 0 */
+	return 0;
 }
 
 /**
--

1.9.3

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan at lists.osuosl.org
http://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#8 lore raw

PATCH 3/8 i40e: Fix VEB/VEPA bridge mode mismatch issue

Quoted 24 lines
Quoted 24 lines
Quoted 10 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +0 -0
index d341f56..a56aefe 100644
@@ -8758,12 +8758,22 @@ int i40e_is_vsi_uplink_mode_veb(struct

i40e_vsi
*vsi)

drivers/net/ethernet/intel/i40e/i40e_main.c int i40e_is_vsi_uplink_mode_veb(struct i40e_vsi *vsi) · line 8766

Quoted 9 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +6 -0
 		return 1;
 
 	veb = pf->veb[vsi->veb_idx];
+	if (!veb) {
+		dev_info(&pf->pdev->dev,
+			 "There is no veb associated with the bridge\n");
+		return -ENOENT;
+	}
+

This introduces a subtle bug into the code - the caller of i40e_is_vsi_uplink_mode_veb() is looking for 0/non-0, not looking for an error condition.

Quoted 8 lines
Quoted 1 line

sln

So, we need to make sure that caller knows how to handle instance of non- existence of VEB or we are guaranteed there is always going to be VEB, then we can just forget checking for error? Please, let me know...

Thanks,
~Akeem

Since it's already returning 1 in the veb_idx==NO_VEB case, I suppose you can use similar reasoning to return 1 in the !veb case. I would think that neither case should actually ever get hit.

sln

#9 lore raw

PATCH 3/8 i40e: Fix VEB/VEPA bridge mode mismatch issue

In reply to Catherine Sullivan
Quoted 15 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Thursday, October 01, 2015 11:38 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Abodunrin, Akeem G
Subject: [Intel-wired-lan] [next PATCH S18 3/8] i40e: Fix VEB/VEPA bridge mode mismatch issue

From: Akeem G Abodunrin <[email protected]>

Fix i40e_is_vsi_uplink_mode_veb to check if bridge is actually in VEB mode before allowing LB in the add vsi routine, instead of unconditionally returning VEB bridge mode.

Quoted 5 lines
Change-ID I162397b1bdd02367735fe9baaeb51465be2a3ce9
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

Patch code changes correctly applied, "Switch no longer goes to VEB mode but stays in VEPA mode. No kernel crash. "

#10 lore raw

PATCH 4/8 i40evf: use correct struct for list manipulation

In reply to Catherine Sullivan

From: Mitch Williams <[email protected]>

Not sure how this compiles at all. Use the correct struct for manipulating the VLAN filter list. Without this, the VLAN filter list doesn't get processed correctly, and VLAN filters will not be re-enabled after any kind of reset.

Change-ID Iceff2dc089f303058fb71ecb08419eed471e0e90
---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +3 -2
index e5e132a..ec19b91 100644
@@ -1609,6 +1609,7 @@ static void i40evf_reset_task(struct work_struct *work)
 						      reset_task);
 	struct net_device *netdev = adapter->netdev;
 	struct i40e_hw *hw = &adapter->hw;
+	struct i40evf_vlan_filter *vlf;
 	struct i40evf_mac_filter *f;
 	u32 reg_val;
 	int i = 0, err;
@@ -1732,8 +1733,8 @@ continue_reset:
 		f->add = true;
 	}
 	/* re-add all VLAN filters */
-	list_for_each_entry(f, &adapter->vlan_filter_list, list) {
-		f->add = true;
+	list_for_each_entry(vlf, &adapter->vlan_filter_list, list) {
+		vlf->add = true;
 	}
 	adapter->aq_required |= I40EVF_FLAG_AQ_ADD_MAC_FILTER;
 	adapter->aq_required |= I40EVF_FLAG_AQ_ADD_VLAN_FILTER;
Signature · 1 line
1.9.3
#11 lore raw

PATCH 4/8 i40evf: use correct struct for list manipulation

Quoted 14 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Thursday, October 01, 2015 11:38 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S18 4/8] i40evf: use correct struct for list manipulation

From: Mitch Williams <[email protected]>

Not sure how this compiles at all. Use the correct struct for manipulating the VLAN filter list. Without this, the VLAN filter list doesn't get processed correctly, and VLAN filters will not be re-enabled after any kind of reset.

Quoted 5 lines
Change-ID Iceff2dc089f303058fb71ecb08419eed471e0e90
---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch code changes correctly applied

#12 lore raw

PATCH 5/8 i40e: fix inconsistent statuses after a PF reset

In reply to Catherine Sullivan

From: Helin Zhang <[email protected]>

This patch fixes a problem of possibly getting inconsistent flow control statuses after a PF reset. Requested_mode was being set with a default value during probing, but the initial HW state could be different from this mode.

Change-ID I772bf07b78616e87086418d4bd87954b66fa17cd

---
Testing-hints: 5644395

 drivers/net/ethernet/intel/i40e/i40e_main.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +20 -0
index a56aefe..a887fd9 100644
@@ -10200,6 +10200,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	int err;
 	u32 len;
 	u32 i;
+	u8 set_fc_aq_fail;
 
 	err = pci_enable_device_mem(pdev);
 	if (err)
@@ -10464,6 +10465,25 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		dev_info(&pdev->dev, "setup_pf_switch failed: %d\n", err);
 		goto err_vsis;
 	}
+
+	/* Make sure flow control is set according to current settings */
+	err = i40e_set_fc(hw, &set_fc_aq_fail, true);
+	if (set_fc_aq_fail & I40E_SET_FC_AQ_FAIL_GET)
+		dev_dbg(&pf->pdev->dev,
+			"Set fc with err %s aq_err %s on get_phy_cap\n",
+			i40e_stat_str(hw, err),
+			i40e_aq_str(hw, hw->aq.asq_last_status));
+	if (set_fc_aq_fail & I40E_SET_FC_AQ_FAIL_SET)
+		dev_dbg(&pf->pdev->dev,
+			"Set fc with err %s aq_err %s on set_phy_config\n",
+			i40e_stat_str(hw, err),
+			i40e_aq_str(hw, hw->aq.asq_last_status));
+	if (set_fc_aq_fail & I40E_SET_FC_AQ_FAIL_UPDATE)
+		dev_dbg(&pf->pdev->dev,
+			"Set fc with err %s aq_err %s on get_link_info\n",
+			i40e_stat_str(hw, err),
+			i40e_aq_str(hw, hw->aq.asq_last_status));
+
 	/* if FDIR VSI was set up, start it now */
 	for (i = 0; i < pf->num_alloc_vsi; i++) {
 		if (pf->vsi[i] && pf->vsi[i]->type == I40E_VSI_FDIR) {
Signature · 1 line
1.9.3
#13 lore raw

PATCH 5/8 i40e: fix inconsistent statuses after a PF reset

Quoted 16 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Thursday, October 01, 2015 11:38 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Zhang, Helin
Subject: [Intel-wired-lan] [next PATCH S18 5/8] i40e: fix inconsistent statuses after a PF reset

From: Helin Zhang <[email protected]>

This patch fixes a problem of possibly getting inconsistent flow control statuses after a PF reset. Requested_mode was being set with a default value during probing, but the initial HW state could be different from this mode.

Quoted 7 lines
Change-ID I772bf07b78616e87086418d4bd87954b66fa17cd

---
Testing-hints: 5644395

 drivers/net/ethernet/intel/i40e/i40e_main.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Patch code changes correctly applied, statuses stayed consistent after reset

#14 lore raw

PATCH 6/8 i40e: Fix an incorrect OEM version string

In reply to Catherine Sullivan

From: Carolyn Wyborny <[email protected]>

This patch fixes a problem where the driver output of the oem version string varied from the other tools. The mask value and the order of operations were incorrect, per the DCR. Without this patch, the version string will appear incorrect from the driver.

Change-ID Ie1ca6485284b4ce3b57e5a99b18b7641617c7ef7

---
Testing-hints: 5646237

 drivers/net/ethernet/intel/i40e/i40e.h | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +13 -4
index 7c2b2e8..4dd3e26 100644
@@ -109,8 +109,10 @@
 #define I40E_NVM_VERSION_LO_MASK   (0xff << I40E_NVM_VERSION_LO_SHIFT)
 #define I40E_NVM_VERSION_HI_SHIFT  12
 #define I40E_NVM_VERSION_HI_MASK   (0xf << I40E_NVM_VERSION_HI_SHIFT)
-#define I40E_OEM_VER_BUILD_MASK    0xff00
+#define I40E_OEM_VER_BUILD_MASK    0xffff
 #define I40E_OEM_VER_PATCH_MASK    0xff
+#define I40E_OEM_VER_BUILD_SHIFT   8
+#define I40E_OEM_VER_SHIFT         24
 
 /* The values in here are decimal coded as hex as is the case in the NVM map*/
 #define I40E_CURRENT_NVM_VERSION_HI 0x2
@@ -594,6 +596,15 @@ struct i40e_device {
 static inline char *i40e_nvm_version_str(struct i40e_hw *hw)
 {
 	static char buf[32];
+	u32 full_ver;
+	u8 ver, patch;
+	u16 build;
+
+	full_ver = hw->nvm.oem_ver;
+	ver = (u8)(full_ver >> I40E_OEM_VER_SHIFT);
+	build = (u16)((full_ver >> I40E_OEM_VER_BUILD_SHIFT)
+		 & I40E_OEM_VER_BUILD_MASK);
+	patch = (u8)(full_ver & I40E_OEM_VER_PATCH_MASK);
 
 	snprintf(buf, sizeof(buf),
 		 "%x.%02x 0x%x %d.%d.%d",
@@ -601,9 +612,7 @@ static inline char *i40e_nvm_version_str(struct i40e_hw *hw)
 			I40E_NVM_VERSION_HI_SHIFT,
 		 (hw->nvm.version & I40E_NVM_VERSION_LO_MASK) >>
 			I40E_NVM_VERSION_LO_SHIFT,
-		 hw->nvm.eetrack, (hw->nvm.oem_ver >> 24),
-		 (hw->nvm.oem_ver & I40E_OEM_VER_BUILD_MASK) >> 8,
-		 hw->nvm.oem_ver & I40E_OEM_VER_PATCH_MASK);
+		 hw->nvm.eetrack, ver, build, patch);
 
 	return buf;
 }
Signature · 1 line
1.9.3
#15 lore raw

PATCH 6/8 i40e: Fix an incorrect OEM version string

Quoted 10 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Thursday, October 01, 2015 11:38 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S18 6/8] i40e: Fix an incorrect OEM version string

Quoted 5 lines

From: Carolyn Wyborny <[email protected]>

This patch fixes a problem where the driver output of the oem version string varied from the other tools. The mask value and the order of operations were incorrect, per the DCR.

Not a vital issue, but we probably shouldn't mention DCR in the external commit message. sln

Quoted 64 lines

Without this patch, the version string will appear incorrect from the driver.

Change-ID Ie1ca6485284b4ce3b57e5a99b18b7641617c7ef7

---
Testing-hints: 5646237

 drivers/net/ethernet/intel/i40e/i40e.h | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +3 -1
index 7c2b2e8..4dd3e26 100644
@@ -109,8 +109,10 @@
 #define I40E_NVM_VERSION_LO_MASK   (0xff << I40E_NVM_VERSION_LO_SHIFT)
 #define I40E_NVM_VERSION_HI_SHIFT  12
 #define I40E_NVM_VERSION_HI_MASK   (0xf << I40E_NVM_VERSION_HI_SHIFT)
-#define I40E_OEM_VER_BUILD_MASK    0xff00
+#define I40E_OEM_VER_BUILD_MASK    0xffff
 #define I40E_OEM_VER_PATCH_MASK    0xff
+#define I40E_OEM_VER_BUILD_SHIFT   8
+#define I40E_OEM_VER_SHIFT         24
 
 /* The values in here are decimal coded as hex as is the case in the NVM

map*/
#define I40E_CURRENT_NVM_VERSION_HI 0x2

drivers/net/ethernet/intel/i40e/i40e.h +10 -3
@@ -594,6 +596,15 @@ struct i40e_device {
 static inline char *i40e_nvm_version_str(struct i40e_hw *hw)
 {
 	static char buf[32];
+	u32 full_ver;
+	u8 ver, patch;
+	u16 build;
+
+	full_ver = hw->nvm.oem_ver;
+	ver = (u8)(full_ver >> I40E_OEM_VER_SHIFT);
+	build = (u16)((full_ver >> I40E_OEM_VER_BUILD_SHIFT)
+		 & I40E_OEM_VER_BUILD_MASK);
+	patch = (u8)(full_ver & I40E_OEM_VER_PATCH_MASK);
 
 	snprintf(buf, sizeof(buf),
 		 "%x.%02x 0x%x %d.%d.%d",
@@ -601,9 +612,7 @@ static inline char *i40e_nvm_version_str(struct
 i40e_hw *hw)
 			I40E_NVM_VERSION_HI_SHIFT,
 		 (hw->nvm.version & I40E_NVM_VERSION_LO_MASK) >>
 			I40E_NVM_VERSION_LO_SHIFT,
-		 hw->nvm.eetrack, (hw->nvm.oem_ver >> 24),
-		 (hw->nvm.oem_ver & I40E_OEM_VER_BUILD_MASK) >> 8,
-		 hw->nvm.oem_ver & I40E_OEM_VER_PATCH_MASK);
+		 hw->nvm.eetrack, ver, build, patch);
 
 	return buf;

}
--
1.9.3

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan at lists.osuosl.org
http://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#16 lore raw

PATCH 6/8 i40e: Fix an incorrect OEM version string

In reply to Catherine Sullivan
Quoted 15 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Thursday, October 01, 2015 11:38 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S18 6/8] i40e: Fix an incorrect OEM version string

From: Carolyn Wyborny <[email protected]>

This patch fixes a problem where the driver output of the oem version string varied from the other tools. The mask value and the order of operations were incorrect, per the DCR.
Without this patch, the version string will appear incorrect from the driver.

Quoted 7 lines
Change-ID Ie1ca6485284b4ce3b57e5a99b18b7641617c7ef7

---
Testing-hints: 5646237

 drivers/net/ethernet/intel/i40e/i40e.h | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

Patch code changes correctly applied, version output from dmesg and ethtool is correct

#17 lore raw

PATCH 7/8 i40e: Disable VEB bridge mode with SR-IOV failure

In reply to Catherine Sullivan

From: Akeem G Abodunrin <[email protected]>

If a call to enable SR-IOV in the kernel failed, we need to disable I40E_FLAG_VEB_MODE_ENABLED, so that bridge mode could fall back to VEPA, which is a default.

Change-ID I12b6f776769506db85b29bea94b9c88d0b5ee65e

---
Testing-hints: 5645709
Configure driver with SR-IOV in a nested virtualization environment (PCI-Passthrough) and confirmed that SR-IOV enablement failed. Bridge mode should remain VEPA instead of VEB with the notion that SR-IOV has been successfully configured.

 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +1 -0
index b2d95ee..44462b4 100644
@@ -944,6 +944,7 @@ int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs)
 	if (pci_num_vf(pf->pdev) != num_alloc_vfs) {
 		ret = pci_enable_sriov(pf->pdev, num_alloc_vfs);
 		if (ret) {
+			pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED;
 			pf->num_alloc_vfs = 0;
 			goto err_iov;
 		}
Signature · 1 line
1.9.3
#18 lore raw

PATCH 7/8 i40e: Disable VEB bridge mode with SR-IOV failure

Quoted 18 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Thursday, October 01, 2015 11:38 AM
To: intel-wired-lan at lists.osuosl.org
Cc: Abodunrin, Akeem G
Subject: [Intel-wired-lan] [next PATCH S18 7/8] i40e: Disable VEB bridge mode with SR-IOV failure

From: Akeem G Abodunrin <[email protected]>

If a call to enable SR-IOV in the kernel failed, we need to disable I40E_FLAG_VEB_MODE_ENABLED, so that bridge mode could fall back to VEPA, which is a default.

Change-ID I12b6f776769506db85b29bea94b9c88d0b5ee65e
Quoted 8 lines

---
Testing-hints: 5645709
Configure driver with SR-IOV in a nested virtualization environment (PCI-Passthrough) and confirmed that SR-IOV enablement failed. Bridge mode should remain VEPA instead of VEB with the notion that SR-IOV has been successfully configured.

 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 1 +
 1 file changed, 1 insertion(+)

Patch code changes correctly applied, "Switch no longer goes to VEB mode but stays in VEPA mode. No kernel crash. "

#19 lore raw

PATCH 8/8 i40e/i40evf: Bump i40e to 1.3.46 and i40evf to 1.3.33

In reply to Catherine Sullivan

Bump up the version...

Change-ID Ib8d501021671ba20250115ed54330e2c182255b7

---
Testing-hints: check version

 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 a887fd9..84af3df 100644
@@ -39,7 +39,7 @@ static const char i40e_driver_string[] =
 
 #define DRV_VERSION_MAJOR 1
 #define DRV_VERSION_MINOR 3
-#define DRV_VERSION_BUILD 38
+#define DRV_VERSION_BUILD 46
 #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 ec19b91..cff29ab 100644
@@ -34,7 +34,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.25"
+#define DRV_VERSION "1.3.33"
 const char i40evf_driver_version[] = DRV_VERSION;
 static const char i40evf_copyright[] =
 	"Copyright (c) 2013 - 2015 Intel Corporation.";
Signature · 1 line
1.9.3
#20 lore raw

PATCH 8/8 i40e/i40evf: Bump i40e to 1.3.46 and i40evf to 1.3.33

Quoted 10 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Catherine Sullivan
Sent: Thursday, October 01, 2015 11:38 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [next PATCH S18 8/8] i40e/i40evf: Bump i40e to 1.3.46 and i40evf to 1.3.33

Bump up the version...

Quoted 8 lines
Change-ID Ib8d501021671ba20250115ed54330e2c182255b7

---
Testing-hints: check version

 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(-)

Patch code changes correctly applied, modinfo shows correct version for i40e and i40evf.