net: ethtool: mm: Allow Verify Enabled before Tx Enabled
PATCH 1/1 net: ethtool: mm: Allow Verify Enabled before Tx Enabled
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.
--- net/ethtool/mm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ethtool/mm.c +2 -2
@@ -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 ; }
Signature · 1 line
2.34.1
Quoted 22 lines · Chwee-Lin Choong
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. Enablepmac_enabled→ Preemption supported
2. Enabletx_enabled→ Preemption Tx enabled
3.verify_enableddefaults to off → Preemption active
4. Enableverify_enabled→ Preemption deactivates → Verification starts → Verification success → Preemption active.
Quoted 6 lines
Proposed Workflow:
1. Enablepmac_enabled→ Preemption supported
2. Enableverify_enabled→ Preemption supported and Verify enabled
3. Enabletx_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 :)
Vladimir Oltean
maintainerThanks for copying me, Furong.
Quoted 8 lines · Furong Xu
Quoted 6 lines · Chwee-Lin Choong
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.
Quoted 4 lines
Quoted 4 lines
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.
Quoted 18 lines
Quoted 11 lines
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. Enablepmac_enabled→ Preemption supported
2. Enabletx_enabled→ Preemption Tx enabled
3.verify_enableddefaults to off → Preemption active
4. Enableverify_enabled→ Preemption deactivates → Verification starts → Verification success → Preemption active.Quoted 6 lines
Proposed Workflow:
1. Enablepmac_enabled→ Preemption supported
2. Enableverify_enabled→ Preemption supported and Verify enabled
3. Enabletx_enabled→ Preemption Tx enabled → Verification starts → Verification success → Preemption active.
Quoted 3 lines
Maybe you misunderstand the parameters of ethtool --set-mm.
tools/testing/selftests/drivers/net/hw/ethtool_mm.shwill help you :)
Yes, see manual_with_verification() there:
ethtool --set-mm $tx verify-enabled on tx-enabled on
Quoted 1 line · Vladimir Oltean
Thanks for copying me, Furong.
Hi Vladimir,
Quoted 15 lines · Furong Xu
Quoted 1 line
On Wed, 15 Jan 2025 14:59:31 +0800, Chwee-Lin Choong
Quoted 11 lines · <[email protected]> wrote:
Quoted 11 lines
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.
Quoted 5 lines
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
_atthe sametime_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.
Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
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. Enablepmac_enabled→ Preemption supported 2. Enabletx_enabled→ Preemption Tx enabled 3.verify_enableddefaults to off → Preemption active 4. Enableverify_enabled→ Preemption deactivates → Verification starts
→ Verification success → Preemption active.Proposed Workflow:
1. Enablepmac_enabled→ Preemption supported 2. Enableverify_enabled→ Preemption supported and Verify enabled 3. Enabletx_enabled→ Preemption Tx enabled → Verification starts → Verification success → Preemption active.
Quoted 7 lines
Quoted 3 lines
Maybe you misunderstand the parameters of ethtool --set-mm.
tools/testing/selftests/drivers/net/hw/ethtool_mm.shwill help you :)Yes, see
manual_with_verification()there:ethtool --set-mm $tx verify-enabled on tx-enabled on
Thanks,
CL