autoneg bug
This commit is contained in:
@@ -553,8 +553,30 @@ class BridgeLinkStateWatcher:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
cmd = [_ETHTOOL_BIN, "-s", target_ifname]
|
cmd = [_ETHTOOL_BIN, "-s", target_ifname]
|
||||||
|
change_summary: Optional[str] = None
|
||||||
if source_profile.autoneg is True:
|
if source_profile.autoneg is True:
|
||||||
cmd.extend(["autoneg", "on"])
|
if source_profile.speed_mbps is not None and source_profile.duplex is not None:
|
||||||
|
# A remote peer can pull this port down to a lower negotiated speed while autoneg
|
||||||
|
# stays enabled locally. Mirror the effective link mode on sibling ports so they
|
||||||
|
# present the same downstream behavior even though the peer's exact advertisement
|
||||||
|
# bitmap is not visible from this host.
|
||||||
|
cmd.extend(
|
||||||
|
[
|
||||||
|
"speed",
|
||||||
|
str(source_profile.speed_mbps),
|
||||||
|
"duplex",
|
||||||
|
source_profile.duplex,
|
||||||
|
"autoneg",
|
||||||
|
"off",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
change_summary = (
|
||||||
|
f"{target_ifname} link={source_profile.speed_mbps}Mb/"
|
||||||
|
f"{source_profile.duplex}/forced-from-autoneg-peer"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
cmd.extend(["autoneg", "on"])
|
||||||
|
change_summary = f"{target_ifname} link=autoneg-on"
|
||||||
elif source_profile.autoneg is False and source_profile.speed_mbps is not None and source_profile.duplex is not None:
|
elif source_profile.autoneg is False and source_profile.speed_mbps is not None and source_profile.duplex is not None:
|
||||||
cmd.extend(
|
cmd.extend(
|
||||||
[
|
[
|
||||||
@@ -566,6 +588,10 @@ class BridgeLinkStateWatcher:
|
|||||||
"off",
|
"off",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
change_summary = (
|
||||||
|
f"{target_ifname} link={source_profile.speed_mbps}Mb/"
|
||||||
|
f"{source_profile.duplex}/autoneg-off"
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@@ -589,11 +615,7 @@ class BridgeLinkStateWatcher:
|
|||||||
self.bridge_name,
|
self.bridge_name,
|
||||||
source_profile,
|
source_profile,
|
||||||
)
|
)
|
||||||
return (
|
return change_summary
|
||||||
f"{target_ifname} link="
|
|
||||||
f"{source_profile.speed_mbps or 'unknown'}Mb/{source_profile.duplex or 'unknown'}/"
|
|
||||||
f"{'autoneg-on' if source_profile.autoneg else 'autoneg-off'}"
|
|
||||||
)
|
|
||||||
|
|
||||||
def _suppress_other_members(self, states: dict[str, MemberLinkState], failing_members: list[str]) -> None:
|
def _suppress_other_members(self, states: dict[str, MemberLinkState], failing_members: list[str]) -> None:
|
||||||
desired_suppressed = set(states) - set(failing_members)
|
desired_suppressed = set(states) - set(failing_members)
|
||||||
|
|||||||
Reference in New Issue
Block a user