selftests: drv-net: pause: Avoid cleanup failures for unsupported link settings

pause_setup() saves the initial link settings before tests run. Devices
that report link settings but do not support changing them can reject even
a no-op restore with EOPNOTSUPP. That turns pause tests that use
pause_setup() into cleanup failures.

Fix this by queuing link-setting restores only after a link-setting
request has succeeded. Keep pause_test_support coverage for devices that
cannot change link settings by falling back to forced MAC pause on the
current link. Run the extra link autoneg on/off checks only when those
link setting requests are accepted. Tests that force link autoneg off,
including pause_autoneg_link_autoneg(), now queue their own autoneg-on
restore after the force request succeeds.

Results on fbnic:

  Before: # Totals: pass:0 fail:4 xfail:0 xpass:0 skip:24 error:0
  After:  # Totals: pass:4 fail:0 xfail:0 xpass:0 skip:24 error:0

Signed-off-by: Mohsin Bashir <hmohsin@meta.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/20261113022717.1914724-1-mohsin.bashr@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 file changed