All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH S46 1/9] ice: Reset VF for all port VLAN changes from host
@ 2020-05-16  0:54 Tony Nguyen
  2020-05-16  0:54 ` [Intel-wired-lan] [PATCH S46 2/9] ice: Always clear QRXFLXP_CNTXT before writing new value Tony Nguyen
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: Tony Nguyen @ 2020-05-16  0:54 UTC (permalink / raw)
  To: intel-wired-lan

From: Brett Creeley <brett.creeley@intel.com>

Currently the PF is modifying the VF's port VLAN on the fly when
configured via iproute. This is okay for most cases, but if the VF
already has guest VLANs configured the PF has to remove all of those
filters so only VLAN tagged traffic that matches the port VLAN will
pass. Instead of adding functionality to track which guest VLANs have
been added, just reset the VF each time port VLAN parameters are
modified.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
---
 .../net/ethernet/intel/ice/ice_virtchnl_pf.c  | 42 +++----------------
 1 file changed, 5 insertions(+), 37 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
index abc4f2dba388..0ca614fa97bb 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
@@ -3269,7 +3269,6 @@ ice_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos,
 		     __be16 vlan_proto)
 {
 	struct ice_pf *pf = ice_netdev_to_pf(netdev);
-	struct ice_vsi *vsi;
 	struct device *dev;
 	struct ice_vf *vf;
 	u16 vlanprio;
@@ -3291,8 +3290,6 @@ ice_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos,
 	}
 
 	vf = &pf->vf[vf_id];
-	vsi = pf->vsi[vf->lan_vsi_idx];
-
 	ret = ice_check_vf_ready_for_cfg(vf);
 	if (ret)
 		return ret;
@@ -3305,44 +3302,15 @@ ice_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos,
 		return 0;
 	}
 
-	if (vlan_id || qos) {
-		/* remove VLAN 0 filter set by default when transitioning from
-		 * no port VLAN to a port VLAN. No change to old port VLAN on
-		 * failure.
-		 */
-		ret = ice_vsi_kill_vlan(vsi, 0);
-		if (ret)
-			return ret;
-		ret = ice_vsi_manage_pvid(vsi, vlanprio, true);
-		if (ret)
-			return ret;
-	} else {
-		/* add VLAN 0 filter back when transitioning from port VLAN to
-		 * no port VLAN. No change to old port VLAN on failure.
-		 */
-		ret = ice_vsi_add_vlan(vsi, 0, ICE_FWD_TO_VSI);
-		if (ret)
-			return ret;
-		ret = ice_vsi_manage_pvid(vsi, 0, false);
-		if (ret)
-			return ret;
-	}
+	vf->port_vlan_info = vlanprio;
 
-	if (vlan_id) {
+	if (vf->port_vlan_info)
 		dev_info(dev, "Setting VLAN %d, QoS 0x%x on VF %d\n",
 			 vlan_id, qos, vf_id);
+	else
+		dev_info(dev, "Clearing port VLAN on VF %d\n", vf_id);
 
-		/* add VLAN filter for the port VLAN */
-		ret = ice_vsi_add_vlan(vsi, vlan_id, ICE_FWD_TO_VSI);
-		if (ret)
-			return ret;
-	}
-	/* remove old port VLAN filter with valid VLAN ID or QoS fields */
-	if (vf->port_vlan_info)
-		ice_vsi_kill_vlan(vsi, vf->port_vlan_info & VLAN_VID_MASK);
-
-	/* keep port VLAN information persistent on resets */
-	vf->port_vlan_info = le16_to_cpu(vsi->info.pvid);
+	ice_vc_reset_vf(vf);
 
 	return 0;
 }
-- 
2.20.1


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

end of thread, other threads:[~2020-05-28 23:21 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-16  0:54 [Intel-wired-lan] [PATCH S46 1/9] ice: Reset VF for all port VLAN changes from host Tony Nguyen
2020-05-16  0:54 ` [Intel-wired-lan] [PATCH S46 2/9] ice: Always clear QRXFLXP_CNTXT before writing new value Tony Nguyen
2020-05-28 23:18   ` Bowers, AndrewX
2020-05-16  0:55 ` [Intel-wired-lan] [PATCH S46 3/9] ice: Fix inability to set channels when down Tony Nguyen
2020-05-28 23:18   ` Bowers, AndrewX
2020-05-16  0:55 ` [Intel-wired-lan] [PATCH S46 4/9] ice: Allow VF to request reset as soon as it's initialized Tony Nguyen
2020-05-28 23:18   ` Bowers, AndrewX
2020-05-16  0:55 ` [Intel-wired-lan] [PATCH S46 5/9] ice: fix function signature style format Tony Nguyen
2020-05-28 23:19   ` Bowers, AndrewX
2020-05-16  0:55 ` [Intel-wired-lan] [PATCH S46 6/9] ice: fix PCI device serial number to be lowercase values Tony Nguyen
2020-05-28 23:19   ` Bowers, AndrewX
2020-05-16  0:55 ` [Intel-wired-lan] [PATCH S46 7/9] ice: Use coalesce values from q_vector 0 when increasing q_vectors Tony Nguyen
2020-05-28 23:20   ` Bowers, AndrewX
2020-05-16  0:55 ` [Intel-wired-lan] [PATCH S46 8/9] ice: fix aRFS after flow director delete Tony Nguyen
2020-05-28 23:20   ` Bowers, AndrewX
2020-05-16  0:55 ` [Intel-wired-lan] [PATCH S46 9/9] ice: Ignore EMODE when setting PHY config Tony Nguyen
2020-05-28 23:21   ` Bowers, AndrewX
2020-05-28 23:17 ` [Intel-wired-lan] [PATCH S46 1/9] ice: Reset VF for all port VLAN changes from host Bowers, AndrewX

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.