W_DUPLEX_MISMATCH can now fire, and a forced line rate is stored (#1259) #1260
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1260
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/speed-duplex"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
W_DUPLEX_MISMATCHcan now fire, and a forced line rate is storedFixes #1259.
The gap
Two things described a link's physical behaviour and neither could be set:
Interface.duplexwas'full'for every port in the catalogue and no command changed it — soW_DUPLEX_MISMATCH, a warningdocs/CONNECTORS.mdpublishes in its code table, could only be producedfrom inside a test that passes
duplexA/duplexBstraight tovalidateLink. The rule was documented,implemented and unreachable.
speedcommand.speed 100came back "Unrecognized command", and a port that had beenforced to 100 Mb/s went on describing itself as 1G: not stored, not printed by
show running-config, notreported by
show interfaces, and the link kept its auto-negotiated rate.show interfacesalso never reported the rate or duplex at all — the first thing you look at when a link isup but slow.
Now
speed auto|<mbps>andduplex auto|full|halfin interface config. A rate the port cannot do is refusednaming the port, the rate asked for and what it supports —
% Gi0 does not support 10G - it supports 10M, 100M, 1G— and the previous rate is left untouched, so arefusal cannot half-apply.
engine/media.js, the parser the catalogue uses, sospeed 1Gandspeed 1000are the same port rate rather than two answers from two parsers.
validateLink, which leaves negotiation one option:the cable's rate, its serialisation delay (measured: RTT 103.3 µs → 118.0 µs at 100M) and its warnings all
follow from one change. Two ends forced to different rates intersect emptily and hit the existing
"no common line rate" rule rather than a new one.
Topology.renegotiate(devId, iface)re-runs the verdict for an existing cable through the same rule thatcreated it, and takes the link down when there is no rate in common: a cable that cannot agree on a
rate does not carry frames, and those frames are counted as dropped with that reason (#1258).
show interfacesreports(forced)vs(auto), addslink runs at …when the pair caps lower thaneither port, and
link: down (no common rate with the peer)when negotiation failed.show running-configprintsspeed/duplexonly when set, so the round trip stays byte-identical anda default config gains no noise.
Found while doing it
Topology.revalidateFor(linkId)assumed the caller's A side waslink.a. Re-checking a cable from the otherend handed the validator its own port as "the peer", which came back as two
E_PORT_IN_USEerrors — a cablethat plainly exists looking like a second cable in the same socket. It now takes the device you are asking
from; the one-argument form keeps its old meaning.
Evidence
test/speed-duplex.test.js— 55 checks:show interfacessays(forced);speed 1G==speed 1000, via the catalogue parser (asserted, not assumed);moves; a non-rate word is refused;
speed auto/no speedreturn to auto and renegotiate back up;duplex halfis accepted, reported, and makesW_DUPLEX_MISMATCHfire, naming both ends — and goesquiet when the ends agree;
show interfacessays why and the status agrees, nothingcrosses, the loss is counted with the reason, and matching the rates again brings it back up;
phantom
E_PORT_IN_USE.Reverting
engine/cli.jsfails 32 of the 55; revertingengine/topology.jsfails 13.docs/CLI.mdgains "Line rate and duplex";docs/CONNECTORS.md'sW_DUPLEX_MISMATCHrow now says how toset it.
Suite: 143 suites, 6,135 assertions, 0 failed.
W_DUPLEX_MISMATCHcan now fire, and a forced line rate is stored (#1259)