From 8635fce7827e0ee75a2fe032e8dce139a746e1c4 Mon Sep 17 00:00:00 2001 From: Ido Barnea Date: Sun, 26 Jun 2016 17:41:29 +0300 Subject: Fx trex-216 - Crash on VM setups when running latency flows --- .../regression/stateless_tests/stl_rx_test.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'scripts/automation/regression/stateless_tests/stl_rx_test.py') diff --git a/scripts/automation/regression/stateless_tests/stl_rx_test.py b/scripts/automation/regression/stateless_tests/stl_rx_test.py index 23ebf081..36f17170 100644 --- a/scripts/automation/regression/stateless_tests/stl_rx_test.py +++ b/scripts/automation/regression/stateless_tests/stl_rx_test.py @@ -9,10 +9,6 @@ class STLRX_Test(CStlGeneral_Test): """Tests for RX feature""" def setUp(self): - #if CTRexScenario.setup_name in ('trex08', 'trex09'): - # self.skip('This test makes trex08 and trex09 sick. Fix those ASAP.') - if self.is_virt_nics: - self.skip('Skip this for virtual NICs for now') per_driver_params = {"rte_vmxnet3_pmd": [1, 50, 1,False], "rte_ixgbe_pmd": [30, 5000, 1,True,200,400], "rte_i40e_pmd": [80, 5000, 1,True,100,250], "rte_igb_pmd": [80, 500, 1,False], "rte_em_pmd": [1, 50, 1,False], "rte_virtio_pmd": [1, 50, 1,False]} @@ -182,6 +178,9 @@ class STLRX_Test(CStlGeneral_Test): def test_multiple_streams(self): + if self.is_virt_nics: + self.skip('Skip this for virtual NICs') + num_latency_streams = 128 num_flow_stat_streams = 127 total_pkts = int(self.total_pkts / (num_latency_streams + num_flow_stat_streams)) @@ -313,8 +312,8 @@ class STLRX_Test(CStlGeneral_Test): # check low latency when you have stream of 9K stream def test_9k_stream(self): - - #self.skip('Skip due to bug trex-215') + if self.is_virt_nics: + self.skip('Skip this for virtual NICs') if self.latency_9k_enable == False: print("SKIP") @@ -441,7 +440,9 @@ class STLRX_Test(CStlGeneral_Test): def test_fcs_stream(self): """ this test send 1 64 byte packet with latency and check that all counters are reported as 64 bytes""" - #self.skip('Skip due to bug trex-213') + + if self.is_virt_nics: + self.skip('Skip this for virtual NICs') all_ports=list(CTRexScenario.stl_ports_map['map'].keys()); for port in all_ports: @@ -452,6 +453,8 @@ class STLRX_Test(CStlGeneral_Test): # this test adds more and more latency streams and re-test with incremental def test_incremental_latency_streams (self): + if self.is_virt_nics: + self.skip('Skip this for virtual NICs') total_pkts = self.total_pkts percent = 0.5 -- cgit From 3c693c4d3a57c8567c5e2a8327deb70a08be9a14 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Mon, 27 Jun 2016 13:43:01 +0300 Subject: fix trex-218 & trex-219 --- scripts/automation/regression/stateless_tests/stl_rx_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/automation/regression/stateless_tests/stl_rx_test.py') diff --git a/scripts/automation/regression/stateless_tests/stl_rx_test.py b/scripts/automation/regression/stateless_tests/stl_rx_test.py index 36f17170..16029908 100644 --- a/scripts/automation/regression/stateless_tests/stl_rx_test.py +++ b/scripts/automation/regression/stateless_tests/stl_rx_test.py @@ -428,7 +428,7 @@ class STLRX_Test(CStlGeneral_Test): self.check_stats (stats,ls['tx_pkts'][pid], pkts,"ls['tx_pkts'][pid]") self.check_stats (stats,ls['tx_bytes']['total'], tbytes,"ls['tx_bytes']['total']") - self.check_stats (stats,ls['tx_bytes'][pid], pkts+1,"ls['tx_bytes'][pid]") + self.check_stats (stats,ls['tx_bytes'][pid], tbytes,"ls['tx_bytes'][pid]") return 0 @@ -448,7 +448,7 @@ class STLRX_Test(CStlGeneral_Test): for port in all_ports: for l in [True,False]: print(" test port {0} latency : {1} ".format(port,l)) - self.send_1_burst(port,False,100) + self.send_1_burst(port,l,100) # this test adds more and more latency streams and re-test with incremental -- cgit From 7bf6055dc8f8ae50ef0f6b612f68eaa77e1b4014 Mon Sep 17 00:00:00 2001 From: Ido Barnea Date: Mon, 27 Jun 2016 14:25:19 +0300 Subject: Make all latency tests work on Virtual machines --- .../regression/stateless_tests/stl_rx_test.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'scripts/automation/regression/stateless_tests/stl_rx_test.py') diff --git a/scripts/automation/regression/stateless_tests/stl_rx_test.py b/scripts/automation/regression/stateless_tests/stl_rx_test.py index 16029908..3127a196 100644 --- a/scripts/automation/regression/stateless_tests/stl_rx_test.py +++ b/scripts/automation/regression/stateless_tests/stl_rx_test.py @@ -28,10 +28,11 @@ class STLRX_Test(CStlGeneral_Test): self.skip('port {0} does not support RX'.format(self.rx_port)) self.cap = cap - self.rate_percent = per_driver_params[port_info['driver']][0] - self.total_pkts = per_driver_params[port_info['driver']][1] - if len(per_driver_params[port_info['driver']]) > 2: - self.rate_lat = per_driver_params[port_info['driver']][2] + drv_name = port_info['driver'] + self.rate_percent = per_driver_params[drv_name][0] + self.total_pkts = per_driver_params[drv_name][1] + if len(per_driver_params[drv_name]) > 2: + self.rate_lat = per_driver_params[drv_name][2] else: self.rate_lat = self.rate_percent self.drops_expected = False @@ -41,8 +42,6 @@ class STLRX_Test(CStlGeneral_Test): self.large_pkt = STLPktBuilder(pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025)/('a'*1000)) self.pkt_9k = STLPktBuilder(pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025)/('a'*9000)) - - drv_name=port_info['driver'] self.latency_9k_enable=per_driver_params[drv_name][3] if self.latency_9k_enable: self.latency_9k_max_average = per_driver_params[drv_name][4] @@ -120,7 +119,7 @@ class STLRX_Test(CStlGeneral_Test): tmp = 'TX pkts mismatch - got: {0}, expected: {1}'.format(tx_pkts, total_pkts) assert False, tmp - if tx_bytes != (total_pkts * (pkt_len + 4)): # + 4 for ethernet CRC + if tx_bytes != (total_pkts * pkt_len): pprint.pprint(flow_stats) tmp = 'TX bytes mismatch - got: {0}, expected: {1}'.format(tx_bytes, (total_pkts * pkt_len)) assert False, tmp @@ -132,7 +131,7 @@ class STLRX_Test(CStlGeneral_Test): if "rx_bytes" in self.cap: rx_bytes = flow_stats['rx_bytes'].get(self.rx_port, 0) - if rx_bytes != (total_pkts * (pkt_len + 4)) and not self.drops_expected: # +4 for ethernet CRC + if rx_bytes != (total_pkts * pkt_len) and not self.drops_expected: pprint.pprint(flow_stats) tmp = 'RX bytes mismatch - got: {0}, expected: {1}'.format(rx_bytes, (total_pkts * pkt_len)) assert False, tmp @@ -148,12 +147,13 @@ class STLRX_Test(CStlGeneral_Test): stats = self.c.get_stats() for exp in exp_list: - self.__verify_flow(exp['pg_id'], exp['total_pkts'], exp['pkt_len'], stats) + # Expecting to get pkt_len + 4 because of ethernet FCS + self.__verify_flow(exp['pg_id'], exp['total_pkts'], exp['pkt_len'] + 4, stats) # one stream on TX --> RX def test_one_stream(self): - total_pkts = self.total_pkts * 10 + total_pkts = self.total_pkts try: s1 = STLStream(name = 'rx', -- cgit From 4b5fc9567db2f56b8eecfc0b86d69dbf995e8708 Mon Sep 17 00:00:00 2001 From: Ido Barnea Date: Mon, 27 Jun 2016 16:50:24 +0300 Subject: latency field engine tests --- .../regression/stateless_tests/stl_rx_test.py | 91 +++++++++++++--------- 1 file changed, 56 insertions(+), 35 deletions(-) (limited to 'scripts/automation/regression/stateless_tests/stl_rx_test.py') diff --git a/scripts/automation/regression/stateless_tests/stl_rx_test.py b/scripts/automation/regression/stateless_tests/stl_rx_test.py index 3127a196..238ff53d 100644 --- a/scripts/automation/regression/stateless_tests/stl_rx_test.py +++ b/scripts/automation/regression/stateless_tests/stl_rx_test.py @@ -38,9 +38,26 @@ class STLRX_Test(CStlGeneral_Test): self.drops_expected = False self.c.reset(ports = [self.tx_port, self.rx_port]) + vm = STLScVmRaw( [ STLVmFlowVar ( "ip_src", min_value="10.0.0.1", + max_value="10.0.0.255", size=4, step=1,op="inc"), + STLVmWrFlowVar (fv_name="ip_src", pkt_offset= "IP.src" ), # write ip to packet IP.src + STLVmFixIpv4(offset = "IP") # fix checksum + ] + # Latency is bound to one core. We test that this option is not causing trouble + ,split_by_field = "ip_src" + ,cache_size =255 # Cache is ignored by latency flows. Need to test it is not crashing. + ); + self.pkt = STLPktBuilder(pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025)/('Your_paylaod_comes_here')) self.large_pkt = STLPktBuilder(pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025)/('a'*1000)) self.pkt_9k = STLPktBuilder(pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025)/('a'*9000)) + self.vm_pkt = STLPktBuilder(pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1") + / UDP(dport=12,sport=1025)/('Your_paylaod_comes_here') + , vm = vm) + self.vm_large_pkt = STLPktBuilder(pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025)/('a'*1000) + , vm = vm) + self.vm_9k_pkt = STLPktBuilder(pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025)/('a'*9000) + ,vm = vm) self.latency_9k_enable=per_driver_params[drv_name][3] if self.latency_9k_enable: @@ -147,8 +164,7 @@ class STLRX_Test(CStlGeneral_Test): stats = self.c.get_stats() for exp in exp_list: - # Expecting to get pkt_len + 4 because of ethernet FCS - self.__verify_flow(exp['pg_id'], exp['total_pkts'], exp['pkt_len'] + 4, stats) + self.__verify_flow(exp['pg_id'], exp['total_pkts'], exp['pkt_len'], stats) # one stream on TX --> RX @@ -168,7 +184,7 @@ class STLRX_Test(CStlGeneral_Test): print("\ninjecting {0} packets on port {1}\n".format(total_pkts, self.tx_port)) - exp = {'pg_id': 5, 'total_pkts': total_pkts, 'pkt_len': self.pkt.get_pkt_len()} + exp = {'pg_id': 5, 'total_pkts': total_pkts, 'pkt_len': s1.get_pkt_len()} self.__rx_iteration( [exp] ) @@ -199,7 +215,7 @@ class STLRX_Test(CStlGeneral_Test): flow_stats = STLFlowLatencyStats(pg_id = pg_id), mode = STLTXSingleBurst(total_pkts = total_pkts+pg_id, percentage = percent))) - exp.append({'pg_id': pg_id, 'total_pkts': total_pkts+pg_id, 'pkt_len': self.pkt.get_pkt_len()}) + exp.append({'pg_id': pg_id, 'total_pkts': total_pkts+pg_id, 'pkt_len': streams[-1].get_pkt_len()}) for pg_id in range(num_latency_streams + 1, num_latency_streams + num_flow_stat_streams): @@ -208,7 +224,7 @@ class STLRX_Test(CStlGeneral_Test): flow_stats = STLFlowStats(pg_id = pg_id), mode = STLTXSingleBurst(total_pkts = total_pkts+pg_id, percentage = percent))) - exp.append({'pg_id': pg_id, 'total_pkts': total_pkts+pg_id, 'pkt_len': self.pkt.get_pkt_len()}) + exp.append({'pg_id': pg_id, 'total_pkts': total_pkts+pg_id, 'pkt_len': streams[-1].get_pkt_len()}) # add both streams to ports self.c.add_streams(streams, ports = [self.tx_port]) @@ -223,36 +239,41 @@ class STLRX_Test(CStlGeneral_Test): total_pkts = self.total_pkts try: - s1 = STLStream(name = 'rx', - packet = self.pkt, - flow_stats = STLFlowStats(pg_id = 5), - mode = STLTXSingleBurst(total_pkts = total_pkts, - percentage = self.rate_percent - )) - - s_lat = STLStream(name = 'rx', - packet = self.pkt, - flow_stats = STLFlowLatencyStats(pg_id = 5), - mode = STLTXSingleBurst(total_pkts = total_pkts, - percentage = self.rate_lat - )) - - print("\ninjecting {0} packets on port {1}\n".format(total_pkts, self.tx_port)) - - exp = {'pg_id': 5, 'total_pkts': total_pkts, 'pkt_len': self.pkt.get_pkt_len()} - exp_lat = {'pg_id': 5, 'total_pkts': total_pkts, 'pkt_len': self.pkt.get_pkt_len()} - - self.c.add_streams([s1], ports = [self.tx_port]) - for i in range(0, 10): - print("starting iteration {0}".format(i)) - self.__rx_iteration( [exp] ) - - self.c.remove_all_streams(ports = [self.tx_port]) - self.c.add_streams([s_lat], ports = [self.tx_port]) - for i in range(0, 10): - print("starting iteration {0} latency".format(i)) - self.__rx_iteration( [exp_lat] ) + streams_data = [ + {'name': 'Flow stat. No latency', 'pkt': self.pkt, 'lat': False}, + {'name': 'Latency, no field engine', 'pkt': self.pkt, 'lat': True}, + {'name': 'Latency, short packet with field engine', 'pkt': self.vm_pkt, 'lat': True}, + {'name': 'Latency, large packet field engine', 'pkt': self.vm_large_pkt, 'lat': True} + ] + if self.latency_9k_enable: + streams_data.append({'name': 'Latency, 9k packet with field engine', 'pkt': self.vm_9k_pkt, 'lat': True}) + streams = [] + for data in streams_data: + if data['lat']: + flow_stats = STLFlowLatencyStats(pg_id = 5) + else: + flow_stats = STLFlowStats(pg_id = 5) + + s = STLStream(name = data['name'], + packet = data['pkt'], + flow_stats = flow_stats, + mode = STLTXSingleBurst(total_pkts = total_pkts, + percentage = self.rate_percent + )) + streams.append(s) + + print("\ninjecting {0} packets on port {1}".format(total_pkts, self.tx_port)) + exp = {'pg_id': 5, 'total_pkts': total_pkts} + + for stream in streams: + self.c.add_streams([stream], ports = [self.tx_port]) + print("Stream: {0}".format(stream.name)) + exp['pkt_len'] = stream.get_pkt_len() + for i in range(0, 10): + print("Iteration {0}".format(i)) + self.__rx_iteration( [exp] ) + self.c.remove_all_streams(ports = [self.tx_port]) except STLError as e: @@ -487,7 +508,7 @@ class STLRX_Test(CStlGeneral_Test): print("port {0} : {1} streams at {2}% of line rate\n".format(self.tx_port, i, total_percent)) - exp.append({'pg_id': i, 'total_pkts': total_pkts, 'pkt_len': my_pkt.get_pkt_len()}) + exp.append({'pg_id': i, 'total_pkts': total_pkts, 'pkt_len': s1.get_pkt_len()}) self.__rx_iteration( exp ) -- cgit From 0f118a01d28ba17344aa3eb5fe8655412d9f9fa9 Mon Sep 17 00:00:00 2001 From: Ido Barnea Date: Thu, 30 Jun 2016 17:47:43 +0300 Subject: Latency test fixes for regression --- scripts/automation/regression/stateless_tests/stl_rx_test.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts/automation/regression/stateless_tests/stl_rx_test.py') diff --git a/scripts/automation/regression/stateless_tests/stl_rx_test.py b/scripts/automation/regression/stateless_tests/stl_rx_test.py index 238ff53d..f83529b0 100644 --- a/scripts/automation/regression/stateless_tests/stl_rx_test.py +++ b/scripts/automation/regression/stateless_tests/stl_rx_test.py @@ -9,7 +9,7 @@ class STLRX_Test(CStlGeneral_Test): """Tests for RX feature""" def setUp(self): - per_driver_params = {"rte_vmxnet3_pmd": [1, 50, 1,False], "rte_ixgbe_pmd": [30, 5000, 1,True,200,400], "rte_i40e_pmd": [80, 5000, 1,True,100,250], + per_driver_params = {"rte_vmxnet3_pmd": [1, 50, 1,False], "rte_ixgbe_pmd": [30, 5000, 1,True,300,400], "rte_i40e_pmd": [80, 5000, 1,True,100,250], "rte_igb_pmd": [80, 500, 1,False], "rte_em_pmd": [1, 50, 1,False], "rte_virtio_pmd": [1, 50, 1,False]} CStlGeneral_Test.setUp(self) @@ -35,6 +35,7 @@ class STLRX_Test(CStlGeneral_Test): self.rate_lat = per_driver_params[drv_name][2] else: self.rate_lat = self.rate_percent + self.lat_pps = 5000 self.drops_expected = False self.c.reset(ports = [self.tx_port, self.rx_port]) @@ -252,15 +253,16 @@ class STLRX_Test(CStlGeneral_Test): for data in streams_data: if data['lat']: flow_stats = STLFlowLatencyStats(pg_id = 5) + mode = STLTXSingleBurst(total_pkts = total_pkts, percentage = self.rate_percent) else: flow_stats = STLFlowStats(pg_id = 5) + mode = STLTXSingleBurst(total_pkts = total_pkts, pps = self.lat_pps) s = STLStream(name = data['name'], packet = data['pkt'], flow_stats = flow_stats, - mode = STLTXSingleBurst(total_pkts = total_pkts, - percentage = self.rate_percent - )) + mode = mode + ) streams.append(s) print("\ninjecting {0} packets on port {1}".format(total_pkts, self.tx_port)) -- cgit From a7bda0a07919e23bfe8b8c97dd856d9db3a75d70 Mon Sep 17 00:00:00 2001 From: Ido Barnea Date: Fri, 1 Jul 2016 10:09:03 +0300 Subject: reducing rate of latency packets inregression --- scripts/automation/regression/stateless_tests/stl_rx_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/automation/regression/stateless_tests/stl_rx_test.py') diff --git a/scripts/automation/regression/stateless_tests/stl_rx_test.py b/scripts/automation/regression/stateless_tests/stl_rx_test.py index f83529b0..090261ff 100644 --- a/scripts/automation/regression/stateless_tests/stl_rx_test.py +++ b/scripts/automation/regression/stateless_tests/stl_rx_test.py @@ -9,7 +9,7 @@ class STLRX_Test(CStlGeneral_Test): """Tests for RX feature""" def setUp(self): - per_driver_params = {"rte_vmxnet3_pmd": [1, 50, 1,False], "rte_ixgbe_pmd": [30, 5000, 1,True,300,400], "rte_i40e_pmd": [80, 5000, 1,True,100,250], + per_driver_params = {"rte_vmxnet3_pmd": [1, 50, 1,False], "rte_ixgbe_pmd": [30, 1000, 1,True,300,400], "rte_i40e_pmd": [80, 1000, 1,True,100,250], "rte_igb_pmd": [80, 500, 1,False], "rte_em_pmd": [1, 50, 1,False], "rte_virtio_pmd": [1, 50, 1,False]} CStlGeneral_Test.setUp(self) @@ -35,7 +35,7 @@ class STLRX_Test(CStlGeneral_Test): self.rate_lat = per_driver_params[drv_name][2] else: self.rate_lat = self.rate_percent - self.lat_pps = 5000 + self.lat_pps = 1000 self.drops_expected = False self.c.reset(ports = [self.tx_port, self.rx_port]) -- cgit