Skip to content

Commit

Permalink
[pfcwd]: enable pfcwd on all port by default (sonic-net#307)
Browse files Browse the repository at this point in the history
Signed-off-by: Sihui Han <sihan@microsoft.com>
  • Loading branch information
sihuihan88 authored and lguohan committed Aug 28, 2018
1 parent 04a62dd commit 722d25d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pfcwd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,11 @@ def start_default():
configdb.connect()
enable = configdb.get_entry('DEVICE_METADATA', 'localhost').get('default_pfcwd_status')

server_facing_ports = get_server_facing_ports(configdb)
all_ports = get_all_ports(configdb)

if not enable or enable.lower() != "enable":
return

device_type = configdb.get_entry('DEVICE_METADATA', 'localhost').get('type')
if device_type.lower() != "torrouter":
return

port_num = len(configdb.get_table('PORT').keys())

# Paramter values positively correlate to the number of ports.
Expand All @@ -217,7 +213,7 @@ def start_default():
'action': DEFAULT_ACTION
}

for port in server_facing_ports:
for port in all_ports:
configdb.set_entry("PFC_WD_TABLE", port, pfcwd_info)

pfcwd_info = {}
Expand Down

0 comments on commit 722d25d

Please sign in to comment.