diff mbox series

[net,1/1] net: ethtool: mm: Allow Verify Enabled before Tx Enabled

Message ID 20250115065933.17357-1-chwee.lin.choong@intel.com (mailing list archive)
State New
Delegated to: Netdev Maintainers
Headers show
Series [net,1/1] net: ethtool: mm: Allow Verify Enabled before Tx Enabled | 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: 1 this patch: 1
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 1 blamed authors not CCed: vladimir.oltean@nxp.com; 3 maintainers not CCed: faizal.abdul.rahim@linux.intel.com vladimir.oltean@nxp.com yong.liang.choong@linux.intel.com
netdev/build_clang success Errors and warnings before: 3 this patch: 3
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: 1 this patch: 1
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 10 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest fail net-next-2025-01-15--00-00 (tests: 885)

Commit Message

Chwee-Lin Choong Jan. 15, 2025, 6:59 a.m. UTC
The current implementation of ethtool --set-mm restricts
enabling the "verify_enabled" flag unless Tx preemption
(tx_enabled) is already enabled. By default, verification
is disabled, and enabling Tx preemption immediately activates
preemption.

When verification is intended, users can only enable verification
after enabling tx_enabled, which temporarily deactivates preemption
until verification completes. This creates an inconsistent and
restrictive workflow.

This patch modifies ethtool --set-mm to allow users to pre-enable
verification locally using ethtool before Tx preemption is enabled
via ethtool or negotiated through LLDP with a link partner.

Current Workflow:
1. Enable pmac_enabled → Preemption supported
2. Enable tx_enabled → Preemption Tx enabled
3. verify_enabled defaults to off → Preemption active
4. Enable verify_enabled → Preemption deactivates → Verification starts
                         → Verification success → Preemption active.

Proposed Workflow:
1. Enable pmac_enabled → Preemption supported
2. Enable verify_enabled → Preemption supported and Verify enabled
3. Enable tx_enabled → Preemption Tx enabled → Verification starts
                     → Verification success → Preemption active.

Fixes: 35b288d6e3d4 ("net: ethtool: mm: sanitize some UAPI configurations")
Cc: <stable@vger.kernel.org>
Signed-off-by: Chwee-Lin Choong <chwee.lin.choong@intel.com>
Reviewed-by: Choong Yong Liang <yong.liang.choong@linux.intel.com>
Reviewed-by: Faizal Rahim <faizal.abdul.rahim@linux.intel.com>
---
 net/ethtool/mm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/net/ethtool/mm.c b/net/ethtool/mm.c
index 2816bb23c3ad..8a66ea3148d1 100644
--- a/net/ethtool/mm.c
+++ b/net/ethtool/mm.c
@@ -214,8 +214,8 @@  static int ethnl_set_mm(struct ethnl_req_info *req_info, struct genl_info *info)
 		return -ERANGE;
 	}
 
-	if (cfg.verify_enabled && !cfg.tx_enabled) {
-		NL_SET_ERR_MSG(extack, "Verification requires TX enabled");
+	if (cfg.verify_enabled && !cfg.pmac_enabled) {
+		NL_SET_ERR_MSG(extack, "Verify enabled requires pMAC enabled");
 		return -EINVAL;
 	}