From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f169.google.com (mail-wr0-f169.google.com [209.85.128.169]) by dpdk.org (Postfix) with ESMTP id 695273254 for ; Tue, 5 Sep 2017 13:28:13 +0200 (CEST) Received: by mail-wr0-f169.google.com with SMTP id 108so7984469wra.5 for ; Tue, 05 Sep 2017 04:28:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DcHhCGdpy+YE+k3upcxYlrtR+3xmaLlqPAvgIKJpsKc=; b=wXk7lk2PGpBCqTTd6818zUcN8DLuTnVoI16Cvf48kzt7ywX5XreVX4afW5apafYHa0 3l8toD6CWQnlIuNbAdtxKrfCEjNYQFha1mzsTugi+5YBRvIhNUwjSN/bBwYfBXb4A1kv C+uAOcCZ9pwL/NClAcOg1h49QFmXUbmEUQ+7qNa2DlthLWEushLW6Rj4GQhFNWG3K0jJ cedhn4qETeStE1jineUI3HSuATmxWt8niKR8iRsYi/dO04bm1A50tQzQnUnJUUr66q9M P2mPftUhqpeZwEsYX3UuU7ZXv5fwi4YsB2XTigU5CGJZm8zVqKCii4rS3GDYtRdW8cUt svTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DcHhCGdpy+YE+k3upcxYlrtR+3xmaLlqPAvgIKJpsKc=; b=mDixiaQIN3Ia2aWBrF/ECf6WeS5yD1uRTOc7RX+HQBx/IxZs0HzCNHbbrtIN9/iXEv P85k0Te5LSpIBCoGgAI1ajg7RTgKoZf7z/IVSVPJSwH5vmxaPf00Ls99kY1fFpkLYFYO gk/q8JQRv80zHsO99PWeRX/gVk3Mo1Onm2Ry1qWJ0g2oPN9SC3o3aDnWQJjS3Z6PEKdj a4XYN0X8Ki3LjUQtVghSmzns66kh6jKQ6YlE2QFfvLY5Zdo3HB4vA5MOTt4BSlkAQd89 4Ns8785EEXIb8UODd9obk/qqXNQahJK5S/mVwz7P9iKS4N/7wOeqKq+ZyjqvhmBrrF8a Vi2w== X-Gm-Message-State: AHPjjUg62IaaY6xgLb5lKFlzGD+bg7quekSxrnvngGkj+ov2atN1chjb ld6FtKieNLXoqtodSk677QHsHii8ugD6 X-Google-Smtp-Source: ADKCNb5EKQWEP9nMXhWujWWZR4t7rSBXG+HTBlu1F4fSGLkreDnfY51SMuNFmbwaTC71sUsVeNeCafTs9OwLwZsHYEk= X-Received: by 10.223.152.6 with SMTP id v6mr2230085wrb.40.1504610892984; Tue, 05 Sep 2017 04:28:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.196.15 with HTTP; Tue, 5 Sep 2017 04:27:52 -0700 (PDT) In-Reply-To: References: <1503311443-26858-1-git-send-email-jianbo.liu@linaro.org> From: =?UTF-8?Q?Rados=C5=82aw_Biernacki?= Date: Tue, 5 Sep 2017 13:27:52 +0200 Message-ID: To: Jianbo Liu Cc: dts@dpdk.org, Herbert Guan , yong.liu@intel.com, rkerur@gmail.com Content-Type: multipart/alternative; boundary="f403045d5af0cd44eb05586f851c" Subject: Re: [dts] [PATCH] tests/ip_pipeline: fix test failures X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Sep 2017 11:28:13 -0000 --f403045d5af0cd44eb05586f851c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I understand that. But do we also understand why this table was coded in first place? What was the reason of deal with those nics differently even if always access both ports? Yong Liu is an author of this test and Ravi Kerur added the change for nics which require only 1 port. Lets ask them for opinion. 2017-09-05 3:58 GMT+02:00 Jianbo Liu : > On 4 September 2017 at 17:39, Rados=C5=82aw Biernacki = wrote: > > 2017-08-21 12:30 GMT+02:00 Jianbo Liu : > >> > >> The ip_pipeline was changed a lot, and the configuration and commands > >> are different from those in this testing case. > >> > >> Signed-off-by: Jianbo Liu > >> --- > >> tests/TestSuite_ip_pipeline.py | 157 > >> +++++++++++++++++++++++------------------ > >> 1 file changed, 90 insertions(+), 67 deletions(-) > >> > >> diff --git a/tests/TestSuite_ip_pipeline.py > >> b/tests/TestSuite_ip_pipeline.py > >> index 90dba31..300b1de 100644 > >> --- a/tests/TestSuite_ip_pipeline.py > >> +++ b/tests/TestSuite_ip_pipeline.py > >> @@ -124,11 +124,47 @@ class TestIPPipeline(TestCase): > >> > >> writer.close() > >> > >> + def create_passthrough_cfgfile(self): > >> + self.dut.send_expect('echo [PIPELINE0] > /tmp/ip_pipeline.cfg= ', > >> '#') > >> + self.dut.send_expect('echo type =3D MASTER >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo core =3D 0 >> /tmp/ip_pipeline.cfg= ', > >> '#') > >> + self.dut.send_expect('echo [PIPELINE1] >> > /tmp/ip_pipeline.cfg', > >> '#') > >> + self.dut.send_expect('echo type =3D PASS-THROUGH >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo core =3D 1 >> /tmp/ip_pipeline.cfg= ', > >> '#') > >> + self.dut.send_expect('echo pktq_in =3D RXQ0.0 RXQ1.0 >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo pktq_out =3D TXQ1.0 TXQ0.0 >> > >> /tmp/ip_pipeline.cfg', '#') > >> + > >> + def create_routing_cfgfile(self): > >> + self.dut.send_expect('echo [PIPELINE0] > /tmp/ip_pipeline.cfg= ', > >> '#') > >> + self.dut.send_expect('echo type =3D MASTER >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo core =3D 0 >> /tmp/ip_pipeline.cfg= ', > >> '#') > >> + self.dut.send_expect('echo [PIPELINE1] >> > /tmp/ip_pipeline.cfg', > >> '#') > >> + self.dut.send_expect('echo type =3D ROUTING >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo core =3D 1 >> /tmp/ip_pipeline.cfg= ', > >> '#') > >> + self.dut.send_expect('echo pktq_in =3D RXQ0.0 RXQ1.0 >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo pktq_out =3D TXQ0.0 TXQ1.0 >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo encap =3D ethernet >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo ip_hdr_offset =3D 270 >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo arp_key_offset =3D 128 >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo n_arp_entries =3D 1000 >> > >> /tmp/ip_pipeline.cfg', '#') > >> + > >> + def create_flow_cfgfile(self): > >> + self.dut.send_expect('echo [PIPELINE0] > /tmp/ip_pipeline.cfg= ', > >> '#') > >> + self.dut.send_expect('echo type =3D MASTER >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo core =3D 0 >> /tmp/ip_pipeline.cfg= ', > >> '#') > >> + self.dut.send_expect('echo [PIPELINE1] >> > /tmp/ip_pipeline.cfg', > >> '#') > >> + self.dut.send_expect('echo type =3D FLOW_CLASSIFICATION >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo core =3D 1 >> /tmp/ip_pipeline.cfg= ', > >> '#') > >> + self.dut.send_expect('echo pktq_in =3D RXQ0.0 RXQ1.0 >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo pktq_out =3D TXQ0.0 TXQ1.0 SINK0 >= > > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo n_flows =3D 65536 >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo key_size =3D 16 >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo key_offset =3D 278 >> > >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo key_mask =3D > >> 00FF0000FFFFFFFFFFFFFFFFFFFFFFFF >> /tmp/ip_pipeline.cfg', '#') > >> + self.dut.send_expect('echo flowid_offset =3D 128 >> > >> /tmp/ip_pipeline.cfg', '#') > >> + > >> def start_ip_pipeline(self, ports): > >> - command_line =3D "./examples/ip_pipeline/build/ip_pipeline -c > %s -n > >> %d -- -p %s" % \ > >> - (self.coremask, > >> - self.dut.get_memory_channels(), > >> - ports) > >> + command_line =3D "./examples/ip_pipeline/build/ip_pipeline -p > %s -f > >> /tmp/ip_pipeline.cfg" % ports > >> > >> out =3D self.dut.send_expect(command_line, 'pipeline>', 60) > >> sleep(5) # 'Initialization completed' is not the last > output, > >> some > >> @@ -150,10 +186,10 @@ class TestIPPipeline(TestCase): > >> """ > >> > >> for iface in ifaces: > >> + command =3D ('rm -f tcpdump_{0}.pcap').format(iface) > >> + self.tester.send_expect(command, '#') > >> command =3D ( > >> 'tcpdump -w tcpdump_{0}.pcap -i {0} 2>tcpdump_{0}.out > >> &').format(iface) > >> - self.tester.send_expect( > >> - 'rm -f tcpdump_{0}.pcap', '#').format(iface) > >> self.tester.send_expect(command, '#') > >> > >> def tcpdump_stop_sniff(self): > >> @@ -200,15 +236,13 @@ class TestIPPipeline(TestCase): > >> > >> tx_port =3D self.tester.get_local_port( > self.dut_ports[from_port]) > >> rx_port =3D self.tester.get_local_port(self.dut_ports[to_port= ]) > >> + port0 =3D self.tester.get_local_port(self.dut_ports[0]) > >> > >> tx_interface =3D self.tester.get_interface(tx_port) > >> rx_interface =3D self.tester.get_interface(rx_port) > >> > >> self.tcpdump_start_sniffing([tx_interface, rx_interface]) > >> > >> - self.dut.send_expect('link 0 up', 'pipeline>') > >> - self.dut.send_expect('link 1 up', 'pipeline>') > >> - > >> timeout =3D frames_number * inter + 2 > >> inter =3D ", inter=3D%d" % inter > >> > >> @@ -225,64 +259,58 @@ class TestIPPipeline(TestCase): > >> > >> self.tcpdump_stop_sniff() > >> > >> - self.dut.send_expect('link 0 down', 'pipeline>') > >> - self.dut.send_expect('link 1 down', 'pipeline>') > >> - > >> rx_stats =3D self.number_of_packets('tcpdump_%s.pcap' % > >> rx_interface) > >> tx_stats =3D self.number_of_packets('tcpdump_%s.pcap' % > >> tx_interface) > >> > >> # Do not count the sent frames in the tx_interface > >> tx_stats =3D tx_stats - frames_number > >> > >> - return {'rx': rx_stats, 'tx': tx_stats} > >> + if port0 =3D=3D tx_port: > >> + return {'rx0': tx_stats, 'rx1': rx_stats} > >> + else: > >> + return {'rx0': rx_stats, 'rx1': tx_stats} > >> > >> def check_results(self, stats, expected): > >> """ > >> - This function check that the Rx and Tx stats matches the > >> expected. > >> - expected =3D [Rx, Tx] > >> + This function check that the received packet numbers of port0 > and > >> port1 match the expected. > >> + expected =3D [Rx0, Rx1] > >> """ > >> > >> - for port in ['rx', 'tx']: > >> + for port in ['rx0', 'rx1']: > >> self.verify(stats[port] =3D=3D expected[port], > >> 'Frames expected (%s) and received (%s) > mismatch > >> on %s port' % ( > >> expected[port], stats[port], port)) > >> > >> def pipeline_command(self, command): > >> out =3D self.dut.send_expect(command, 'pipeline>') > >> - self.verify("Illegal" not in out, "Pipeline command error 1: > >> '%s'" % command) > >> - self.verify("Bad" not in out, "Pipeline command error 2: '%s'= " > % > >> command) > >> + self.verify("arguments" not in out, "Incorrect arguments: > '%s'" % > >> command) > >> + self.verify("Invalid" not in out, "Invalid argument: '%s'" % > >> command) > >> + self.verify("Syntax error" not in out, "Syntax error: '%s'" % > >> command) > >> return out > >> > >> - def pipeline_add_flow(self, port, src_ip, dst_ip, src_port, > dst_port, > >> + def pipeline_add_flow(self, port, src_ip, dst_ip, src_port, > dst_port, > >> flowid, > >> protocol=3D6): > >> - command =3D 'flow add %s %s %d %d %d %d' % (src_ip, dst_ip, > >> src_port, > >> - dst_port, protocol, > >> port) > >> + command =3D 'p 1 flow add ipv4 %s %s %d %d %d port %d id %d' = % > >> (src_ip, dst_ip, src_port, > >> + dst_port, protocol, > >> port, flowid) > >> out =3D self.pipeline_command(command) > >> - self.verify("Adding flow" in out, "Add flow error") > >> + self.verify("failed" not in out, "Add flow error") > >> > >> def pipeline_del_flow(self, src_ip, dst_ip, src_port, dst_port, > >> protocol=3D6): > >> - command =3D 'flow del %s %s %d %d %d' % (src_ip, dst_ip, > src_port, > >> + command =3D 'p 1 flow del ipv4 %s %s %d %d %d' % (src_ip, dst= _ip, > >> src_port, > >> dst_port, protocol) > >> out =3D self.pipeline_command(command) > >> - self.verify("Deleting flow" in out, "Del flow error") > >> + self.verify("failed" not in out, "Del flow error") > >> > >> def pipeline_add_route(self, port, src_ip, netmask, gw_ip): > >> - command =3D 'route add %s %d %d %s' % (src_ip, netmask, port, > >> gw_ip) > >> + command =3D 'p 1 route add %s %d port %d ether %s' % (src_ip, > >> netmask, port, gw_ip) > >> out =3D self.pipeline_command(command) > >> - self.verify("Adding route" in out, "Add route error") > >> + self.verify("failed" not in out, "Add route error") > >> > >> def pipeline_del_route(self, src_ip, netmask): > >> - command =3D 'route del %s %d' % (src_ip, netmask) > >> + command =3D 'p 1 route del %s %d' % (src_ip, netmask) > >> out =3D self.pipeline_command(command) > >> - self.verify("Deleting route" in out, "Del route error") > >> - > >> - def pipeline_traffic_burst(self): > >> - self.dut.send_expect('link 0 up', 'pipeline>') > >> - self.dut.send_expect('link 1 up', 'pipeline>') > >> - sleep(0.1) > >> - self.dut.send_expect('link 0 down', 'pipeline>') > >> - self.dut.send_expect('link 1 down', 'pipeline>') > >> + self.verify("failed" not in out, "Del route error") > >> > >> def set_up_all(self): > >> """ > >> @@ -291,14 +319,8 @@ class TestIPPipeline(TestCase): > >> PMD prerequisites. > >> """ > >> > >> - # Check for port availability > >> - self.needed_ports =3D {"niantic": 2, > >> - "I217V": 1, > >> - "I217LM": 1, > >> - "I218V": 1, > >> - "I218LM": 1} > >> self.dut_ports =3D self.dut.get_ports() > >> - self.verify(len(self.dut_ports) >=3D > self.needed_ports[self.nic], > >> + self.verify(len(self.dut_ports) >=3D 2, > >> "Insufficient ports for speed testing") > > > > > > If we access both ports from remain parts of the code, than why we chec= k > for > > single port for specific platforms. > > In other words what was was the purpose of those removed lines? > > > > I saw that 2 ports were used in the tests, so I think it's better to > remove them. > > >> > >> > >> out =3D self.dut.build_dpdk_apps("./examples/ip_pipeline") > >> @@ -324,9 +346,10 @@ class TestIPPipeline(TestCase): > >> pcap_file =3D 'ip_pipeline.pcap' > >> frame_size =3D 64 > >> > >> + self.create_passthrough_cfgfile() > >> self.start_ip_pipeline(ports=3Dself.ports_mask) > >> self.dut.send_expect( > >> - 'run examples/ip_pipeline/ip_pipeline.sh', 'pipeline>', > 10) > >> + 'run examples/ip_pipeline/config/ip_pipeline.sh', > >> 'pipeline>', 10) > >> > >> # Create a PCAP file containing the maximum frames_number of > >> frames needed > >> # with fixed size and incremental IP > >> @@ -342,13 +365,13 @@ class TestIPPipeline(TestCase): > >> stats =3D self.send_and_sniff_pcap_file(pcap_file, > >> frames_number, > >> 1, 0, inter) > >> > >> - expected =3D {'tx': 0, 'rx': frames_number} > >> + expected =3D {'rx0': frames_number, 'rx1': 0} > >> self.check_results(stats, expected) > >> > >> stats =3D self.send_and_sniff_pcap_file(pcap_file, > >> frames_number, > >> 0, 1, inter) > >> > >> - expected =3D {'tx': frames_number, 'rx': 0} > >> + expected =3D {'rx0': 0, 'rx1': frames_number} > >> self.check_results(stats, expected) > >> > >> def test_frame_sizes(self): > >> @@ -359,9 +382,10 @@ class TestIPPipeline(TestCase): > >> frames_number =3D 100 > >> inter =3D 0.5 > >> > >> + self.create_passthrough_cfgfile() > >> self.start_ip_pipeline(ports=3Dself.ports_mask) > >> self.dut.send_expect( > >> - 'run examples/ip_pipeline/ip_pipeline.sh', 'pipeline>', > 10) > >> + 'run examples/ip_pipeline/config/ip_pipeline.sh', > >> 'pipeline>', 10) > >> > >> for frame_size in TestIPPipeline.frame_sizes: > >> > >> @@ -376,13 +400,13 @@ class TestIPPipeline(TestCase): > >> stats =3D self.send_and_sniff_pcap_file(pcap_file, > >> frames_number, > >> 1, 0, inter) > >> > >> - expected =3D {'tx': 0, 'rx': frames_number} > >> + expected =3D {'rx0': frames_number, 'rx1': 0} > >> self.check_results(stats, expected) > >> > >> stats =3D self.send_and_sniff_pcap_file(pcap_file, > >> frames_number, > >> 0, 1, inter) > >> > >> - expected =3D {'tx': frames_number, 'rx': 0} > >> + expected =3D {'rx0': 0, 'rx1': frames_number} > >> self.check_results(stats, expected) > >> > >> def test_flow_management(self): > >> @@ -392,11 +416,6 @@ class TestIPPipeline(TestCase): > >> pcap_file =3D 'ip_pipeline.pcap' > >> frame_size =3D 64 > >> > >> - default_setup =3D ['arp add 0 0.0.0.1 0a:0b:0c:0d:0e:0f', > >> - 'arp add 1 0.128.0.1 1a:1b:1c:1d:1e:1f', > >> - 'route add 0.0.0.0 9 0 0.0.0.1', > >> - 'route add 0.128.0.0 9 1 0.128.0.1'] > >> - > >> ip_addrs =3D [ > >> '0.0.0.0', '0.0.0.1', '0.0.0.127', '0.0.0.128', > '0.0.0.255', > >> '0.0.1.0', '0.0.127.0', '0.0.128.0', '0.0.129.0', > >> '0.0.255.0', > >> @@ -409,30 +428,32 @@ class TestIPPipeline(TestCase): > >> frames.append(self.create_tcp_ipv4_frame(0, '0.0.0.0', > addr, > >> frame_size)) > >> > >> + self.create_flow_cfgfile() > >> self.create_pcap_file_from_frames(pcap_file, frames) > >> self.tester.session.copy_file_to(pcap_file) > >> > >> # Start ip_pipeline app and setup defaults > >> self.start_ip_pipeline(ports=3Dself.ports_mask) > >> - for command in default_setup: > >> - self.pipeline_command(command) > >> + > >> + # default to SINK0 > >> + self.pipeline_command('p 1 flow add default 3') > >> > >> # Check that no traffic pass though > >> stats =3D self.send_and_sniff_pcap_file(pcap_file, len(frames= ), > >> 1, 0, 0.2) > >> - expected =3D {'tx': 0, 'rx': 0} > >> + expected =3D {'rx0': 0, 'rx1': 0} > >> self.check_results(stats, expected) > >> > >> # Add the flows > >> flows_added =3D 0 > >> for addrs in ip_addrs: > >> - self.pipeline_add_flow(1, '0.0.0.0', addrs, 0, 0) > >> + self.pipeline_add_flow(0, '0.0.0.0', addrs, 0, 0, > >> flows_added) > >> flows_added +=3D 1 > >> > >> # Check that traffic matching flows pass though > >> stats =3D self.send_and_sniff_pcap_file(pcap_file, > len(frames), > >> 1, 0, 0.2) > >> - expected =3D {'tx': 0, 'rx': flows_added} > >> + expected =3D {'rx0': flows_added, 'rx1': 0} > >> self.check_results(stats, expected) > >> > >> # Remove flows > >> @@ -443,7 +464,7 @@ class TestIPPipeline(TestCase): > >> # Check that traffic matching flows pass though > >> stats =3D self.send_and_sniff_pcap_file(pcap_file, > len(frames), > >> 1, 0, 0.2) > >> - expected =3D {'tx': 0, 'rx': flows_added} > >> + expected =3D {'rx0': flows_added, 'rx1': 0} > >> self.check_results(stats, expected) > >> > >> out =3D self.dut.send_expect('flow print', 'pipeline>') > >> @@ -452,7 +473,7 @@ class TestIPPipeline(TestCase): > >> # Check that again no traffic pass though > >> stats =3D self.send_and_sniff_pcap_file(pcap_file, len(frames= ), > >> 1, 0, 0.2) > >> - expected =3D {'tx': 0, 'rx': 0} > >> + expected =3D {'rx0': 0, 'rx1': 0} > >> self.check_results(stats, expected) > >> > >> self.quit_ip_pipeline() > >> @@ -464,9 +485,8 @@ class TestIPPipeline(TestCase): > >> pcap_file =3D 'ip_pipeline.pcap' > >> frame_size =3D 64 > >> > >> - default_setup =3D ['arp add 0 0.0.0.1 0a:0b:0c:0d:0e:0f', > >> - 'arp add 1 0.128.0.1 1a:1b:1c:1d:1e:1f', > >> - 'flow add all'] > >> + default_setup =3D ['p 1 arp add 0 0.0.0.1 0a:0b:0c:0d:0e:0f', > >> + 'p 1 arp add 1 0.128.0.1 1a:1b:1c:1d:1e:1f'] > >> > >> ip_addrs =3D [ > >> '0.0.0.0', '0.0.0.1', '0.0.0.127', '0.0.0.128', > '0.0.0.255', > >> @@ -483,6 +503,7 @@ class TestIPPipeline(TestCase): > >> self.create_pcap_file_from_frames(pcap_file, frames) > >> self.tester.session.copy_file_to(pcap_file) > >> > >> + self.create_routing_cfgfile() > >> # Start ip_pipeline app and setup defaults > >> self.start_ip_pipeline(ports=3Dself.ports_mask) > >> for command in default_setup: > >> @@ -491,7 +512,7 @@ class TestIPPipeline(TestCase): > >> # Check that no traffic pass though > >> stats =3D self.send_and_sniff_pcap_file(pcap_file, len(frames= ), > >> 1, 0, 0.2) > >> - expected =3D {'tx': 0, 'rx': 0} > >> + expected =3D {'rx0': 0, 'rx1': 0} > >> self.check_results(stats, expected) > >> > >> # Add the routes > >> @@ -504,7 +525,7 @@ class TestIPPipeline(TestCase): > >> stats =3D self.send_and_sniff_pcap_file(pcap_file, > len(frames), > >> 1, 0, 0.2) > >> > >> - expected =3D {'tx': 0, 'rx': routes_added} > >> + expected =3D {'rx0': routes_added, 'rx1': 0} > >> self.check_results(stats, expected) > >> > >> # Remove routes > >> @@ -515,7 +536,7 @@ class TestIPPipeline(TestCase): > >> # Check that traffic matching flows pass though > >> stats =3D self.send_and_sniff_pcap_file(pcap_file, > len(frames), > >> 1, 0, 0.2) > >> - expected =3D {'tx': 0, 'rx': routes_added} > >> + expected =3D {'rx0': routes_added, 'rx1': 0} > >> self.check_results(stats, expected) > >> > >> out =3D self.dut.send_expect('route print', 'pipeline>') > >> @@ -524,7 +545,7 @@ class TestIPPipeline(TestCase): > >> # Check that again no traffic pass though > >> stats =3D self.send_and_sniff_pcap_file(pcap_file, len(frames= ), > >> 1, 0, 0.2) > >> - expected =3D {'tx': 0, 'rx': 0} > >> + expected =3D {'rx0': 0, 'rx1': 0} > >> self.check_results(stats, expected) > >> > >> self.quit_ip_pipeline() > >> @@ -539,5 +560,7 @@ class TestIPPipeline(TestCase): > >> """ > >> Run after each test suite. > >> """ > >> + self.dut.send_expect("rm /tmp/ip_pipeline.cfg", "#") > >> + self.dut.send_expect("rm /tmp/ip_pipeline.cfg.out", "#") > >> out =3D self.dut.build_dpdk_apps("./examples/ip_pipeline") > >> self.verify("Error" not in out, "Compilation error") > >> -- > >> 1.9.1 > >> > > > --f403045d5af0cd44eb05586f851c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I understand that. But do we also understand why this tabl= e was coded in first place?
What was the reason of deal with those nics= differently even if always access both ports?

Yong Liu is an author of this test and=C2=A0Ravi Kerur added the change f= or nics which require only 1 port.
Lets ask them for opinion.=


2017-09-05 3:58 GMT+02:00 Jianbo Liu <= ;jianbo.liu@lina= ro.org>:
On 4 September 2017 at 17:39, Rados=C5=82aw Biernacki= <rad@semihalf.com> wrote: > 2017-08-21 12:30 GMT+02:00 Jianbo Liu <jianbo.liu@linaro.org>:
>>
>> The ip_pipeline was changed a lot, and the configuration and comma= nds
>> are different from those in this testing case.
>>
>> Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
>> ---
>>=C2=A0 tests/TestSuite_ip_pipeline.py | 157
>> +++++++++++++++++++++++------------------
>>=C2=A0 1 file changed, 90 insertions(+), 67 deletions(-)
>>
>> diff --git a/tests/TestSuite_ip_pipeline.py
>> b/tests/TestSuite_ip_pipeline.py
>> index 90dba31..300b1de 100644
>> --- a/tests/TestSuite_ip_pipeline.py
>> +++ b/tests/TestSuite_ip_pipeline.py
>> @@ -124,11 +124,47 @@ class TestIPPipeline(TestCase):
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 writer.close()
>>
>> +=C2=A0 =C2=A0 def create_passthrough_cfgfile(self):
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo [PIPEL= INE0] > /tmp/ip_pipeline.cfg',
>> '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo type = =3D MASTER >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo core = =3D 0 >> /tmp/ip_pipeline.cfg',
>> '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo [PIPEL= INE1] >> /tmp/ip_pipeline.cfg',
>> '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo type = =3D PASS-THROUGH >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo core = =3D 1 >> /tmp/ip_pipeline.cfg',
>> '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo pktq_i= n =3D RXQ0.0 RXQ1.0 >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo pktq_o= ut =3D TXQ1.0 TXQ0.0 >>
>> /tmp/ip_pipeline.cfg', '#')
>> +
>> +=C2=A0 =C2=A0 def create_routing_cfgfile(self):
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo [PIPEL= INE0] > /tmp/ip_pipeline.cfg',
>> '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo type = =3D MASTER >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo core = =3D 0 >> /tmp/ip_pipeline.cfg',
>> '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo [PIPEL= INE1] >> /tmp/ip_pipeline.cfg',
>> '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo type = =3D ROUTING >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo core = =3D 1 >> /tmp/ip_pipeline.cfg',
>> '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo pktq_i= n =3D RXQ0.0 RXQ1.0 >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo pktq_o= ut =3D TXQ0.0 TXQ1.0 >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo encap = =3D ethernet >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo ip_hdr= _offset =3D 270 >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo arp_ke= y_offset =3D 128 >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo n_arp_= entries =3D 1000 >>
>> /tmp/ip_pipeline.cfg', '#')
>> +
>> +=C2=A0 =C2=A0 def create_flow_cfgfile(self):
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo [PIPEL= INE0] > /tmp/ip_pipeline.cfg',
>> '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo type = =3D MASTER >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo core = =3D 0 >> /tmp/ip_pipeline.cfg',
>> '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo [PIPEL= INE1] >> /tmp/ip_pipeline.cfg',
>> '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo type = =3D FLOW_CLASSIFICATION >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo core = =3D 1 >> /tmp/ip_pipeline.cfg',
>> '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo pktq_i= n =3D RXQ0.0 RXQ1.0 >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo pktq_o= ut =3D TXQ0.0 TXQ1.0 SINK0 >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo n_flow= s =3D 65536 >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo key_si= ze =3D 16 >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo key_of= fset =3D 278 >>
>> /tmp/ip_pipeline.cfg', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo key_ma= sk =3D
>> 00FF0000FFFFFFFFFFFFFFFFFFFFFFFF >> /tmp/ip_pipeline.cf= g', '#')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('echo flowid= _offset =3D 128 >>
>> /tmp/ip_pipeline.cfg', '#')
>> +
>>=C2=A0 =C2=A0 =C2=A0 def start_ip_pipeline(self, ports):
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 command_line =3D "./examples/ip_= pipeline/build/ip_pipeline -c %s -n
>> %d -- -p %s" % \
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (self.coremask,
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0self.dut.get_memo= ry_channels(),
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ports)
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 command_line =3D "./examples/ip_= pipeline/build/ip_pipeline -p %s -f
>> /tmp/ip_pipeline.cfg" % ports
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 out =3D self.dut.send_expect(com= mand_line, 'pipeline>', 60)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sleep(5)=C2=A0 =C2=A0 # 'Ini= tialization completed' is not the last output,
>> some
>> @@ -150,10 +186,10 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 """
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for iface in ifaces:
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 command =3D ('rm -f= tcpdump_{0}.pcap').format(iface)
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.tester.send_expect= (command, '#')
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 command =3D (
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 '= ;tcpdump -w tcpdump_{0}.pcap -i {0} 2>tcpdump_{0}.out
>> &').format(iface)
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.tester.send_expect= (
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'rm -= f tcpdump_{0}.pcap', '#').format(iface)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.tester.send_e= xpect(command, '#')
>>
>>=C2=A0 =C2=A0 =C2=A0 def tcpdump_stop_sniff(self):
>> @@ -200,15 +236,13 @@ class TestIPPipeline(TestCase):
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tx_port =3D self.tester.get_loca= l_port(self.dut_ports[from_port])
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rx_port =3D self.tester.get_loca= l_port(self.dut_ports[to_port])
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 port0 =3D self.tester.get_local_port(= self.dut_ports[0])
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tx_interface =3D self.tester.get= _interface(tx_port)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rx_interface =3D self.tester.get= _interface(rx_port)
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.tcpdump_start_sniffing([tx_interface, rx_interface])
>>
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('link 0 up&#= 39;, 'pipeline>')
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('link 1 up&#= 39;, 'pipeline>')
>> -
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 timeout =3D frames_number * inte= r + 2
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 inter =3D ", inter=3D%d&quo= t; % inter
>>
>> @@ -225,64 +259,58 @@ class TestIPPipeline(TestCase):
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.tcpdump_stop_sniff()
>>
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('link 0 down= ', 'pipeline>')
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('link 1 down= ', 'pipeline>')
>> -
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 rx_stats =3D self.number_of_pack= ets('tcpdump_%s.pcap' %
>> rx_interface)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tx_stats =3D self.number_of_pack= ets('tcpdump_%s.pcap' %
>> tx_interface)
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Do not count the sent frames i= n the tx_interface
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 tx_stats =3D tx_stats - frames_n= umber
>>
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 return {'rx': rx_stats, '= tx': tx_stats}
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 if port0 =3D=3D tx_port:
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return {'rx0': = tx_stats, 'rx1': rx_stats}
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 else:
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return {'rx0': = rx_stats, 'rx1': tx_stats}
>>
>>=C2=A0 =C2=A0 =C2=A0 def check_results(self, stats, expected):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 """
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 This function check that the Rx and T= x stats matches the
>> expected.
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D [Rx, Tx]
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 This function check that the received= packet numbers of port0 and
>> port1 match the expected.
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D [Rx0, Rx1]
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 """
>>
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 for port in ['rx', 'tx= 9;]:
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 for port in ['rx0', 'rx1&= #39;]:
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify(stats[= port] =3D=3D expected[port],
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 'Frames expected (%s) and received (%s) mismat= ch
>> on %s port' % (
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expe= cted[port], stats[port], port))
>>
>>=C2=A0 =C2=A0 =C2=A0 def pipeline_command(self, command):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 out =3D self.dut.send_expect(com= mand, 'pipeline>')
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify("Illegal" not i= n out, "Pipeline command error 1:
>> '%s'" % command)
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify("Bad" not in ou= t, "Pipeline command error 2: '%s'" %
>> command)
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify("arguments" not= in out, "Incorrect arguments: '%s'" %
>> command)
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify("Invalid" not i= n out, "Invalid argument: '%s'" %
>> command)
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify("Syntax error" = not in out, "Syntax error: '%s'" %
>> command)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return out
>>
>> -=C2=A0 =C2=A0 def pipeline_add_flow(self, port, src_ip, dst_ip, s= rc_port, dst_port,
>> +=C2=A0 =C2=A0 def pipeline_add_flow(self, port, src_ip, dst_ip, s= rc_port, dst_port,
>> flowid,
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 protocol=3D6):
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 command =3D 'flow add %s %s %d %d= %d %d' % (src_ip, dst_ip,
>> src_port,
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dst_port, protocol,
>> port)
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 command =3D 'p 1 flow add ipv4 %s= %s %d %d %d port %d id %d' %
>> (src_ip, dst_ip, src_port,
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dst_port, protocol,
>> port, flowid)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 out =3D self.pipeline_command(co= mmand)
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify("Adding flow" i= n out, "Add flow error")
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify("failed" not in= out, "Add flow error")
>>
>>=C2=A0 =C2=A0 =C2=A0 def pipeline_del_flow(self, src_ip, dst_ip, sr= c_port, dst_port,
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 protocol=3D6):
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 command =3D 'flow del %s %s %d %d= %d' % (src_ip, dst_ip, src_port,
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 command =3D 'p 1 flow del ipv4 %s= %s %d %d %d' % (src_ip, dst_ip,
>> src_port,
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dst_port, protocol)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 out =3D self.pipeline_command(co= mmand)
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify("Deleting flow"= in out, "Del flow error")
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify("failed" not in= out, "Del flow error")
>>
>>=C2=A0 =C2=A0 =C2=A0 def pipeline_add_route(self, port, src_ip, net= mask, gw_ip):
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 command =3D 'route add %s %d %d %= s' % (src_ip, netmask, port,
>> gw_ip)
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 command =3D 'p 1 route add %s %d = port %d ether %s' % (src_ip,
>> netmask, port, gw_ip)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 out =3D self.pipeline_command(co= mmand)
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify("Adding route" = in out, "Add route error")
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify("failed" not in= out, "Add route error")
>>
>>=C2=A0 =C2=A0 =C2=A0 def pipeline_del_route(self, src_ip, netmask):=
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 command =3D 'route del %s %d'= % (src_ip, netmask)
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 command =3D 'p 1 route del %s %d&= #39; % (src_ip, netmask)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 out =3D self.pipeline_command(co= mmand)
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify("Deleting route"= ; in out, "Del route error")
>> -
>> -=C2=A0 =C2=A0 def pipeline_traffic_burst(self):
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('link 0 up&#= 39;, 'pipeline>')
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('link 1 up&#= 39;, 'pipeline>')
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 sleep(0.1)
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('link 0 down= ', 'pipeline>')
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect('link 1 down= ', 'pipeline>')
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify("failed" not in= out, "Del route error")
>>
>>=C2=A0 =C2=A0 =C2=A0 def set_up_all(self):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 """
>> @@ -291,14 +319,8 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PMD prerequisites.
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 """
>>
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 # Check for port availability
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.needed_ports =3D {"niantic&= quot;: 2,
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"I217V": 1,
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"I217LM": 1,
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"I218V": 1,
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"I218LM": 1}
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut_ports =3D self.dut.get_= ports()
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify(len(self.dut_ports) = >=3D self.needed_ports[self.nic],
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify(len(self.dut_ports) = >=3D 2,
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 "Insufficient ports for speed testing")
>
>
> If we access both ports from remain parts of the code, than why we che= ck for
> single port for specific platforms.
> In other words what was was the purpose of those removed lines?
>

I saw that 2 ports were used in the tests, so I think it's = better to
remove them.

>>
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 out =3D self.dut.build_dpdk_apps= ("./examples/ip_pipeline")
>> @@ -324,9 +346,10 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pcap_file =3D 'ip_pipeline.p= cap'
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 frame_size =3D 64
>>
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.create_passthrough_cfgfile(= )
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.start_ip_pipeline(ports=3D<= wbr>self.ports_mask)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect(
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'run examples/ip_pi= peline/ip_pipeline.sh', 'pipeline>', 10)
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'run examples/ip_pi= peline/config/ip_pipeline.sh',
>> 'pipeline>', 10)
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Create a PCAP file containing = the maximum frames_number of
>> frames needed
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # with fixed size and incrementa= l IP
>> @@ -342,13 +365,13 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stat= s =3D self.send_and_sniff_pcap_file(pcap_file,
>> frames_number,
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1, 0, inter)
>>
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected = =3D {'tx': 0, 'rx': frames_number}
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected = =3D {'rx0': frames_number, 'rx1': 0}
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self= .check_results(stats, expected)
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stat= s =3D self.send_and_sniff_pcap_file(pcap_file,
>> frames_number,
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0, 1, inter)
>>
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected = =3D {'tx': frames_number, 'rx': 0}
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected = =3D {'rx0': 0, 'rx1': frames_number}
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self= .check_results(stats, expected)
>>
>>=C2=A0 =C2=A0 =C2=A0 def test_frame_sizes(self):
>> @@ -359,9 +382,10 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 frames_number =3D 100
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 inter =3D 0.5
>>
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.create_passthrough_cfgfile(= )
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.start_ip_pipeline(ports=3D<= wbr>self.ports_mask)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect(
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'run examples/ip_pi= peline/ip_pipeline.sh', 'pipeline>', 10)
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'run examples/ip_pi= peline/config/ip_pipeline.sh',
>> 'pipeline>', 10)
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for frame_size in TestIPPipeline= .frame_sizes:
>>
>> @@ -376,13 +400,13 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stats =3D self.sen= d_and_sniff_pcap_file(pcap_file,
>> frames_number,
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1, 0, inter)
>>
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'tx&#= 39;: 0, 'rx': frames_number}
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'rx0&= #39;: frames_number, 'rx1': 0}
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.check_results= (stats, expected)
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stats =3D self.sen= d_and_sniff_pcap_file(pcap_file,
>> frames_number,
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 0, 1, inter)
>>
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'tx&#= 39;: frames_number, 'rx': 0}
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'rx0&= #39;: 0, 'rx1': frames_number}
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.check_results= (stats, expected)
>>
>>=C2=A0 =C2=A0 =C2=A0 def test_flow_management(self):
>> @@ -392,11 +416,6 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pcap_file =3D 'ip_pipeline.p= cap'
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 frame_size =3D 64
>>
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 default_setup =3D ['arp add 0 0.0= .0.1 0a:0b:0c:0d:0e:0f',
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0'arp add 1 0.128.0.1 1a:1b:1c:1d:1e:1f',=
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0'route add 0.0.0.0 9 0 0.0.0.1',
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0'route add 0.128.0.0 9 1 0.128.0.1']
>> -
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ip_addrs =3D [
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 '0.0.0.0',= '0.0.0.1', '0.0.0.127', '0.0.0.128', '0.0.0.25= 5',
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 '0.0.1.0',= '0.0.127.0', '0.0.128.0', '0.0.129.0',
>> '0.0.255.0',
>> @@ -409,30 +428,32 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 frames.append(self= .create_tcp_ipv4_frame(0, '0.0.0.0', addr,
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0frame_size))
>>
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.create_flow_cfgfile()
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.create_pcap_file_from_= frames(pcap_file, frames)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.tester.session.copy_file_to(pcap_file)
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Start ip_pipeline app and setu= p defaults
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.start_ip_pipeline(ports=3D<= wbr>self.ports_mask)
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 for command in default_setup:
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.pipeline_command(c= ommand)
>> +
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 # default to SINK0
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.pipeline_command('p 1 flow a= dd default 3')
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Check that no traffic pass tho= ugh
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stats =3D self.send_and_sniff_pc= ap_file(pcap_file, len(frames),
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 1, 0, 0.2)
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'tx': 0, 'r= x': 0}
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'rx0': 0, '= rx1': 0}
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.check_results(stats, expect= ed)
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Add the flows
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 flows_added =3D 0
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for addrs in ip_addrs:
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.pipeline_add_flow(= 1, '0.0.0.0', addrs, 0, 0)
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.pipeline_add_flow(= 0, '0.0.0.0', addrs, 0, 0,
>> flows_added)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 flows_added +=3D 1=
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Check that traff= ic matching flows pass though
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stats =3D self.sen= d_and_sniff_pcap_file(pcap_file, len(frames),
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1, 0, 0.2)
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'tx&#= 39;: 0, 'rx': flows_added}
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'rx0&= #39;: flows_added, 'rx1': 0}
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.check_results= (stats, expected)
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Remove flows
>> @@ -443,7 +464,7 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Check that traff= ic matching flows pass though
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stats =3D self.sen= d_and_sniff_pcap_file(pcap_file, len(frames),
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1, 0, 0.2)
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'tx&#= 39;: 0, 'rx': flows_added}
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'rx0&= #39;: flows_added, 'rx1': 0}
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.check_results= (stats, expected)
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 out =3D self.dut.send_expect(= 9;flow print', 'pipeline>')
>> @@ -452,7 +473,7 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Check that again no traffic pa= ss though
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stats =3D self.send_and_sniff_pc= ap_file(pcap_file, len(frames),
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 1, 0, 0.2)
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'tx': 0, 'r= x': 0}
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'rx0': 0, '= rx1': 0}
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.check_results(stats, expect= ed)
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.quit_ip_pipeline()
>> @@ -464,9 +485,8 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pcap_file =3D 'ip_pipeline.p= cap'
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 frame_size =3D 64
>>
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 default_setup =3D ['arp add 0 0.0= .0.1 0a:0b:0c:0d:0e:0f',
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0'arp add 1 0.128.0.1 1a:1b:1c:1d:1e:1f',=
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0'flow add all']
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 default_setup =3D ['p 1 arp add 0= 0.0.0.1 0a:0b:0c:0d:0e:0f',
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0'p 1 arp add 1 0.128.0.1 1a:1b:1c:1d:1e:1f&#= 39;]
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ip_addrs =3D [
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 '0.0.0.0',= '0.0.0.1', '0.0.0.127', '0.0.0.128', '0.0.0.25= 5',
>> @@ -483,6 +503,7 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.create_pcap_file_from_= frames(pcap_file, frames)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.tester.session.copy_file_to(pcap_file)
>>
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.create_routing_cfgfile()
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Start ip_pipeline app and setu= p defaults
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.start_ip_pipeline(ports=3D<= wbr>self.ports_mask)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for command in default_setup: >> @@ -491,7 +512,7 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Check that no traffic pass tho= ugh
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stats =3D self.send_and_sniff_pc= ap_file(pcap_file, len(frames),
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 1, 0, 0.2)
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'tx': 0, 'r= x': 0}
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'rx0': 0, '= rx1': 0}
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.check_results(stats, expect= ed)
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Add the routes
>> @@ -504,7 +525,7 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stats =3D self.sen= d_and_sniff_pcap_file(pcap_file, len(frames),
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1, 0, 0.2)
>>
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'tx&#= 39;: 0, 'rx': routes_added}
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'rx0&= #39;: routes_added, 'rx1': 0}
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.check_results= (stats, expected)
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Remove routes
>> @@ -515,7 +536,7 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Check that traff= ic matching flows pass though
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stats =3D self.sen= d_and_sniff_pcap_file(pcap_file, len(frames),
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1, 0, 0.2)
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'tx&#= 39;: 0, 'rx': routes_added}
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'rx0&= #39;: routes_added, 'rx1': 0}
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.check_results= (stats, expected)
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 out =3D self.dut.send_expect(= 9;route print', 'pipeline>')
>> @@ -524,7 +545,7 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Check that again no traffic pa= ss though
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stats =3D self.send_and_sniff_pc= ap_file(pcap_file, len(frames),
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 1, 0, 0.2)
>> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'tx': 0, 'r= x': 0}
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 expected =3D {'rx0': 0, '= rx1': 0}
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.check_results(stats, expect= ed)
>>
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.quit_ip_pipeline()
>> @@ -539,5 +560,7 @@ class TestIPPipeline(TestCase):
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 """
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Run after each test suite.
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 """
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect("rm /tmp/ip= _pipeline.cfg", "#")
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 self.dut.send_expect("rm /tmp/ip= _pipeline.cfg.out", "#")
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 out =3D self.dut.build_dpdk_apps= ("./examples/ip_pipeline")
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.verify("Error" no= t in out, "Compilation error")
>> --
>> 1.9.1
>>
>

--f403045d5af0cd44eb05586f851c--