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

[master] Filter port invalid MTU configuration (#6260) #1329

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

Conversation

tim-rj
Copy link
Contributor

@tim-rj tim-rj commented Dec 23, 2020

Signed-off-by: tim-rj sonic_rd@ruijie.com.cn

- What I did
fix sonic-net/sonic-buildimage#6260
- How I did it

Adjust the MTU value to the range of [68,9216] and print message for invalid config.

- How to verify it

Use "config interface mtu Ethernet1 10" command to configure the port MTU. The interface prompts for incorrect input parameters and gives the correct parameter range.

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

root@sonic:/home/admin# config interface mtu  Ethernet1 10
root@sonic:/home/admin# show interfaces status
  Interface            Lanes    Speed    MTU    FEC               Alias    Vlan    Oper    Admin            Type    Asym PFC
-----------  ---------------  -------  -----  -----  ------------------  ------  ------  -------  --------------  ----------
  Ethernet1                1      25G     10    N/A   twentyfiveGigE0/1  routed    down       up             N/A         off
  Ethernet2                2      25G   9100    N/A   twentyfiveGigE0/2  routed    down       up             N/A         off
  Ethernet3                3      25G   9100    N/A   twentyfiveGigE0/3  routed    down       up             N/A         off
  Ethernet4                4      25G   9100    N/A   twentyfiveGigE0/4  routed    down       up             N/A         off
  Ethernet5                5      25G   9100    N/A   twentyfiveGigE0/5  routed    down       up             N/A         off
  Ethernet6                6      25G   9100    N/A   twentyfiveGigE0/6  routed    down       up             N/A         off
  Ethernet7                7      25G   9100    N/A   twentyfiveGigE0/7  routed    down       up             N/A         off
  Ethernet8                8      25G   9100    N/A   twentyfiveGigE0/8  routed    down       up             N/A         off
  Ethernet9               13      25G   9100    N/A   twentyfiveGigE0/9  routed    down       up             N/A         off
 Ethernet10               14      25G   9100    N/A  twentyfiveGigE0/10  routed    down       up             N/A         off
 Ethernet11               15      25G   9100    N/A  twentyfiveGigE0/11   trunk    down       up             N/A         off
 Ethernet12               16      25G   9100    N/A  twentyfiveGigE0/12  routed    down       up             N/A         off
 Ethernet13               21      25G   9100    N/A  twentyfiveGigE0/13  routed    down       up             N/A         off
 Ethernet14               22      25G   9100    N/A  twentyfiveGigE0/14  routed    down       up             N/A         off
 Ethernet15               23      25G   9100    N/A  twentyfiveGigE0/15  routed    down       up             N/A         off
 Ethernet16               24      25G   9100    N/A  twentyfiveGigE0/16  routed    down       up             N/A         off
 Ethernet17               29      25G   9100    N/A  twentyfiveGigE0/17  routed    down       up             N/A         off
 Ethernet18               30      25G   9100    N/A  twentyfiveGigE0/18  routed    down       up             N/A         off
 Ethernet19               31      25G   9100    N/A  twentyfiveGigE0/19  routed      up       up  SFP/SFP+/SFP28         off
 Ethernet20               32      25G   9100    N/A  twentyfiveGigE0/20  routed    down       up             N/A         off
 Ethernet21               33      25G   9100    N/A  twentyfiveGigE0/21  routed    down       up             N/A         off
 Ethernet22               34      25G   9100    N/A  twentyfiveGigE0/22  routed    down       up             N/A         off
 Ethernet23               35      25G   9100    N/A  twentyfiveGigE0/23  routed    down       up             N/A         off
 Ethernet24               36      25G   9100    N/A  twentyfiveGigE0/24  routed    down       up             N/A         off
 Ethernet25               41      25G   9100    N/A  twentyfiveGigE0/25  routed      up       up  SFP/SFP+/SFP28         off
 Ethernet26               42      25G   9100    N/A  twentyfiveGigE0/26  routed    down       up             N/A         off
 Ethernet27               43      25G   9100    N/A  twentyfiveGigE0/27  routed    down       up             N/A         off
 Ethernet28               44      25G   9100    N/A  twentyfiveGigE0/28  routed    down       up             N/A         off
 Ethernet29               49      25G   9100    N/A  twentyfiveGigE0/29  routed    down       up             N/A         off
 Ethernet30               50      25G   9100    N/A  twentyfiveGigE0/30  routed    down       up             N/A         off
 Ethernet31               51      25G   9100    N/A  twentyfiveGigE0/31  routed    down       up             N/A         off
 Ethernet32               52      25G   9100    N/A  twentyfiveGigE0/32  routed    down       up             N/A         off
 Ethernet33               57      25G   9100    N/A  twentyfiveGigE0/33  routed    down       up             N/A         off
 Ethernet34               58      25G   9100    N/A  twentyfiveGigE0/34  routed    down       up             N/A         off
 Ethernet35               59      25G   9100    N/A  twentyfiveGigE0/35  routed    down       up             N/A         off
 Ethernet36               60      25G   9100    N/A  twentyfiveGigE0/36  routed    down       up             N/A         off
 Ethernet37               61      25G   9100    N/A  twentyfiveGigE0/37  routed    down       up             N/A         off
 Ethernet38               62      25G   9100    N/A  twentyfiveGigE0/38  routed    down       up             N/A         off
 Ethernet39               63      25G   9100    N/A  twentyfiveGigE0/39  routed    down       up             N/A         off
 Ethernet40               64      25G   9100    N/A  twentyfiveGigE0/40  routed    down       up             N/A         off
 Ethernet41               65      25G   9100    N/A  twentyfiveGigE0/41  routed    down       up             N/A         off
 Ethernet42               66      25G   9100    N/A  twentyfiveGigE0/42  routed    down       up             N/A         off
 Ethernet43               67      25G   9100    N/A  twentyfiveGigE0/43  routed    down       up             N/A         off
 Ethernet44               68      25G   9100    N/A  twentyfiveGigE0/44  routed    down       up             N/A         off
 Ethernet45               69      25G   9100    N/A  twentyfiveGigE0/45  routed    down       up             N/A         off
 Ethernet46               70      25G   9100    N/A  twentyfiveGigE0/46  routed    down       up             N/A         off
 Ethernet47               71      25G   9100    N/A  twentyfiveGigE0/47  routed    down       up             N/A         off
 Ethernet48               72      25G   9100    N/A  twentyfiveGigE0/48  routed    down       up             N/A         off
 Ethernet49      85,86,87,88     100G   9100     rs      hundredGigE0/1  routed    down       up             N/A         off
 Ethernet50      77,78,79,80     100G   9100     rs      hundredGigE0/2  routed    down       up             N/A         off
 Ethernet51     97,98,99,100     100G   9100     rs      hundredGigE0/3  routed    down       up             N/A         off
 Ethernet52      93,94,95,96     100G   9100     rs      hundredGigE0/4  routed    down       up             N/A         off
 Ethernet53  113,114,115,116     100G   9100     rs      hundredGigE0/5  routed    down       up             N/A         off
 Ethernet54  105,106,107,108     100G   9100     rs      hundredGigE0/6  routed    down       up             N/A         off
 Ethernet55  121,122,123,124     100G   9100     rs      hundredGigE0/7  routed    down       up             N/A         off
 Ethernet56  125,126,127,128     100G   9100     rs      hundredGigE0/8  routed    down       up             N/A         off

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

root@sonic:/home/admin# config interface mtu  Ethernet1 10
Usage: config interface mtu [OPTIONS] <interface_name> <interface_mtu>
Try "config interface mtu -h" for help.

Error: Invalid value for "<interface_mtu>": 10 is not in the valid range of 68 to 9216.
root@sonic:/home/admin# show interfaces status
  Interface            Lanes    Speed    MTU    FEC               Alias    Vlan    Oper    Admin            Type    Asym PFC
-----------  ---------------  -------  -----  -----  ------------------  ------  ------  -------  --------------  ----------
  Ethernet1                1      25G   9100    N/A   twentyfiveGigE0/1  routed    down       up             N/A         off
  Ethernet2                2      25G   9100    N/A   twentyfiveGigE0/2  routed    down       up             N/A         off
  Ethernet3                3      25G   9100    N/A   twentyfiveGigE0/3  routed    down       up             N/A         off
  Ethernet4                4      25G   9100    N/A   twentyfiveGigE0/4  routed    down       up             N/A         off
  Ethernet5                5      25G   9100    N/A   twentyfiveGigE0/5  routed    down       up             N/A         off
  Ethernet6                6      25G   9100    N/A   twentyfiveGigE0/6  routed    down       up             N/A         off
  Ethernet7                7      25G   9100    N/A   twentyfiveGigE0/7  routed    down       up             N/A         off
  Ethernet8                8      25G   9100    N/A   twentyfiveGigE0/8  routed    down       up             N/A         off
  Ethernet9               13      25G   9100    N/A   twentyfiveGigE0/9  routed    down       up             N/A         off
 Ethernet10               14      25G   9100    N/A  twentyfiveGigE0/10  routed    down       up             N/A         off
 Ethernet11               15      25G   9100    N/A  twentyfiveGigE0/11   trunk    down       up             N/A         off
 Ethernet12               16      25G   9100    N/A  twentyfiveGigE0/12  routed    down       up             N/A         off
 Ethernet13               21      25G   9100    N/A  twentyfiveGigE0/13  routed    down       up             N/A         off
 Ethernet14               22      25G   9100    N/A  twentyfiveGigE0/14  routed    down       up             N/A         off
 Ethernet15               23      25G   9100    N/A  twentyfiveGigE0/15  routed    down       up             N/A         off
 Ethernet16               24      25G   9100    N/A  twentyfiveGigE0/16  routed    down       up             N/A         off
 Ethernet17               29      25G   9100    N/A  twentyfiveGigE0/17  routed    down       up             N/A         off
 Ethernet18               30      25G   9100    N/A  twentyfiveGigE0/18  routed    down       up             N/A         off
 Ethernet19               31      25G   9100    N/A  twentyfiveGigE0/19  routed      up       up  SFP/SFP+/SFP28         off
 Ethernet20               32      25G   9100    N/A  twentyfiveGigE0/20  routed    down       up             N/A         off
 Ethernet21               33      25G   9100    N/A  twentyfiveGigE0/21  routed    down       up             N/A         off
 Ethernet22               34      25G   9100    N/A  twentyfiveGigE0/22  routed    down       up             N/A         off
 Ethernet23               35      25G   9100    N/A  twentyfiveGigE0/23  routed    down       up             N/A         off
 Ethernet24               36      25G   9100    N/A  twentyfiveGigE0/24  routed    down       up             N/A         off
 Ethernet25               41      25G   9100    N/A  twentyfiveGigE0/25  routed      up       up  SFP/SFP+/SFP28         off
 Ethernet26               42      25G   9100    N/A  twentyfiveGigE0/26  routed    down       up             N/A         off
 Ethernet27               43      25G   9100    N/A  twentyfiveGigE0/27  routed    down       up             N/A         off
 Ethernet28               44      25G   9100    N/A  twentyfiveGigE0/28  routed    down       up             N/A         off
 Ethernet29               49      25G   9100    N/A  twentyfiveGigE0/29  routed    down       up             N/A         off
 Ethernet30               50      25G   9100    N/A  twentyfiveGigE0/30  routed    down       up             N/A         off
 Ethernet31               51      25G   9100    N/A  twentyfiveGigE0/31  routed    down       up             N/A         off
 Ethernet32               52      25G   9100    N/A  twentyfiveGigE0/32  routed    down       up             N/A         off
 Ethernet33               57      25G   9100    N/A  twentyfiveGigE0/33  routed    down       up             N/A         off
 Ethernet34               58      25G   9100    N/A  twentyfiveGigE0/34  routed    down       up             N/A         off
 Ethernet35               59      25G   9100    N/A  twentyfiveGigE0/35  routed    down       up             N/A         off
 Ethernet36               60      25G   9100    N/A  twentyfiveGigE0/36  routed    down       up             N/A         off
 Ethernet37               61      25G   9100    N/A  twentyfiveGigE0/37  routed    down       up             N/A         off
 Ethernet38               62      25G   9100    N/A  twentyfiveGigE0/38  routed    down       up             N/A         off
 Ethernet39               63      25G   9100    N/A  twentyfiveGigE0/39  routed    down       up             N/A         off
 Ethernet40               64      25G   9100    N/A  twentyfiveGigE0/40  routed    down       up             N/A         off
 Ethernet41               65      25G   9100    N/A  twentyfiveGigE0/41  routed    down       up             N/A         off
 Ethernet42               66      25G   9100    N/A  twentyfiveGigE0/42  routed    down       up             N/A         off
 Ethernet43               67      25G   9100    N/A  twentyfiveGigE0/43  routed    down       up             N/A         off
 Ethernet44               68      25G   9100    N/A  twentyfiveGigE0/44  routed    down       up             N/A         off
 Ethernet45               69      25G   9100    N/A  twentyfiveGigE0/45  routed    down       up             N/A         off
 Ethernet46               70      25G   9100    N/A  twentyfiveGigE0/46  routed    down       up             N/A         off
 Ethernet47               71      25G   9100    N/A  twentyfiveGigE0/47  routed    down       up             N/A         off
 Ethernet48               72      25G   9100    N/A  twentyfiveGigE0/48  routed    down       up             N/A         off
 Ethernet49      85,86,87,88     100G   9100     rs      hundredGigE0/1  routed    down       up             N/A         off
 Ethernet50      77,78,79,80     100G   9100     rs      hundredGigE0/2  routed    down       up             N/A         off
 Ethernet51     97,98,99,100     100G   9100     rs      hundredGigE0/3  routed    down       up             N/A         off
 Ethernet52      93,94,95,96     100G   9100     rs      hundredGigE0/4  routed    down       up             N/A         off
 Ethernet53  113,114,115,116     100G   9100     rs      hundredGigE0/5  routed    down       up             N/A         off
 Ethernet54  105,106,107,108     100G   9100     rs      hundredGigE0/6  routed    down       up             N/A         off
 Ethernet55  121,122,123,124     100G   9100     rs      hundredGigE0/7  routed    down       up             N/A         off
 Ethernet56  125,126,127,128     100G   9100     rs      hundredGigE0/8  routed    down       up             N/A         off

Signed-off-by: tim-rj <sonic_rd@ruijie.com.cn>
@pettershao-ragilenetworks
Copy link
Contributor

help forward this, thanks!

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.

[MASTER] Port MTU configuration is different between DB and kernel
2 participants