Skip to contentSkip to conversation

ice: block SF port creation in legacy mode

PATCH In review Michal Swiatkowski 3 participants 3 messages Oct 4, 2024 – Oct 16, 2024

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

PATCH 1/1 ice: block SF port creation in legacy mode

There is no support for SF in legacy mode. Reflect it in the code.

Fixes eda69d654c7e ("ice: add basic devlink subfunctions support")
---
 drivers/net/ethernet/intel/ice/devlink/devlink_port.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/ethernet/intel/ice/devlink/devlink_port.c +6 -0
index 928c8bdb6649..c6779d9dffff 100644
@@ -989,5 +989,11 @@ ice_devlink_port_new(struct devlink *devlink,
 	if (err)
 		return err;
 
+	if (!ice_is_eswitch_mode_switchdev(pf)) {
+		NL_SET_ERR_MSG_MOD(extack,
+				   "SF ports are only supported in eswitch switchdev mode");
+		return -EOPNOTSUPP;
+	}
+
 	return ice_alloc_dynamic_port(pf, new_attr, extack, devlink_port);
 }
Signature · 1 line
2.42.0
Reviewed-by Przemek Kitszel Tested-by on v1 1/1
#2 lore raw
In reply to Michal Swiatkowski

From: Intel-wired-lan <[email protected]> on behalf of Michal Swiatkowski <[email protected]> Sent: Friday, October 4, 2024 8:55 AM
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; Kitszel, Przemyslaw <[email protected]> Subject: [Intel-wired-lan] [iwl-net v1] ice: block SF port creation in legacy mode

There is no support for SF in legacy mode. Reflect it in the code.

Fixes eda69d654c7e ("ice: add basic devlink subfunctions support")

---
 drivers/net/ethernet/intel/ice/devlink/devlink_port.c | 6 ++++++

 1 file changed, 6 insertions(+)
drivers/net/ethernet/intel/ice/devlink/devlink_port.c +0 -0
index 928c8bdb6649..c6779d9dffff 100644
@@ -989,5 +989,11 @@ ice_devlink_port_new(struct devlink *devlink,

         if (err)
                 return err;

+       if (!ice_is_eswitch_mode_switchdev(pf)) {
+               NL_SET_ERR_MSG_MOD(extack,
+                                  "SF ports are only supported in eswitch switchdev mode"); +               return -EOPNOTSUPP;
+       }
+
         return ice_alloc_dynamic_port(pf, new_attr, extack, devlink_port);
 }
--
2.42.0