diff mbox series

[iwl-net,v1] ice: block SF port creation in legacy mode

Message ID 20241004065526.7306-1-michal.swiatkowski@linux.intel.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [iwl-net,v1] ice: block SF port creation in legacy mode | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 6 this patch: 6
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 3 blamed authors not CCed: anthony.l.nguyen@intel.com jacob.e.keller@intel.com piotr.raczynski@intel.com; 7 maintainers not CCed: pabeni@redhat.com jacob.e.keller@intel.com kuba@kernel.org horms@kernel.org edumazet@google.com anthony.l.nguyen@intel.com piotr.raczynski@intel.com
netdev/build_clang success Errors and warnings before: 6 this patch: 6
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 5 this patch: 5
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 2 this patch: 2
netdev/source_inline success Was 0 now: 0

Commit Message

Michal Swiatkowski Oct. 4, 2024, 6:55 a.m. UTC
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>
---
 drivers/net/ethernet/intel/ice/devlink/devlink_port.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Kalesh Anakkur Purayil Oct. 4, 2024, 8:12 a.m. UTC | #1
On Fri, Oct 4, 2024 at 12:25 PM Michal Swiatkowski
<michal.swiatkowski@linux.intel.com> wrote:
>
> 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>

LGTM,
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Romanowski, Rafal Oct. 16, 2024, 8:58 a.m. UTC | #2
From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> on behalf of Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Sent: Friday, October 4, 2024 8:55 AM
To: intel-wired-lan@lists.osuosl.org <intel-wired-lan@lists.osuosl.org>
Cc: netdev@vger.kernel.org <netdev@vger.kernel.org>; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>
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.

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>
---
 drivers/net/ethernet/intel/ice/devlink/devlink_port.c | 6 ++++++
 1 file changed, 6 insertions(+)

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);
 }
--
2.42.0



Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
diff mbox series

Patch

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);
 }