-
Notifications
You must be signed in to change notification settings - Fork 16
Sfp and Link status work #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@logicog can you rebase this PR, so I can check it again. |
|
On it. Need to push my work on IGMP aside, first. |
|
Done. |
|
Was the website correct before? The code hopefully only changes the behaviour of the console. |
|
Nope. Result from the current main fccafe8
[{"portNum":5,"isSFP":1,"enabled":1,"link":4,"txG":"0x0d","txB":"0x0","rxG":"0x017","rxB":"0x0"},{"portNum":1,"isSFP":0,"enabled":1,"link":0,"txG":"0x00","txB":"0x0","rxG":"0x00","rxB":"0x0"},{"portNum":2,"isSFP":0,"enabled":1,"link":2,"txG":"0x06b","txB":"0x0","rxG":"0x08b","rxB":"0x0"},{"portNum":3,"isSFP":0,"enabled":1,"link":0,"txG":"0x00","txB":"0x0","rxG":"0x00","rxB":"0x0"},{"portNum":4,"isSFP":0,"enabled":1,"link":0,"txG":"0x00","txB":"0x0","rxG":"0x00","rxB":"0x0"},{"portNum":6,"isSFP":1,"enabled":0,"link":1,"txG":"0x00","txB":"0x0","rxG":"0x00","rxB":"0x0"}]Console |
|
I'll add a fix for the website, too, then, now that we know that the new code in principle works. I'll try to do this by tomorrow. |
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.
This adds the speed status display of other link speeds: 100M 500M 1000M: Green 2nd LED 2.5G, 5G, 10G: Orange 2nd LED
|
The website seems to work now, too. There had been no support for the 2nd SFP slot and then also the 10G link speed display had been forgotten. I also added the now identifiable link speeds of 5G and 500M, which the switches support in HW (but not in code due to the lack of a 5G module, however one could test 500M connections, but that is an RTL proprietary link speed and hardly found anywhere, so I am not overly enthusiastic). |
|
Do you think the switch also supports the 2.5gbit-lite version? I like the idea but I think that I like a seprat windows/tooltip better. |
|
Yes, the switch does support 2.5GBit-lite, as it is a feature of the RTL8221B and RTL8224 which is probably at the heart of the RTL8372. At the SerDes one gets 1000MBit, the speed setting does not change. However, there is a difference in the SDS configuration. But that is an RTL proprietary format, like 500MBit so not sure about the usefulness. What I know is that 2.5GBit modules work. One needs the right modules, though. It should also support 5GBit, but I do not have such a module to test, they are rare and expensive. It requires different SDS settings, so without some additional code, it will probably not work. Admittedly, the tool-tip looks seriously cool, if not to say geeky. I already had though about tool-tips for the ports. I'll work on it... |
I can provide the link-changes prints, so we can figureout which port is connected which sds and also document it on the wiki.
Can we put characteristic in a struct instead of define so it is more unified?
|
I like the structures. This is allows compile-time verification. It may make the code a bit larger, but since we do not have an issue with the flash-size, this is irrelevant. I will provide a proposal using structures, later today (finally got IGMP working, need to wrap that up while it is fresh in my mind). Note that we will still need some defines, because we cannot auto-detect geometry, this has to be input to the compiler, the structures in the kernel you mention are based on auto-detection of the SoC. Device-tree btw would probably be the ideal solution, as it creates structures in the build image, which are compile-time dependent, but this comes with an enormous amount of additionally required infrastructure. Because we go for the structure, I will also add information on geometry to the .json sent to the client which ends up in a struct there. |
|
The "auto-detect" can just be a config-setting. |
|
Here the link status log. Started left at the first RJ45 port. |
|
I pushed an initial implementation. It is more for feedback and not very well tested, so far only on the 4+2 device. But it is a bit of work and easy to get wrong, so better get feedback early. |
|
@logicog Thanks, you did not added |
|
I updated to latest commit and added the fix GPIO settings,readout and document to it. Both modules do detect properly and get a link.
Great that you found it! |
|
This looks great! We are going for fully flexible device support! I just pushed support for link speed settings, try: I want to read out the SFP module parameters such as temperature, next and send the link state info and the SFP info to the web., |
|
I'll also pull in your fixes for the SWGT024. |
|
I think I got the latest changes from you into the current commits. |
Maybe put this in a separate PR? So we can merge the current work. |
|
Can we get the link speed in? This was already in the code, it was just broken, because of incorrect translation of physical port number to logical port number. OK, I added link partner display. But leaving it without the last commit would keep the code broken. I will start a new PR for the Web display and SFP properties, ok? |
|
Ok, that is fine. |
|
Cool! |
|
Correct that the SFP module don't show this information yet? |
|
Yes. This is entirely PHY information. But I need to make sure it is not called for an SFP module. We shall think about Ethernet-SFP modules later ;-) |
|
This means I can't force the SFP port to let say 1gbit or 2.5bit if I want/need to? |
|
No, you cannot. If you put a 1Gbit module on one side and the other side has a 2.5Gbit module which is able to support 1Gbit (which is not necessarily the case), you can make the 2.5Gbit module work at 1Gbit. |
|
https://superuser.com/questions/1731301/why-does-auto-port-speed-negotiation-not-work-on-sfp-fiber-uplinks |
|
I am fine to make that in a separate PR. |
|
Then let's merge. |
|
Done, great job! |
|
Thanks the great collaboration on this! |







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.:
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.