* [PATCH net 1/1] net: ethtool: mm: Allow Verify Enabled before Tx Enabled
@ 2025-01-15 6:59 Chwee-Lin Choong
2025-01-15 9:42 ` Furong Xu
0 siblings, 1 reply; 4+ messages in thread
From: Chwee-Lin Choong @ 2025-01-15 6:59 UTC (permalink / raw)
To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman
Cc: netdev, linux-kernel
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net 1/1] net: ethtool: mm: Allow Verify Enabled before Tx Enabled
2025-01-15 6:59 [PATCH net 1/1] net: ethtool: mm: Allow Verify Enabled before Tx Enabled Chwee-Lin Choong
@ 2025-01-15 9:42 ` Furong Xu
2025-01-15 9:48 ` Vladimir Oltean
0 siblings, 1 reply; 4+ messages in thread
From: Furong Xu @ 2025-01-15 9:42 UTC (permalink / raw)
To: Chwee-Lin Choong
Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, netdev, linux-kernel, Vladimir Oltean
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=GB18030, Size: 1521 bytes --]
On Wed, 15 Jan 2025 14:59:31 +0800, Chwee-Lin Choong <chwee.lin.choong@intel.com> wrote:
> 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.
>
Maybe you misunderstand the parameters of ethtool --set-mm.
tools/testing/selftests/drivers/net/hw/ethtool_mm.sh will help you :)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net 1/1] net: ethtool: mm: Allow Verify Enabled before Tx Enabled
2025-01-15 9:42 ` Furong Xu
@ 2025-01-15 9:48 ` Vladimir Oltean
2025-01-16 7:00 ` Choong, Chwee Lin
0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Oltean @ 2025-01-15 9:48 UTC (permalink / raw)
To: Furong Xu
Cc: Chwee-Lin Choong, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, netdev, linux-kernel
Thanks for copying me, Furong.
On Wed, Jan 15, 2025 at 05:42:04PM +0800, Furong Xu wrote:
> On Wed, 15 Jan 2025 14:59:31 +0800, Chwee-Lin Choong <chwee.lin.choong@intel.com> wrote:
>
> > 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.
Where the premise of the patch is wrong is here. Users don't have to
enable verification _after_ enabling TX. They can also enable
verification _at the same time_ as TX, aka within the same netlink
message. They just can't enable TX verification while TX in general is
disabled. It just doesn't make sense.
> > 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.
> >
>
> Maybe you misunderstand the parameters of ethtool --set-mm.
>
> tools/testing/selftests/drivers/net/hw/ethtool_mm.sh will help you :)
Yes, see manual_with_verification() there:
ethtool --set-mm $tx verify-enabled on tx-enabled on
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH net 1/1] net: ethtool: mm: Allow Verify Enabled before Tx Enabled
2025-01-15 9:48 ` Vladimir Oltean
@ 2025-01-16 7:00 ` Choong, Chwee Lin
0 siblings, 0 replies; 4+ messages in thread
From: Choong, Chwee Lin @ 2025-01-16 7:00 UTC (permalink / raw)
To: Vladimir Oltean, Furong Xu
Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Simon Horman, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
On Wednesday, January 15, 2025 5:49 PM, Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
>Thanks for copying me, Furong.
Hi Vladimir,
>On Wed, Jan 15, 2025 at 05:42:04PM +0800, Furong Xu wrote:
>> On Wed, 15 Jan 2025 14:59:31 +0800, Chwee-Lin Choong
><chwee.lin.choong@intel.com> wrote:
>>
>> > 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.
>
>Where the premise of the patch is wrong is here. Users don't have to enable
>verification _after_ enabling TX. They can also enable verification _at the same
>time_ as TX, aka within the same netlink message. They just can't enable TX
>verification while TX in general is disabled. It just doesn't make sense.
>
The intent of this patch is tied to the earlier discussion about avoiding LLDP operations
that forcefully enable verification whenever preemption support is advertised by the link partner.
Since we are currently seeking clarification from Avnu on their test requirements regarding
scenarios with LLDP + verification disabled, I’ll provide an update once we hear back from Avnu.
>> > 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.
>> >
>>
>> Maybe you misunderstand the parameters of ethtool --set-mm.
>>
>> tools/testing/selftests/drivers/net/hw/ethtool_mm.sh will help you :)
>
>Yes, see manual_with_verification() there:
>
>ethtool --set-mm $tx verify-enabled on tx-enabled on
Thanks,
CL
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-01-16 7:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-15 6:59 [PATCH net 1/1] net: ethtool: mm: Allow Verify Enabled before Tx Enabled Chwee-Lin Choong
2025-01-15 9:42 ` Furong Xu
2025-01-15 9:48 ` Vladimir Oltean
2025-01-16 7:00 ` Choong, Chwee Lin
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).