]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: ethtool: mm: reset verification status when link is down
authorFaizal Rahim <faizal.abdul.rahim@linux.intel.com>
Tue, 18 Mar 2025 03:07:31 +0000 (23:07 -0400)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 18 Apr 2025 15:43:10 +0000 (08:43 -0700)
When the link partner goes down, "ethtool --show-mm" still displays
"Verification status: SUCCEEDED," reflecting a previous state that is
no longer valid.

Reset the verification status to ensure it reflects the current state.

Reviewed-by: Furong Xu <0x1207@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Faizal Rahim <faizal.abdul.rahim@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
net/ethtool/mm.c

index bfd988464d7d0bd31bb2fa6d9de7247455c63fd3..ad9b4003400334ec2d3a6b2bf6390928c39f4b7f 100644 (file)
@@ -415,6 +415,10 @@ void ethtool_mmsv_link_state_handle(struct ethtool_mmsv *mmsv, bool up)
                /* New link => maybe new partner => new verification process */
                ethtool_mmsv_apply(mmsv);
        } else {
+               /* Reset the reported verification state while the link is down */
+               if (mmsv->verify_enabled)
+                       mmsv->status = ETHTOOL_MM_VERIFY_STATUS_INITIAL;
+
                /* No link or pMAC not enabled */
                ethtool_mmsv_configure_pmac(mmsv, false);
                ethtool_mmsv_configure_tx(mmsv, false);