Skip to contentSkip to conversation

Intel Wired LAN Driver Updates

PATCH In review Aaron Brown 2 participants 4 messages Jan 14, 2014 – Jan 15, 2014

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

cover Intel Wired LAN Driver Updates

This series contains updates to i40e from Greg Rose for VLAN filtering.

Greg Rose (2):
i40e: Warn admin to reload VF driver on port VLAN configuration.
When an administrator sets a port VLAN filters for the virtual function (VF) after the VF has already set its own VLAN filters a conflict requiring the VF be reloaded can occur. This patch logs a message indicating to the system administrator that the VF driver must be reloaded for the new port VLAN settings to take effect

i40e: Retain MAC filters on port VLAN deletion
On port VLAN deletion the list of MAC filters for the virtual function (VF) VSI were all deleted. Let's keep them around, they come in handy for keeping the VF functional.

 drivers/net/ethernet/intel/i40e/i40e_main.c        |  3 +++
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+)
Signature · 1 line
1.8.5.GIT
#1 lore raw

PATCH 1/2 i40e: Warn admin to reload VF driver on port VLAN configuration

From: Greg Rose <[email protected]>

The i40e Physical Function (PF) driver will allow the
Virtual Function (VF) driver to configure its own VLAN filters if no port VLAN filter has been configured. This leads to the possibility of the administrator setting a port VLAN filter for the VF after the VF has already configured its own VLAN filters. This leads to a conflict that can only be resolved by reloading the VF driver. When the conflicting administrative command is detected in setting the port VLAN then log a message indicating to the system administrator that he must now reload the VF driver for the new port VLAN settings to take effect.

Change-Id I8de73b885d944a043aff32226297e4249862bcad
---
 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 d04a776..ecb873c 100644
@@ -2076,6 +2076,11 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
 		goto error_pvid;
 	}
 
+	if (vsi->info.pvid == 0 && i40e_is_vsi_in_vlan(vsi))
+		dev_err(&pf->pdev->dev,
+			"VF %d has already configured VLAN filters and the administrator is requesting a port VLAN override.\nPlease unload and reload the VF driver for this change to take effect.\n",
+			vf_id);
+
 	if (vsi->info.pvid) {
 		/* kill old VLAN */
 		ret = i40e_vsi_kill_vlan(vsi, (le16_to_cpu(vsi->info.pvid) &
Signature · 1 line
1.8.5.GIT
#2 lore raw

PATCH 2/2 i40e: Retain MAC filters on port VLAN deletion

In reply to Aaron Brown

From: Greg Rose <[email protected]>

On port VLAN deletion the list of MAC filters for the virtual function (VF) VSI were all deleted. Let's keep them around, they come in handy for keeping the VF functional.

Change-Id I335e760392f274dc8b8b40efcb708f65b49d7973
---
 drivers/net/ethernet/intel/i40e/i40e_main.c        |  3 +++
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 13 +++++++++++++
 2 files changed, 16 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +3 -0
index ad04da2..e210f8f 100644
@@ -1845,7 +1845,10 @@ int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid)
 				return -ENOMEM;
 			}
 		}
+	}
 
+	/* Do not assume that I40E_VLAN_ANY should be reset to VLAN 0 */
+	if (vid > 0 && !vsi->info.pvid) {
 		list_for_each_entry(f, &vsi->mac_filter_list, list) {
 			if (i40e_find_filter(vsi, f->macaddr, I40E_VLAN_ANY,
 					     is_vf, is_netdev)) {
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +13 -0
index ecb873c..437f9e9 100644
@@ -2081,6 +2081,15 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
 			"VF %d has already configured VLAN filters and the administrator is requesting a port VLAN override.\nPlease unload and reload the VF driver for this change to take effect.\n",
 			vf_id);
 
+	/* Check for condition where there was already a port VLAN ID
+	 * filter set and now it is being deleted by setting it to zero.
+	 * Before deleting all the old VLAN filters we must add new ones
+	 * with -1 (I40E_VLAN_ANY) or otherwise we're left with all our
+	 * MAC addresses deleted.
+	 */
+	if (!(vlan_id || qos) && vsi->info.pvid)
+		ret = i40e_vsi_add_vlan(vsi, I40E_VLAN_ANY);
+
 	if (vsi->info.pvid) {
 		/* kill old VLAN */
 		ret = i40e_vsi_kill_vlan(vsi, (le16_to_cpu(vsi->info.pvid) &
@@ -2109,6 +2118,10 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
 				 vsi->back->hw.aq.asq_last_status);
 			goto error_pvid;
 		}
+		/* Kill non-vlan MAC filters - ignore error return since
+		 * there might not be any non-vlan MAC filters.
+		 */
+		i40e_vsi_kill_vlan(vsi, I40E_VLAN_ANY);
 	}
 
 	if (ret) {
Signature · 1 line
1.8.5.GIT