Commit Graph
1646 Commits
Author SHA1 Message Date
d00f 6a31b4a279 doc: lacp: shorten, point to stp.md for the trap
The trap is described with STP, so the LACP page only says that it is
used. The LACP sections leave link_aggregation.md, which now points to
lacp.md, and the timing section gives the values in seconds and the
802.3ad requirements without the test history.
2026-10-14 20:18:07 -05:00
d00f 6cd1f683bb lacp: keep comments to the frame layout
The comments repeated the documentation, described tests or explained
the code to its author. What stays describes the LACPDU structures. The
timer constants are decimal, in units of the LACP timer.
2026-10-14 20:18:07 -05:00
d00f 7e90f6a126 test: build the LACP test on the real headers, drop the port_hash test
The LACP test now compiles with the shared harness flags and
sdcc_shim.h against the firmware headers, so the copies under
test/lacp/shim are gone. test_port_tables already covers the trunk hash
seed that test/port_hash checked against its own register copies.
lacp_in() declares its locals at the top, which the stricter host build
needs.
2026-10-14 20:18:07 -05:00
d00f 9bd301447b doc: lacp: lag <n> d and a static list leave LACP, new lacp_lag_set() prototype 2026-10-14 20:18:07 -05:00
d00f 9745dfe6ae lacp: drop the unused long timeout and an unrelated pvid hunk 2026-10-14 20:18:07 -05:00
d00f d4345c1bf8 lacp: keep lacp_in() and lacp_lag_set() out of the data segment
The port and group of lacp_in(), the member mask passed to
lacp_lag_set() and the compiler temporaries both functions spilled took
six bytes of DSEG, and with them six bytes of stack. The locals and the
mask live in xdata now, the partner fields go through the scratch word,
and lacp_lag_set() records the new group of a port before it releases
the old one. One byte is left: the group number passed in.
2026-10-14 20:18:07 -05:00
d00f fcaacd4429 lacp: review follow-ups
lacp_in() always leaves uip_len at 0, so the tcpip_output() after it
never ran. The LAG page names the active members by front-panel port
instead of a logical mask. The partner key is not part of selection;
say so under Known limits.
2026-10-14 20:18:07 -05:00
d00f 0f63244ca1 lacp: ignore a LACPDU that carries our own system id
Two ports of one group cabled to each other heard themselves and the
group aggregated with itself. Sandbox T24.
2026-10-14 20:18:07 -05:00
d00f 913e9780b8 httpd: leave the L2 listing as it is on main
Listing by next-address also returned the reserved-multicast entries STP
writes, shown as port 1 with a delete button, while l2_delete() still
looks up by next-unicast and so removed the unicast entry after that
index instead. The change was there to show the LACP steering entries;
delivery by trap writes none, so it goes.
2026-10-14 20:18:07 -05:00
d00f 0d748fa808 lacp: "lag <n> d" and a static member list take the group out of LACP
Both paths wrote the trunk registers directly and left the protocol
running on the group, so "lag show" said disabled while the partner kept
both links in one aggregate, and re-sending the LACP line did not repair
it because the same-ports shortcut returns early. Each path now releases
the group from LACP first; for a group that never ran LACP that is a
no-op.
2026-10-14 20:18:07 -05:00
d00f bd974e0aaf lacp: arm the partner timeout from our own LACP_Timeout
The receive machine armed current_while from the partner's TIMEOUT bit,
so against a partner on the slow rate a port whose LACPDUs stopped with
the link still up stayed in the trunk for the long timeout, two minutes.
802.3ad 43.4.12 starts the timer from the actor's own LACP_Timeout, and
we always advertise the short one: the partner sends every second and is
let go after the short timeout.

Sandbox T23 plays a slow-rate partner that goes quiet and fails on the
code before this.
2026-10-14 20:18:07 -05:00
DrDoof 56686185ce lacp: implement IEEE 802.3ad link aggregation
Dynamic link aggregation on top of the static LAGG, for RTL8372/8373:
receive, selection and mux state machines (coupled mux, one aggregator
per group), with "lacp show" to look inside. Each of the four trunk
groups runs its own aggregator on the candidate ports assigned with
"lag <n> lacp <ports>"; the engine starts with the first such group and
stops with the last.

LACPDUs reach the CPU through the reserved-multicast trap, so delivery
needs no L2 entry and nothing written per VLAN or per PVID. The trap
acts on the address before the VLAN lookup and before the ingress
filters, so a LACPDU also arrives on a port that admits tagged frames
only and on a port STP holds in blocking, neither of which a forwarded
one reaches. A trapped frame carries no VLAN tag,
so lacp_in() takes the offset of the PDU body from TRAP_RX_BODY(). The
action is set with trap_rma_set(), which leaves the flags sharing that
register alone, and "lacp off" puts the slow-protocols drop default
back. doc/lacp.md and doc/link_aggregation.md record what was measured,
including why the trap looked like a dead end at first.

The web UI gets a Static/LACP mode per group on the LAG page with live
status, and the startup-config validator knows the per-group syntax. A
host-side sandbox for the state machines runs in the test harness
together with the LAG hash check. It drives both forms of an incoming
LACPDU, so the body offset of a trapped one is covered as well.

The L2 table page iterated with the "next unicast" read method, so
static multicast entries such as an IGMP group were invisible. It now
iterates with "next address", skips L3 entries (their layout carries IP
addresses where a MAC is expected), and reports the lowest member of a
multicast entry's port mask, so such an entry shows up as a static
entry on that port.

A port taken out of LACP forgets its partner, so "lacp show" after
"lacp off" no longer reports one. Applying the same candidate set to a
group again, as the LAG page does on every Apply, leaves the trunk
alone instead of tearing it down for a second or two. lacp_in() checks
the frame length and ethertype before reading a LACPDU, so a runt or a
foreign frame on the slow-protocols address cannot leave stale buffer
bytes as a partner. The sandbox covers these three in T20-T22. On the
LAG page, LACP mode with no ports checked sends "lag N lacp off", and
the startup-config validator wants at least one port after "lacp".
2026-10-14 20:18:07 -05:00
HL Yi ed069b67fd update doc to match new split machine structure 2026-10-14 20:17:03 -05:00
HL Yi b096efd63a symlink HASIVO_S1100WP_8GT_1SX_SE.c to SWTGW218AS.c, FNS1200P.c to PCB_K0402WS_V2.c, DEFAULT_8C_1SFP.c to KP_9000_9XH_X_EU.c, as only differences are white space and comments. add SKS3200_8E1X 2026-10-13 23:48:28 -05:00
logicog 3d81df0cad Merge pull request #564 from hlyi/machine_refactoring
machine: one board definition per file, replacing the #if/#elif chain
2026-10-14 05:51:25 +02:00
d00f 03311debe6 Merge pull request #586 from mintsoft/lldp-blocking
LLDP: prevent the switch from passing LLDPDUs when lldp is enabled
2026-10-13 12:51:18 +02:00
Rob Emery e4adec9c11 Renaming for consistency and spaces -> tabs 2026-10-13 08:27:53 +01:00
Rob Emery 265a80bb25 Trapping the 01:80:c2:00:00:0e prevents the switch from passing
between ports
2026-10-12 20:32:29 +01:00
bloq 1856aeba28 Merge pull request #579 from nuclearbananaslug/patch-1
mirror: parse the monitor port argument
2026-10-12 12:01:27 -05:00
d00f b83b67d234 Merge pull request #514 from DrDoof/feat/trap
trap: deliver reserved multicast to the CPU by trap, STP first
2026-10-12 15:07:11 +02:00
Antony efd61be64e mirror: parse the monitor port argument 2026-10-12 13:04:49 +00:00
logicog da7909f422 Merge pull request #563 from dobodu/main
Add port isolation and related messages in French
2026-10-12 06:32:45 +02:00
DrDoof 14b2ce1c49 trap: deliver reserved multicast to the CPU by trap, STP first
A reserved-multicast trap goes to the port named in EXT_CPU_CTRL, which
names no port out of reset, so trapped frames were dropped at ingress.
trap_init() points it at the CPU port once at startup, and
trap_rma_set() changes only the action field of an RMA register.

A trapped frame arrives without the VLAN tag a forwarded one gets, so
TRAP_RX_BODY() gives the offset of the payload for both forms.

STP now traps its address while it runs instead of steering it with a
static L2 entry per VLAN, so turning it on no longer walks the VLAN
table and a pvid change no longer needs stp off and on. With STP off
the flooding entries are restored as before.

A trapped BPDU passes the tagged-only ingress filter that drops a
forwarded one, so the stp_setup() warning about such ports goes.
2026-10-12 01:16:28 +02:00
d00f 84d9408151 Merge pull request #447 from DrDoof/feat/ntp
ntp: keep the time from an NTP server
2026-10-11 23:20:06 +02:00
dobodu 05c0571154 Add warning for unsupported firmware images
Add french translation for fw_other
2026-10-11 21:46:50 +02:00
dobodu 8790f0dca4 Merge branch 'logicog:main' into main 2026-10-11 21:38:57 +02:00
René van Dorst 98af999304 Merge pull request #547 from brunoz78/fw-machine-check
web: warn when a firmware image was built for another machine
2026-10-11 14:16:30 +00:00
René van Dorst 0a996fa6d0 Merge pull request #548 from brunoz78/tab-hostname
web: name the browser tab after the switch hostname
2026-10-11 13:50:09 +00:00
René van Dorst 441e575661 Merge pull request #569 from DrDoof/fix/flash-security-dummy
flash: set the dummy cycles required by the security register read
2026-10-11 11:20:32 +00:00
d00f a27118a428 flash: add the dummy cycles required by the security register read
Opcode 0x48 outputs 8 dummy clocks between the address and the first data
byte. flash_configure_sio() sets DUMMYCYCLES to 0 and flash_read_security()
never raises it, so the controller captures the dummy slot as the first of
its four data bytes while the address still advances by four. The printed
output therefore shows 0xff in place of every fourth byte and skips one
content byte per transfer. flash_read_uid() already sets DUMMYCYCLES for
opcode 0x4b, which needs the same allowance.
2026-10-11 03:19:00 +02:00
d00f 01709431dc Merge pull request #446 from DrDoof/feat/dns
dns: resolve host names
2026-10-10 23:52:45 +02:00
d00f de0d413c0c dns: show the last lookup with the servers
The answer to a lookup arrives after the command has returned, so the
console of the web interface never shows it. Plain "dns" now prints the
name and the address, or whether it is still pending or failed.
2026-10-10 17:54:55 +02:00
hlyi b3ac10cae7 Update HG0402XG_V1_1.c
Change 0xFF to GPIO_NA
2026-10-10 06:31:16 -07:00
René van Dorst 4e00f5a592 Merge pull request #398 from mintsoft/lldpd
LLDP implementation
2026-10-10 09:17:00 +00:00
Rob Emery eff3f42ae1 Rewriting sim implementation to be data driven
The value for enabled should be an int, not a string
2026-10-10 09:51:50 +01:00
Rob Emery dda873a633 Moving lldp cmd parsing to be above the is_sfp check to take precedence
Needed to increase buffer size for this to send app.js

The logical port status is what is returned in the array, for
non-sequential systems we need to map through physToLog rather
than just subtracting 1

physToLog is 1 based! not 0; also fixing up typecasts

Reimplementing using an array of objects to represent ports.
The previous approach of a bitmask of logical ports, was just too
simple on devices such as the SWGT024_V2_0_MANAGED which has
gaps in the port assignments.
2026-10-10 09:51:33 +01:00
Rob Emery 9b2bd7f1b8 The tick rate has been changed now so we'll have to approximate
timing with ticks

Fixing up the log_to_phys_port assignment

2000 is about every 10 seconds, so scaling up to once every 30ish

Removing the attempt to block lldp frames,
This does not work however the hard work has been done for us in
the #514 so we can borrow that work later on
2026-10-10 09:50:38 +01:00
Rob Emery 2dfe531fe0 Fixing missing parts to make the tests pass
boot_to_html outputs 1 and 0 not true and false, making the sim match
the real implementation.
lldp.json has a hanging , in the array; so overwriting it
2026-10-10 09:50:27 +01:00
Rob Emery 72c2625121 Icon from https://github.com/logicog/RTLPlayground/pull/429#issuecomment-5687458129 2026-10-10 09:50:27 +01:00
Rob Emery 58fd1a3ccc Adding lldp.json to the simulator
Moving the global on/off onto the LLDP page

Building a table of LLDP status from the S ports. Later on, if
we wish to implement an lldp receiver we can display the remote
details here

Adding support to the cmd parser for the lldp commands
2026-10-10 09:50:01 +01:00
Rob Emery 4f1a2f04d8 Allowing commands like port 1 lldp block and port 2 lldp permit
so we are able to enable/disable lldp transmission on a specific
port.
2026-10-10 09:50:01 +01:00
Rob Emery cedc795b82 Adding UI options to enable/disable LLDP 2026-10-10 09:50:01 +01:00
Rob Emery ccf541a06b Refactor and golfing from https://github.com/logicog/RTLPlayground/pull/398#issuecomment-5654087271
I've tweaked it a little to keep the port_position in as I think
that is clearer than a random "12" in the loop later on
2026-10-10 09:50:01 +01:00
Rob Emery d5124df89e avoid SRAM 2026-10-10 09:50:01 +01:00
Rob Emery 3eacc9c8a5 LLPD_MAC_ADDR_LEN -> MAC_ADDR_LEN and memcopy instead of manually setting bytes 2026-10-10 09:50:01 +01:00
Rob Emery 735672ccf1 Moving to Bank3 2026-10-10 09:49:52 +01:00
Rob Emery 1ebee4d6e9 Implementing basic LLDP server, should send port_id message
to each port once every 30 seconds.
* Additionally fixes the on-ward passing of LLDP frames through
the switch

The ports on the case are marked 1-8 so this should reflect that
rather than being 0-based

We can send the hostname as well, this can be dynamically allocated

Let's send the model as the system description as well
2026-10-10 09:49:24 +01:00
HL Yi a6b0918885 refactoring machine.c, two files per device 2026-10-08 18:43:05 -05:00
dobodu 1d6fe690a4 Add port isolation and related messages in French 2026-10-08 22:49:58 +02:00
René van Dorst e67c928eb7 Merge pull request #465 from andreas5232/add-device-ONT-S207CW-62TS-SE
add support for ONT-S207CW-62TS-SE and identical Binardat-2G06-04210GSM
2026-10-08 06:45:31 +00:00