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

[QoS] Fix qos issues #1664

Merged
merged 2 commits into from
May 19, 2020
Merged
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
28 changes: 27 additions & 1 deletion ansible/roles/test/files/saitests/sai_qos_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,24 @@ def runTest(self):
send_packet(self, self.dst_port_3_id, arpreq_pkt)
time.sleep(8)


class ARPpopulatePTF(sai_base_test.ThriftInterfaceDataPlane):
def runTest(self):
## ARP Populate
index = 0
for port in ptf_ports():
arpreq_pkt = simple_arp_packet(
eth_dst='ff:ff:ff:ff:ff:ff',
eth_src=self.dataplane.get_mac(port[0],port[1]),
arp_op=1,
ip_snd='10.0.0.%d' % (index * 2 + 1),
ip_tgt='10.0.0.%d' % (index * 2),
hw_snd=self.dataplane.get_mac(port[0], port[1]),
hw_tgt='ff:ff:ff:ff:ff:ff')
send_packet(self, port[1], arpreq_pkt)
index += 1


class ReleaseAllPorts(sai_base_test.ThriftInterfaceDataPlane):
def runTest(self):
switch_init(self.client)
Expand Down Expand Up @@ -1268,6 +1286,8 @@ def runTest(self):
queue_num_of_pkts[48] = queue_6_num_of_pkts
total_pkts = 0

diff_list = []

for pkt_to_inspect in pkts:
dscp_of_pkt = pkt_to_inspect.payload.tos >> 2
total_pkts += 1
Expand All @@ -1276,10 +1296,16 @@ def runTest(self):

queue_pkt_counters[dscp_of_pkt] += 1
if queue_pkt_counters[dscp_of_pkt] == queue_num_of_pkts[dscp_of_pkt]:
assert((queue_0_num_of_pkts + queue_1_num_of_pkts + queue_2_num_of_pkts + queue_3_num_of_pkts + queue_4_num_of_pkts + queue_5_num_of_pkts + queue_6_num_of_pkts) - total_pkts < limit)
diff_list.append((dscp_of_pkt, (queue_0_num_of_pkts + queue_1_num_of_pkts + queue_2_num_of_pkts + queue_3_num_of_pkts + queue_4_num_of_pkts + queue_5_num_of_pkts + queue_6_num_of_pkts) - total_pkts))

print >> sys.stderr, queue_pkt_counters

print >> sys.stderr, "Difference for each dscp: "
print >> sys.stderr, diff_list

for dscp, diff in diff_list:
assert diff < limit, "Difference for %d is %d which exceeds limit %d" % (dscp, diff, limit)

# Read counters
print "DST port counters: "
port_counters, queue_counters = sai_thrift_read_port_counters(self.client, port_list[dst_port_id])
Expand Down
15 changes: 15 additions & 0 deletions ansible/roles/test/tasks/qos_sai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@
- src_port_ip='{{src_port_ip}}'
when: testbed_type in ['t0', 't0-64', 't0-116'] or arp_entries.stdout.find('incomplete') == -1

- include_tasks: qos_sai_ptf.yml
vars:
test_name: populate arp on all ports
test_path: sai_qos_tests.ARPpopulatePTF
test_params:
- dst_port_id='{{dst_port_id}}'
- dst_port_ip='{{dst_port_ip}}'
- dst_port_2_id='{{dst_port_2_id}}'
- dst_port_2_ip='{{dst_port_2_ip}}'
- dst_port_3_id='{{dst_port_3_id}}'
- dst_port_3_ip='{{dst_port_3_ip}}'
- src_port_id='{{src_port_id}}'
- src_port_ip='{{src_port_ip}}'
when: testbed_type in ['ptf32', 'ptf64']

# XOFF limit
- include_tasks: qos_sai_ptf.yml
vars:
Expand Down