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

[Subport] Add the parent admin status to the display of the sub-interface status #1746

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

Conversation

irene-pan1202
Copy link

What I did

The admin status of the IP interface on sub port will also consider the admin status of its parent interface.
Shutdown parent interface, the admin status of the sub-port will be down (show ip interface).
But config_db and app_db are still admin up (show subinterfaces status).

root@sonic:~# config interface shutdown  Ethernet8
root@sonic:~# show ip interface
Interface        Master    IPv4 address/mask    Pri/Sec    Admin/Oper    BGP Neighbor    Neighbor IP
---------------  --------  -------------------  ---------  ------------  --------------  -------------
Ethernet8.10               192.169.1.1/24       Primary    down/down     N/A             N/A
Loopback0                  10.1.0.32/32         Primary    up/up         N/A             N/A
PortChannel0001            10.0.0.56/31         Primary    up/up         ARISTA01T1      10.0.0.57
PortChannel0002            10.0.0.58/31         Primary    up/up         ARISTA02T1      10.0.0.59
PortChannel0003            10.0.0.60/31         Primary    up/up         ARISTA03T1      10.0.0.61
PortChannel0004            10.0.0.62/31         Primary    up/up         ARISTA04T1      10.0.0.63
Vlan1000                   192.168.0.1/21       Primary    up/up         N/A             N/A
docker0                    240.127.1.1/24       Primary    up/down       N/A             N/A
eth0                       10.250.0.178/16      Primary    up/up         N/A             N/A
lo                         127.0.0.1/8          Primary    up/up         N/A             N/A
root@sonic:~# show subinterfaces status
  Sub port interface    Speed    MTU    Vlan    Admin                  Type
--------------------  -------  -----  ------  -------  --------------------
        Ethernet8.10     100G   9100      10       up  802.1q-encapsulation
root@sonic:~#

How I did it

Add the parent admin status to the display of the sub-interface status

How to verify it

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

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

root@sonic:~$ show subinterfaces status
  Sub port interface    Speed    MTU    Vlan    Admin    Parent_Admin                  Type
--------------------  -------  -----  ------  -------  --------------  --------------------
        Ethernet8.10     100G   9100      10       up            down  802.1q-encapsulation
     PortChannel1.20     100G   9100      20       up            down  802.1q-encapsulation

…face status.

The admin status of the IP interface on sub port will also consider the admin status of its parent interface
Shutdown parent interface, the admin status of the sub-port will be down, but config_db and app_db are still admin up

Signed-off-by: irene_pan@edge-core.com
@ghost
Copy link

ghost commented Aug 6, 2021

CLA assistant check
All CLA requirements met.

@prsunny prsunny requested a review from neethajohn August 6, 2021 15:48
@prsunny
Copy link
Contributor

prsunny commented Aug 6, 2021

@wendani , could you please review?

@@ -4223,6 +4223,7 @@ The type of interfaces include the following.
admin@sonic:~$ show ip interfaces
Interface Master IPv4 address/mask Admin/Oper BGP Neighbor Neighbor IP Flags
------------- ------------ ------------------ -------------- ------------- ------------- -------
Ethernet8.10 1.1.1.1/24 down/down N/A N/A
Copy link
Contributor

Choose a reason for hiding this comment

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

How is sub port interface oper status defined here? SAI does not have this attribute for sub port interface.

Choose a reason for hiding this comment

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

'show ip interface' get the admin & oper status reported by the kernel.
(according to the code: sonic-utilities/show/main.py: get_if_admin_state and get_if_oper_state)

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.

4 participants