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

[portconfig] Check supported speeds before setting port speed #1395

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[portconfig] Check supported speeds before setting port speed #1395

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 2, 2021

  • Checking whether requested speed is supported by the port by
    reading related field of PORT_TABLE:EthernetXX table in APPL_DB.
    If the field is absent or something went wrong while reading,
    then anyway set the speed to the port.

Signed-off-by: Maksym Belei Maksym_Belei@jabil.com

- What I did
Checking of supported speeds by the port has added. If the speed is unsupported, porconfig script will throw an exception and reject setting the speed to the port.

- How I did it
By reading and comparing field "supp_speed" of table PORT_TABLE:EthernetXX of APPL_DB with requested value of speed.
If there was something wrong during reading field "supp_speed", the speed will be set without checking.

- How to verify it
Execute command config interface speed with passing speed argument with value of unsupported speed.

- Previous command output (if the output of a command-line utility has changed)
Currently, command "sudo config interface speed" allows any value of speed parameter.

- New command output (if the output of a command-line utility has changed)
if to request to set some unsupported speed, portconfig script will throw an exception:

admin@sonic:~$ sudo config interface speed Ethernet36 40001
Unsupported speed 40001 for port Ethernet36. Available values: 1000,10000,25000,40000,50000,56000,100000

- Delails
Related PRs:
sonic-net/sonic-swss#1622
#1391

@dprital
Copy link
Collaborator

dprital commented Jun 14, 2021

@maksymbelei95 - are you going to promote this PR ?

pshulik
pshulik previously approved these changes Oct 18, 2021
* Checking whether requested speed is supported by the port by
  reading related field of PORT_TABLE:EthernetXX table in APPL_DB.
  If the field is absent or something went wrong while reading,
  then anyway set the speed to the port.

Signed-off-by: Maksym Belei <Maksym_Belei@jabil.com>
@pshulik
Copy link

pshulik commented Oct 22, 2021

@dprital, Could please review or add additional reviewer

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