Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[port] Fix port speed set (sonic-net#1952)
What I did Wrong port speed is set if included as a substring in a speed literal. For example if we have a valid supported speeds for a port with 4 lanes: 40000 and 100000. Then if we try to set 4000. sudo config interface speed Ethernet0 4000 As a result, we will get a wrong set speed 4G: dut:~$ show interfaces status Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC --------- ------ ------ ---- ---- -------- ----- ----- ------ ----------- ----- Ethernet0 0,1,2,3 4G 9100 rs Ethernet1/1 routed up up QSFP28 or later off How I did it Fixed finding the target (set) speed in the supported speeds list. How to verify it Set the wrong speed, which included as a substring in a speed literal. For example, for a speed 40000 it is 4000. If the wrong speed is set, an error message should appear: admin@sonic:~$ sudo config interface speed Ethernet0 4000 Invalid speed specified: 4000 Valid speeds:40000,100000 Only speeds from the list of "Valid speeds" have been successfully set. sudo config interface speed Ethernet0 40000 Signed-off-by: Mykola Gerasymenko <mykolax.gerasymenko@intel.com>
- Loading branch information