Skip to content

add fec configuration 'config interface fec [OPTIONS] <interface_name> <interface_fec>' #764

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

Merged
merged 1 commit into from
Jun 2, 2020

Conversation

yangshp1987
Copy link
Contributor

@yangshp1987 yangshp1987 commented Dec 12, 2019

Signed-off-by:[email protected]

- What I did
add interface fec configuration for the command "config interface ……"
- How I did it
modify config/main.py
- How to verify it
check the command whether can be configured in switch shell
- Previous command output (if the output of a command-line utility has changed)

root@sonic:/home/admin# config interface --help
Usage: config interface [OPTIONS] COMMAND [ARGS]...

  Interface-related configuration tasks

Options:
  -?, -h, --help  Show this message and exit.

Commands:
  ip        Add or remove IP address
  pfc       Set PFC configuration.
  shutdown  Shut down interface
  speed     Set interface speed
  startup   Start up interface
  vrf       Bind or unbind VRF
the configdb:
127.0.0.1:6379[4]> HGETALL "PORT|Ethernet0"
1) "alias"
2) "Ethernet0"
3) "admin_status"
4) "up"
5) "lanes"
6) "1,2,3,4"
7) "mtu"
8) "9100"

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

root@sonic:/home/admin# config interface ?
Usage: config interface [OPTIONS] COMMAND [ARGS]...

  Interface-related configuration tasks

Options:
  -?, -h, --help  Show this message and exit.

Commands:
  fec       Set interface fec from ['rs','fc','none']
  ip        Add or remove IP address
  pfc       Set PFC configuration.
  shutdown  Shut down interface
  speed     Set interface speed
  startup   Start up interface
  vrf       Bind or unbind VRF
the configdb:
127.0.0.1:6379[4]> HGETALL "PORT|Ethernet0"
 1) "alias"
 2) "Ethernet0"
 3) "admin_status"
 4) "up"
 5) "lanes"
 6) "1,2,3,4"
 7) "mtu"
 8) "9100"
 9) "fec"
10) "fc"

expose the fec configuration of portconfig to the solution for the #733

@lguohan lguohan requested a review from prsunny May 29, 2020 06:28
config/main.py Outdated
@click.argument('interface_name', metavar='<interface_name>', required=True)
@click.argument('interface_fec', metavar='<interface_fec>', required=True)
@click.option('-v', '--verbose', is_flag=True, help="Enable verbose output")
def fec(ctx, interface_name, interface_fec, verbose):
Copy link
Contributor

@prsunny prsunny May 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are providing an option via click to config fec, there should also be a way to show what is the fec setting. It would be good if you can provide the fec output in show int status. As you can see speed and mtu is already available in output

admin@str-acs-2:~$ show int status
      Interface            Lanes    Speed    MTU            Alias             Vlan    Oper    Admin             Type    Asym PFC
---------------  ---------------  -------  -----  ---------------  ---------------  ------  -------  ---------------  ----------
      Ethernet0      49,50,51,52     100G   9100   hundredGigE1/1           routed    down     down  QSFP28 or later         off
      Ethernet4      53,54,55,56     100G   9100   hundredGigE1/2            trunk      up       up  QSFP28 or later         off
      Ethernet8      57,58,59,60     100G   9100   hundredGigE1/3            trunk      up       up  QSFP28 or later         off
     Ethernet12      61,62,63,64     100G   9100   hundredGigE1/4            trunk      up       up  QSFP28 or later         off

Config changes looks good to me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with you.I rewrite my code.This is fec output below:

admin@sonic:~$ show interfaces status 
   Interface            Lanes    Speed    MTU    FEC             Alias          Vlan    Oper    Admin             Type    Asym PFC
------------  ---------------  -------  -----  -----  ----------------  ------------  ------  -------  ---------------  ----------
   Ethernet1               60      25G   9008   none   twentyfiveGigE1         trunk      up       up   SFP/SFP+/SFP28         N/A
   Ethernet2               59      25G   9008   none   twentyfiveGigE2         trunk      up       up   SFP/SFP+/SFP28         N/A
   Ethernet3               58      25G   9008   none   twentyfiveGigE3        routed      up       up   SFP/SFP+/SFP28         N/A
   Ethernet4               57      25G   9008   none   twentyfiveGigE4        routed      up       up   SFP/SFP+/SFP28         N/A
   Ethernet5               64      25G   9008     rs   twentyfiveGigE5        routed    down     down   SFP/SFP+/SFP28         N/A
   Ethernet6               63      25G   9008     rs   twentyfiveGigE6        routed    down     down   SFP/SFP+/SFP28         N/A
   Ethernet7               62      25G   9008     rs   twentyfiveGigE7        routed    down     down              N/A         N/A
   Ethernet8               61      25G   9008     rs   twentyfiveGigE8        routed    down     down   SFP/SFP+/SFP28         N/A
   Ethernet9               49      25G   9008     rs   twentyfiveGigE9        routed    down     down   SFP/SFP+/SFP28         N/A
  Ethernet10               50      25G   9008     rs  twentyfiveGigE10        routed    down     down   SFP/SFP+/SFP28         N/A
  Ethernet11               51      25G   9008     rs  twentyfiveGigE11        routed    down     down   SFP/SFP+/SFP28         N/A
  Ethernet12               52      25G   9008     rs  twentyfiveGigE12        routed    down     down              N/A         N/A
  Ethernet13                4      25G   9008     rs  twentyfiveGigE13        routed    down     down   SFP/SFP+/SFP28         N/A
  Ethernet14                3      25G   9008     rs  twentyfiveGigE14        routed    down     down              N/A         N/A
  Ethernet15                2      25G   9008     rs  twentyfiveGigE15        routed    down     down              N/A         N/A
  Ethernet16                1      25G   9008     rs  twentyfiveGigE16        routed    down     down              N/A         N/A
  Ethernet17                8      25G   9008     rs  twentyfiveGigE17        routed    down     down   SFP/SFP+/SFP28         N/A
  Ethernet18                7      25G   9008     rs  twentyfiveGigE18        routed    down     down              N/A         N/A
  Ethernet19                6      25G   9008     rs  twentyfiveGigE19        routed    down     down              N/A         N/A
  Ethernet20                5      25G   9008     rs  twentyfiveGigE20        routed    down     down              N/A         N/A
  Ethernet21               16      25G   9008     rs  twentyfiveGigE21        routed    down     down              N/A         N/A
  Ethernet22               15      25G   9008     rs  twentyfiveGigE22        routed    down     down              N/A         N/A
  Ethernet23               14      25G   9008     rs  twentyfiveGigE23        routed    down     down   SFP/SFP+/SFP28         N/A
  Ethernet24               13      25G   9008     rs  twentyfiveGigE24        routed    down     down              N/A         N/A
  Ethernet25               24      25G   9008     rs  twentyfiveGigE25        routed    down     down   SFP/SFP+/SFP28         N/A
  Ethernet26               23      25G   9008     rs  twentyfiveGigE26        routed    down     down   SFP/SFP+/SFP28         N/A
  Ethernet27               22      25G   9008     rs  twentyfiveGigE27        routed    down     down              N/A         N/A
  Ethernet28               21      25G   9008     rs  twentyfiveGigE28        routed    down     down              N/A         N/A
  Ethernet29               32      25G   9008     rs  twentyfiveGigE29        routed    down     down              N/A         N/A
  Ethernet30               31      25G   9008     rs  twentyfiveGigE30        routed    down     down              N/A         N/A
  Ethernet31               30      25G   9008     rs  twentyfiveGigE31        routed    down     down              N/A         N/A
  Ethernet32               29      25G   9008     rs  twentyfiveGigE32        routed    down     down   SFP/SFP+/SFP28         N/A
  Ethernet33               36      25G   9008     rs  twentyfiveGigE33        routed    down     down   SFP/SFP+/SFP28         N/A
  Ethernet34               35      25G   9008     rs  twentyfiveGigE34        routed    down     down              N/A         N/A
  Ethernet35               34      25G   9008     rs  twentyfiveGigE35        routed    down     down              N/A         N/A
  Ethernet36               33      25G   9008     rs  twentyfiveGigE36        routed    down     down              N/A         N/A
  Ethernet37               44      25G   9008     rs  twentyfiveGigE37        routed    down     down   SFP/SFP+/SFP28         N/A
  Ethernet38               43      25G   9008     rs  twentyfiveGigE38        routed    down     down              N/A         N/A
  Ethernet39               42      25G   9008     rs  twentyfiveGigE39        routed    down     down              N/A         N/A
  Ethernet40               41      25G   9008     rs  twentyfiveGigE40        routed    down     down              N/A         N/A
  Ethernet41               86      25G   9008     rs  twentyfiveGigE41        routed    down     down   SFP/SFP+/SFP28         N/A
  Ethernet42               85      25G   9008     rs  twentyfiveGigE42        routed    down     down              N/A         N/A
  Ethernet43               88      25G   9008     rs  twentyfiveGigE43        routed    down     down              N/A         N/A
  Ethernet44               87      25G   9008     rs  twentyfiveGigE44        routed    down     down              N/A         N/A
  Ethernet45               94      25G   9008     rs  twentyfiveGigE45        routed    down     down              N/A         N/A
  Ethernet46               93      25G   9008     rs  twentyfiveGigE46        routed    down     down              N/A         N/A
  Ethernet47               96      25G   9008     rs  twentyfiveGigE47        routed    down     down   SFP/SFP+/SFP28         N/A
  Ethernet48               95      25G   9008     rs  twentyfiveGigE48        routed    down     down              N/A         N/A
  Ethernet49     97,98,99,100     100G   9008     rs     hundredGigE49        routed    down       up              N/A         N/A
  Ethernet50  105,106,107,108     100G   9008   none     hundredGigE50        routed    down       up  QSFP28 or later         N/A
  Ethernet51  113,114,115,116     100G   9008   none     hundredGigE51        routed    down       up              N/A         N/A
  Ethernet52  121,122,123,124     100G   9008   none     hundredGigE52  PortChannel1    down       up  QSFP28 or later         N/A
  Ethernet53      77,78,79,80     100G   9008   none     hundredGigE53        routed    down       up              N/A         N/A
  Ethernet54      65,66,67,68     100G   9008   none     hundredGigE54        routed    down       up              N/A         N/A
  Ethernet55      69,70,71,72     100G   9008     rs     hundredGigE55        routed      up       up  QSFP28 or later         N/A
  Ethernet56  125,126,127,128     100G   9008     rs     hundredGigE56  PortChannel2      up       up  QSFP28 or later         N/A
PortChannel1              N/A     100G   9008    N/A               N/A        routed    down       up              N/A         N/A
PortChannel2              N/A     100G   9008    N/A               N/A        routed      up       up              N/A         N/A

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@yangshp1987 yangshp1987 force-pushed the issues#733_fec branch 4 times, most recently from 399fd1c to 70da31d Compare June 1, 2020 11:46
@prsunny
Copy link
Contributor

prsunny commented Jun 1, 2020

where is the original config change? I can't find it in diff, can you check?

@prsunny prsunny merged commit f7b7fcb into sonic-net:master Jun 2, 2020
abdosi pushed a commit that referenced this pull request Jul 26, 2020
abdosi pushed a commit to abdosi/sonic-utilities that referenced this pull request Aug 4, 2020
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
[config] Add 'config interface mtu' command sonic-net#793
add fec configuration 'config interface fec [OPTIONS] <interface_name>
<interface_fec>' sonic-net#764
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.

3 participants