diff options
author | Michal Swiatkowski <michal.swiatkowski@linux.intel.com> | 2024-10-21 16:26:25 -0700 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-10-29 15:24:53 +0100 |
commit | 3e13a8c0a5263827380c5090d822a92cb13767dd (patch) | |
tree | 6388c9781124b3042c468b93077b6df2b8a4092c /drivers/net | |
parent | 338c4d3902feb5be49bfda530a72c7ab860e2c9f (diff) | |
download | linux-stable-3e13a8c0a5263827380c5090d822a92cb13767dd.tar.gz linux-stable-3e13a8c0a5263827380c5090d822a92cb13767dd.tar.bz2 linux-stable-3e13a8c0a5263827380c5090d822a92cb13767dd.zip |
ice: block SF port creation in legacy mode
There is no support for SF in legacy mode. Reflect it in the code.
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Fixes: eda69d654c7e ("ice: add basic devlink subfunctions support")
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/intel/ice/devlink/devlink_port.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink_port.c b/drivers/net/ethernet/intel/ice/devlink/devlink_port.c index 928c8bdb6649..c6779d9dffff 100644 --- a/drivers/net/ethernet/intel/ice/devlink/devlink_port.c +++ b/drivers/net/ethernet/intel/ice/devlink/devlink_port.c @@ -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); } |