Skip to content
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

[intfutil] Display RJ45 port and portchannel speed in 'M' instead of 'G' when it's <= 1000M #2110

Merged
merged 3 commits into from
Apr 18, 2022

Conversation

keboliu
Copy link
Collaborator

@keboliu keboliu commented Mar 22, 2022

What I did

To follow the convention of 1000Base-T Gigabit Ethernet, display the RJ45 port speed in 'M' if it's <= 1000M, instead of 'G', e.g:
10M, 100M, 1000M;
For the portchannel which is composed of multi RJ45 ports, will also follow the same convention.

How I did it

Verify the port type from the TRANSCEIVER_INFO table, RJ45 port or portchannel will display the port speed in the unit 'M' instead of 'G'

How to verify it

Run "show interface status" command on platforms with RJ45 port to check the port speed is correct.

Previous command output (if the output of a command-line utility has changed)

if the speed is less than 1G then it can not be displayed correctly.

admin@sonic:/# show in st
  Interface            Lanes    Speed    MTU    FEC    Alias    Vlan    Oper    Admin             Type    Asym PFC
-----------  ---------------  -------  -----  -----  -------  ------------  ------  -------  ---------------  ----------
  Ethernet0                0        G   9100    N/A     etp1        routed      up       up             RJ45         N/A
  Ethernet1                4        G   9100    N/A     etp2        routed      up       up             RJ45         N/A
  Ethernet2                8       1G   9100    N/A     etp3        routed      up       up             RJ45         N/A
  Ethernet3               12       1G   9100    N/A     etp4        routed      up       up             RJ45         N/A
  Ethernet4               16       1G   9100    N/A     etp5  PortChannel1      up       up             RJ45         N/A
  Ethernet5               20       1G   9100    N/A     etp6        routed      up       up             RJ45         N/A
  Ethernet48 192,193,194,195     100G   9100    N/A    etp49        routed      up       up  QSFP28 or later         N/A
  Ethernet52 196,197,198,199     100G   9100    N/A    etp50        routed      up       up  QSFP28 or later         N/A
  Ethernet56 200,201,202,203     100G   9100    N/A    etp51        routed      up       up  QSFP28 or later         N/A
  Ethernet60 204,205,206,207     100G   9100    N/A    etp52        routed      up       up  QSFP28 or later         N/A
PortChannel1             N/A       1G   9100    N/A      N/A        routed    down       up              N/A         N/A

New command output (if the output of a command-line utility has changed)

admin@sonic:/# show in st

   Interface            Lanes    Speed    MTU    FEC    Alias          Vlan    Oper    Admin             Type    Asym PFC
------------  ---------------  -------  -----  -----  -------  ------------  ------  -------  ---------------  ----------
   Ethernet0                0     100M   9100    N/A     etp1        routed      up       up             RJ45         N/A
   Ethernet1                4     100M   9100    N/A     etp2        routed      up       up             RJ45         N/A
   Ethernet2                8    1000M   9100    N/A     etp3        routed      up       up             RJ45         N/A
   Ethernet3               12    1000M   9100    N/A     etp4        routed      up       up             RJ45         N/A
   Ethernet4               16    1000M   9100    N/A     etp5  PortChannel1      up       up             RJ45         N/A
   Ethernet5               20    1000M   9100    N/A     etp6        routed      up       up             RJ45         N/A
  Ethernet48  192,193,194,195     100G   9100    N/A    etp49        routed      up       up  QSFP28 or later         N/A
  Ethernet52  196,197,198,199     100G   9100    N/A    etp50        routed      up       up  QSFP28 or later         N/A
  Ethernet56  200,201,202,203     100G   9100    N/A    etp51        routed      up       up  QSFP28 or later         N/A
  Ethernet60  204,205,206,207     100G   9100    N/A    etp52        routed      up       up  QSFP28 or later         N/A
PortChannel1              N/A    1000M   9100    N/A      N/A        routed    down       up              N/A         N/A

@prgeor
Copy link
Contributor

prgeor commented Apr 7, 2022

@keboliu could you please update the section "Previous command output"?

scripts/intfutil Outdated Show resolved Hide resolved
@keboliu keboliu changed the title [intfutil] support display RJ45 port and portchannel speed in 'M' instead of 'G' [intfutil] support display RJ45 port and portchannel speed in 'M' instead of 'G' when it's <= 1000M Apr 12, 2022
@keboliu
Copy link
Collaborator Author

keboliu commented Apr 12, 2022

@keboliu could you please update the section "Previous command output"?

updated.

@keboliu keboliu changed the title [intfutil] support display RJ45 port and portchannel speed in 'M' instead of 'G' when it's <= 1000M [intfutil] Display RJ45 port and portchannel speed in 'M' instead of 'G' when it's <= 1000M Apr 12, 2022
@keboliu
Copy link
Collaborator Author

keboliu commented Apr 14, 2022

@prgeor appreciated if you can check again about the updated code.

@prgeor prgeor merged commit f9dc681 into sonic-net:master Apr 18, 2022
@keboliu keboliu deleted the suppor_rj45_port_speed branch April 18, 2022 11:14
liat-grozovik pushed a commit that referenced this pull request Apr 25, 2022
- What I did
In PR #2110 introduced an enhancement to support display port speed with different unit when it is RJ45 ports, however, it only covered the case that the speed was fetched from APPL_DB.
Recently there is a change to fetch the speed from STATE_DB in some cases, the same logic also needs to be applied in this case.

- How I did it
Rename appl_db_port_speed_parse to a more generic name port_speed_parse.
Call port_speed_parse when speed is fetched from STATE_DB.
In UT test, add port status entries to mocked STATE_DB to cover the logic that get port speed from STATE_DB.

- How to verify it
UT and test it on platform support RJ45 ports

Signed-off-by: Kebo Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants