Skip to content

Commit c6666e2

Browse files
mykolaflguohan
authored andcommitted
[intfutil] add Asymmetric PFC status to 'show interface status' (sonic-net#437)
Signed-off-by: Mykola Faryma <[email protected]>
1 parent 2ca7c63 commit c6666e2

File tree

2 files changed

+4
-25
lines changed

2 files changed

+4
-25
lines changed

scripts/intfutil

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ PORT_SPEED = "speed"
2121
PORT_MTU_STATUS = "mtu"
2222
PORT_DESCRIPTION = "description"
2323
PORT_OPTICS_TYPE = "type"
24+
PORT_PFC_ASYM_STATUS = "pfc_asym"
2425

2526

2627
def db_connect_appl():
@@ -84,7 +85,7 @@ def state_db_port_optics_get(state_db, intf_name, type):
8485

8586
# ========================== interface-status logic ==========================
8687

87-
header_stat = ['Interface', 'Lanes', 'Speed', 'MTU', 'Alias', 'Oper', 'Admin', 'Type']
88+
header_stat = ['Interface', 'Lanes', 'Speed', 'MTU', 'Alias', 'Oper', 'Admin', 'Type', 'Asym PFC']
8889

8990
class IntfStatus(object):
9091

@@ -111,7 +112,8 @@ class IntfStatus(object):
111112
appl_db_port_status_get(self.appl_db, key, PORT_ALIAS),
112113
appl_db_port_status_get(self.appl_db, key, PORT_OPER_STATUS),
113114
appl_db_port_status_get(self.appl_db, key, PORT_ADMIN_STATUS),
114-
state_db_port_optics_get(self.state_db, key, PORT_OPTICS_TYPE)))
115+
state_db_port_optics_get(self.state_db, key, PORT_OPTICS_TYPE),
116+
appl_db_port_status_get(self.appl_db, key, PORT_PFC_ASYM_STATUS)))
115117

116118
# Sorting and tabulating the result table.
117119
sorted_table = natsorted(table)

show/main.py

-23
Original file line numberDiff line numberDiff line change
@@ -746,29 +746,6 @@ def pwm_pg_shared():
746746
command = 'watermarkstat -p -t pg_shared'
747747
run_command(command)
748748

749-
#
750-
# 'pfc' group ###
751-
#
752-
753-
@interfaces.group(cls=AliasedGroup, default_if_no_args=False)
754-
def pfc():
755-
"""Show PFC information"""
756-
pass
757-
758-
759-
#
760-
# 'pfc status' command ###
761-
#
762-
763-
@pfc.command()
764-
@click.argument('interface', type=click.STRING, required=False)
765-
def status(interface):
766-
"""Show PFC information"""
767-
if interface is None:
768-
interface = ""
769-
770-
run_command("pfc show asymmetric {0}".format(interface))
771-
772749

773750
#
774751
# 'mac' command ("show mac ...")

0 commit comments

Comments
 (0)