netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chwee-Lin Choong <chwee.lin.choong@intel.com>
To: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net 1/1] net: ethtool: mm: Allow Verify Enabled before Tx Enabled
Date: Wed, 15 Jan 2025 14:59:31 +0800	[thread overview]
Message-ID: <20250115065933.17357-1-chwee.lin.choong@intel.com> (raw)

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


             reply	other threads:[~2025-01-14 23:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-15  6:59 Chwee-Lin Choong [this message]
2025-01-15  9:42 ` [PATCH net 1/1] net: ethtool: mm: Allow Verify Enabled before Tx Enabled Furong Xu
2025-01-15  9:48   ` Vladimir Oltean
2025-01-16  7:00     ` Choong, Chwee Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250115065933.17357-1-chwee.lin.choong@intel.com \
    --to=chwee.lin.choong@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).