Skip to contentSkip to conversation

ice: Forbid trusted VFs in switchdev mode

PATCH Superseded Wojciech Drewek 3 participants 3 messages Oct 14, 2021 – Oct 15, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ice: Forbid trusted VFs in switchdev mode

During auto-merge, check for switchdev mode has been inserted in wrong place. It should be in ice_set_vf_trust not in ice_set_vf_mac.

Trusted VFs are forbidden in switchdev mode because they should be configured only from the host side.

---
 drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +5 -5
index 3e7fdd7f2e1d..edbc417f8c7d 100644
@@ -4815,11 +4815,6 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
 	struct ice_vf *vf;
 	int ret;
 
-	if (ice_is_eswitch_mode_switchdev(pf)) {
-		dev_info(ice_pf_to_dev(pf), "Trusted VF is forbidden in switchdev mode\n");
-		return -EOPNOTSUPP;
-	}
-
 	if (ice_validate_vf_id(pf, vf_id))
 		return -EINVAL;
 
@@ -4882,6 +4877,11 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)
 	struct ice_vf *vf;
 	int ret;
 
+	if (ice_is_eswitch_mode_switchdev(pf)) {
+		dev_info(ice_pf_to_dev(pf), "Trusted VF is forbidden in switchdev mode\n");
+		return -EOPNOTSUPP;
+	}
+
 	if (ice_validate_vf_id(pf, vf_id))
 		return -EINVAL;
 
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/1 ice: Forbid trusted VFs in switchdev mode

Quoted 6 lines · Wojciech Drewek

During auto-merge, check for switchdev mode has been inserted in wrong place. It should be in ice_set_vf_trust not in ice_set_vf_mac.

Trusted VFs are forbidden in switchdev mode because they should be configured only from the host side.

should have had

Fixes 1c54c839935b ("ice: enable/disable switchdev when managing VFs")
Quoted 34 lines
---
  drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +5 -5
index 3e7fdd7f2e1d..edbc417f8c7d 100644
@@ -4815,11 +4815,6 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
  	struct ice_vf *vf;
  	int ret;
 
-	if (ice_is_eswitch_mode_switchdev(pf)) {
-		dev_info(ice_pf_to_dev(pf), "Trusted VF is forbidden in switchdev mode\n");
-		return -EOPNOTSUPP;
-	}
-
  	if (ice_validate_vf_id(pf, vf_id))
  		return -EINVAL;
 
@@ -4882,6 +4877,11 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)
  	struct ice_vf *vf;
  	int ret;
 
+	if (ice_is_eswitch_mode_switchdev(pf)) {
+		dev_info(ice_pf_to_dev(pf), "Trusted VF is forbidden in switchdev mode\n");
+		return -EOPNOTSUPP;
+	}
+
  	if (ice_validate_vf_id(pf, vf_id))
  		return -EINVAL;
 
#2 lore raw

PATCH 1/1 ice: Forbid trusted VFs in switchdev mode

Quoted 12 lines

-----Original Message-----
From: Brandeburg, Jesse <[email protected]>
Sent: czwartek, 14 pa?dziernika 2021 20:16
To: Drewek, Wojciech <[email protected]>; intel-wired-lan at lists.osuosl.org
Subject: Re: [Intel-wired-lan] [PATCH net-next] ice: Forbid trusted VFs in switchdev mode

Quoted 3 lines · Wojciech Drewek

During auto-merge, check for switchdev mode has been inserted in wrong place. It should be in ice_set_vf_trust not in ice_set_vf_mac.

Quoted 6 lines
Quoted 3 lines

Trusted VFs are forbidden in switchdev mode because they should be configured only from the host side.

should have had

Fixes 1c54c839935b ("ice: enable/disable switchdev when managing VFs")

I've added tag in the second version

Quoted 36 lines
Quoted 36 lines
---
  drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +5 -5
index 3e7fdd7f2e1d..edbc417f8c7d 100644
@@ -4815,11 +4815,6 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
  	struct ice_vf *vf;
  	int ret;
 
-	if (ice_is_eswitch_mode_switchdev(pf)) {
-		dev_info(ice_pf_to_dev(pf), "Trusted VF is forbidden in switchdev mode\n");
-		return -EOPNOTSUPP;
-	}
-
  	if (ice_validate_vf_id(pf, vf_id))
  		return -EINVAL;
 
@@ -4882,6 +4877,11 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)
  	struct ice_vf *vf;
  	int ret;
 
+	if (ice_is_eswitch_mode_switchdev(pf)) {
+		dev_info(ice_pf_to_dev(pf), "Trusted VF is forbidden in switchdev mode\n");
+		return -EOPNOTSUPP;
+	}
+
  	if (ice_validate_vf_id(pf, vf_id))
  		return -EINVAL;