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

Update the copp test rate limits for queue4_group3 #10724

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions ansible/roles/test/files/ptftests/py3/copp_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,13 @@ def contruct_packet(self, port_number):
return packet


# SONIC config contains policer CIR=300 for DHCP
# SONIC config contains policer CIR=100 for DHCP
class DHCPTest(PolicyTest):
def __init__(self):
PolicyTest.__init__(self)
self.PPS_LIMIT = 100
self.PPS_LIMIT_MIN = self.PPS_LIMIT * 0.9
self.PPS_LIMIT_MAX = self.PPS_LIMIT * 1.3

def runTest(self):
self.log("DHCPTest")
Expand Down Expand Up @@ -362,10 +365,13 @@ def contruct_packet(self, port_number):
return packet


# SONIC config contains policer CIR=300 for DHCPv6
# SONIC config contains policer CIR=100 for DHCPv6
class DHCP6Test(PolicyTest):
def __init__(self):
PolicyTest.__init__(self)
self.PPS_LIMIT = 100
self.PPS_LIMIT_MIN = self.PPS_LIMIT * 0.9
self.PPS_LIMIT_MAX = self.PPS_LIMIT * 1.3

def runTest(self):
self.log("DHCP6Test")
Expand Down Expand Up @@ -415,10 +421,13 @@ def contruct_packet(self, port_number):
return packet


# SONIC config contains policer CIR=300 for LLDP
# SONIC config contains policer CIR=100 for LLDP
class LLDPTest(PolicyTest):
def __init__(self):
PolicyTest.__init__(self)
self.PPS_LIMIT = 100
self.PPS_LIMIT_MIN = self.PPS_LIMIT * 0.9
self.PPS_LIMIT_MAX = self.PPS_LIMIT * 1.3

def runTest(self):
self.log("LLDPTest")
Expand All @@ -436,10 +445,13 @@ def contruct_packet(self, port_number):
return packet


# SONIC config contains policer CIR=300 for UDLD
# SONIC config contains policer CIR=100 for UDLD
class UDLDTest(PolicyTest):
def __init__(self):
PolicyTest.__init__(self)
self.PPS_LIMIT = 100
self.PPS_LIMIT_MIN = self.PPS_LIMIT * 0.9
self.PPS_LIMIT_MAX = self.PPS_LIMIT * 1.3

def runTest(self):
self.log("UDLDTest")
Expand Down
7 changes: 6 additions & 1 deletion tests/copp/scripts/update_copp_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,18 @@ def generate_limited_pps_config(pps_limit, input_config_file, output_config_file
raise ValueError("Invalid config format specified")

for trap_group in trap_groups:
for _, group_config in list(trap_group.items()):
for group, group_config in list(trap_group.items()):
# Notes:
# CIR (committed information rate) - bandwidth limit set by the policer
# CBS (committed burst size) - largest burst of packets allowed by the policer
#
# Setting these two values to pps_limit restricts the policer to allowing exactly
# that number of packets per second, which is what we want for our tests.
# For queue4_group3, use the default value in copp configuration as this is lower
# than 600 PPS

if group == "queue4_group3":
continue

if "cir" in group_config:
group_config["cir"] = pps_limit
Expand Down