From 18c6cd9aa88aef446d09bfec90d45a24ec6741ef Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Fri, 10 Jul 2020 09:29:48 +0000 Subject: ip: svr: improve performance for non-fragments Type: improvement Signed-off-by: Klement Sekera Change-Id: Ia77ce41a8f1a032c5e027c4bb47347752cfda0a9 --- test/test_reassembly.py | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'test') diff --git a/test/test_reassembly.py b/test/test_reassembly.py index e9a3af3a0ff..cb6b8ff5d3f 100644 --- a/test/test_reassembly.py +++ b/test/test_reassembly.py @@ -670,6 +670,72 @@ class TestIPv4SVReassembly(VppTestCase): self.assertEqual(sent[IP].dst, recvd[IP].dst) self.assertEqual(sent[Raw].payload, recvd[Raw].payload) + def send_mixed_and_verify_capture(self, traffic): + stream = [] + for t in traffic: + for c in range(t['count']): + stream.append( + (Ether(dst=self.src_if.local_mac, + src=self.src_if.remote_mac) / + IP(id=self.counter, + flags=t['flags'], + src=self.src_if.remote_ip4, + dst=self.dst_if.remote_ip4) / + UDP(sport=1234, dport=5678) / + Raw("abcdef"))) + self.counter = self.counter + 1 + + self.pg_enable_capture() + self.src_if.add_stream(stream) + self.pg_start() + self.logger.debug(self.vapi.ppcli("show ip4-sv-reassembly details")) + self.logger.debug(self.vapi.ppcli("show buffers")) + self.logger.debug(self.vapi.ppcli("show trace")) + self.dst_if.get_capture(len(stream)) + + def test_mixed(self): + """ mixed traffic correctly passes through SVR """ + self.counter = 1 + + self.send_mixed_and_verify_capture([{'count': 1, 'flags': ''}]) + self.send_mixed_and_verify_capture([{'count': 2, 'flags': ''}]) + self.send_mixed_and_verify_capture([{'count': 3, 'flags': ''}]) + self.send_mixed_and_verify_capture([{'count': 8, 'flags': ''}]) + self.send_mixed_and_verify_capture([{'count': 257, 'flags': ''}]) + + self.send_mixed_and_verify_capture([{'count': 1, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture([{'count': 2, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture([{'count': 3, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture([{'count': 8, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture([{'count': 257, 'flags': 'MF'}]) + + self.send_mixed_and_verify_capture( + [{'count': 1, 'flags': ''}, {'count': 1, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 2, 'flags': ''}, {'count': 2, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 3, 'flags': ''}, {'count': 3, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 8, 'flags': ''}, {'count': 8, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 129, 'flags': ''}, {'count': 129, 'flags': 'MF'}]) + + self.send_mixed_and_verify_capture( + [{'count': 1, 'flags': ''}, {'count': 1, 'flags': 'MF'}, + {'count': 1, 'flags': ''}, {'count': 1, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 2, 'flags': ''}, {'count': 2, 'flags': 'MF'}, + {'count': 2, 'flags': ''}, {'count': 2, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 3, 'flags': ''}, {'count': 3, 'flags': 'MF'}, + {'count': 3, 'flags': ''}, {'count': 3, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 8, 'flags': ''}, {'count': 8, 'flags': 'MF'}, + {'count': 8, 'flags': ''}, {'count': 8, 'flags': 'MF'}]) + self.send_mixed_and_verify_capture( + [{'count': 65, 'flags': ''}, {'count': 65, 'flags': 'MF'}, + {'count': 65, 'flags': ''}, {'count': 65, 'flags': 'MF'}]) + class TestIPv4MWReassembly(VppTestCase): """ IPv4 Reassembly (multiple workers) """ -- cgit 1.2.3-korg