Skip to content

Conversation

@logicog
Copy link
Owner

@logicog logicog commented Nov 4, 2025

This fixes several issues with the existing SFP code and the link status code. It now provides full support for 2 SFP ports and uses also the link status register for ports 8 and 9 correctly.
This was tested on 5+1, 4+2 and 8+1 devices.
An example output now is e.g.:

> stat

 Port   State   Link    TxGood          TxBad           RxGood          RxBad
5       SFP OK  Down    0x00000000      0x00000000      0x00000000      0x00000000
1       On      Down    0x00000000      0x00000000      0x00000000      0x00000000
2       On      Down    0x00000000      0x00000000      0x00000000      0x00000000
3       On      Down    0x00000000      0x00000000      0x00000000      0x00000000
4       On      Down    0x00000000      0x00000000      0x00000000      0x00000000
6       SFP OK  10G     0x0000002d      0x00000000      0x00000000      0x00000000

> sfp

Slot 0 - Rate: 67  Encoding: 06
OEM             SFP-10G-SR      2   

Slot 1 - Rate: 0d  Encoding: 01
OEM             SFP-GE-SX-MM850     

For reasons of code complexity (use of additional variables), the ports are not in sequence on RTL8272 devices, only for RTL8273 this is the case.

This fixes handling of the SFP ports in the stat command.
The output of the command now is for physical ports, which however are
not shown in sequence.
The RTL8272/3 use 2 32 bit registers to indicate the MAC link speed, the
second register is used for ports 8 and 9, where 9 is the CPU port.
Use both registers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants