Skip to content

Commit

Permalink
[intfutil] add Asymmetric PFC status to 'show interface status' (#437)
Browse files Browse the repository at this point in the history
Signed-off-by: Mykola Faryma <mykolaf@mellanox.com>
  • Loading branch information
mykolaf authored and lguohan committed Feb 2, 2019
1 parent 2ca7c63 commit c6666e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 deletions.
6 changes: 4 additions & 2 deletions scripts/intfutil
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ PORT_SPEED = "speed"
PORT_MTU_STATUS = "mtu"
PORT_DESCRIPTION = "description"
PORT_OPTICS_TYPE = "type"
PORT_PFC_ASYM_STATUS = "pfc_asym"


def db_connect_appl():
Expand Down Expand Up @@ -84,7 +85,7 @@ def state_db_port_optics_get(state_db, intf_name, type):

# ========================== interface-status logic ==========================

header_stat = ['Interface', 'Lanes', 'Speed', 'MTU', 'Alias', 'Oper', 'Admin', 'Type']
header_stat = ['Interface', 'Lanes', 'Speed', 'MTU', 'Alias', 'Oper', 'Admin', 'Type', 'Asym PFC']

class IntfStatus(object):

Expand All @@ -111,7 +112,8 @@ class IntfStatus(object):
appl_db_port_status_get(self.appl_db, key, PORT_ALIAS),
appl_db_port_status_get(self.appl_db, key, PORT_OPER_STATUS),
appl_db_port_status_get(self.appl_db, key, PORT_ADMIN_STATUS),
state_db_port_optics_get(self.state_db, key, PORT_OPTICS_TYPE)))
state_db_port_optics_get(self.state_db, key, PORT_OPTICS_TYPE),
appl_db_port_status_get(self.appl_db, key, PORT_PFC_ASYM_STATUS)))

# Sorting and tabulating the result table.
sorted_table = natsorted(table)
Expand Down
23 changes: 0 additions & 23 deletions show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,29 +746,6 @@ def pwm_pg_shared():
command = 'watermarkstat -p -t pg_shared'
run_command(command)

#
# 'pfc' group ###
#

@interfaces.group(cls=AliasedGroup, default_if_no_args=False)
def pfc():
"""Show PFC information"""
pass


#
# 'pfc status' command ###
#

@pfc.command()
@click.argument('interface', type=click.STRING, required=False)
def status(interface):
"""Show PFC information"""
if interface is None:
interface = ""

run_command("pfc show asymmetric {0}".format(interface))


#
# 'mac' command ("show mac ...")
Expand Down

0 comments on commit c6666e2

Please sign in to comment.