-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
luci-mod-status: 29_ports.js: improve speed formatting #7546
Conversation
Good idea. Perhaps we can exclude all those extra cases and make the switch case smarter and default to default: e.innerText = '%d\u202fGbE%s'.format(speed/1000, d); |
Not sure what will happen at 1TBit. Maybe something smarter like |
Sure, this would just add up in the future ... so does something like this make sense? (will test it then): switch (true) {
case (speed < 1000): e.innerText = '%d\u202fM'.format(speed) + d; break;
case (speed == 1000): e.innerText = '1\u202fGbE' + d; break;
case (speed > 1000000): e.innerText = '%d\u202fTbE'.format(speed); break;
default: e.innerText = '%d\u202fGbE'.format(speed); break;
} Not sure if there are other corner cases which need to be caught ... |
Yeah, something like that. You'll need to |
75af124
to
11f5ff5
Compare
okay, changed it. Hopefully got everything correct ;) EDIT: lines got quite long so added a few newlines |
Yeah, sweet. Did you give it a spin on your monster NICs? |
Yep, tested this on various devices and verified it's working for 100M, 1G, 2.5G, 10G, 25G and 100G Sadly nothing to test with Tbit/s or Pbit/s ;) |
Aggregate :D |
Hmm. So 2.5Gb prints as so? We don't need to change |
Ohh sorry, you're right ... prints as |
probably change that for PbE and TbE too? |
Improve speed formatting to make it more flexible and support speeds beyond 40 GbE. Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
I wasn't certain whether |
BTW did you have to build your own image, or is x86(_64?) generic good enough for the Mellanox platform? |
Changed GbE, TbE and PbE to
x86_64 plus some kmod driver/firmware packages are needed. Luckily there's just an Intel CPU in these switches. There's already a wiki pages describing that https://openwrt.org/toh/mellanox/spectrum |
11f5ff5
to
f10234d
Compare
Great. Tested. Thanks @jonasjelonek |
Signed-off-by: <my@email.address>
row (viagit commit --signoff
)<package name>: title
first line subject for packagesPKG_VERSION
in the MakefileThis adds more cases for a few link speeds beyond 40 GbE, i.e. for 50 GbE, 100 GbE and 200 GbE in speed formatting for luci-mod-status. While there are currently only a few devices where this may be useful, we actually operate some 200G switches and x86 devices with 200G/100G NICs.
required to bump PKG_VERSION ?