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

[config] Add checking of speed to "config interface speed" command #1391

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

Conversation

ghost
Copy link

@ghost ghost commented Jan 29, 2021

  • Checking whether the desired speed is one of standard Ethernet speed
    to reject setting unsupportable port speeds.

Signed-off-by: d-dashkov Dmytro_Dashkov@Jabil.com
Signed-off-by: Maksym Belei Maksym_Belei@jabil.com

- What I did
Resolves sonic-net/sonic-buildimage#6424
Checking of speed parameter has added to disallow changing of port speed to non-standard values, which are not supported by the system.

- How I did it
Resolves sonic-net/sonic-buildimage#6424
List of standard port speeds has added. The passed speed parameter is being checked by the system. If the speed parameter value is not in port speed list, the system will return error to the CLI output.

- How to verify it

  1. sudo config interface speed Ethernet8 12345678901
    The system will return the next error: Error: Invalid value for "<interface_speed>": 12345678901 is not in the valid range of 1000 to 400000.

  2. sudo config interface speed Ethernet8 123456
    The system will return the next error: Error: The speed 123456 is not allowed. Allowed values: [1000, 2500, 5000, 10000, 25000, 40000, 50000, 100000, 200000, 400000]

  3. sudo config interface speed Ethernet8 10000
    The system will allow the speed. Command show int status will display 10G speed for the interface.

- Previous command output (if the output of a command-line utility has changed)
Command config interface speed was allowing any speed value, even wrong.

- New command output (if the output of a command-line utility has changed)
New behavior is described above.

@ghost ghost force-pushed the fix_int_speed branch from 2d6d39d to 26a7743 Compare January 29, 2021 10:58
* Checking whether the desired speed is one of standard Ethernet speed
  to reject setting unsupportable port speeds.

Signed-off-by: d-dashkov <Dmytro_Dashkov@Jabil.com>
Signed-off-by: Maksym Belei <Maksym_Belei@jabil.com>
@ghost
Copy link
Author

ghost commented Jan 29, 2021

retest this please

@ghost ghost marked this pull request as ready for review January 29, 2021 14:53
@ghost
Copy link
Author

ghost commented Feb 1, 2021

retest this please

@dprital
Copy link
Collaborator

dprital commented Jun 14, 2021

@maksymbelei95 - are you going to promote this PR ?

@pshulik
Copy link

pshulik commented Oct 22, 2021

@dprital Could you please review it or assign reviewers

@pshulik
Copy link

pshulik commented Nov 12, 2021

@dprital Could you please review it or assign reviewers

stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
[201911] Fixes for NAT lgtm alerts (sonic-net#1391)

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
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.

Config utility allows incorrect values for interface speed
3 participants