summaryrefslogtreecommitdiffstats
path: root/src/vlib/main.h
AgeCommit message (Expand)AuthorFilesLines
2020-11-25vlib: add elog events for vlib log entriesDave Barach1-0/+1
2020-11-04vlib: add postmortem pcap dispatch traceDave Barach1-0/+2
2020-10-06misc: add xxx_not_inlineDave Barach1-0/+2
2020-09-02fib: IPv6 lookup data structure MP safe when prefixes changeNeale Ranns1-1/+1
2020-07-16misc: add callback hooks and refactor pmcTom Seidenberg1-10/+69
2020-06-16vlib: address sanitizer support for stack switch, enable clangDamjan Marion1-0/+4
2020-04-28vlib: add ASSERT to vlib_time_now(...)Dave Barach1-0/+7
2020-04-13buffers: configurable buffer fault injectorDave Barach1-0/+4
2020-02-18vlib: calculate per-worker loops/second metricDave Barach1-0/+8
2019-12-05classify: vpp packet tracer supportDave Barach1-0/+10
2019-10-02vlib: improve summary vector-rate statisticsDave Barach1-58/+32
2019-09-23misc: unify pcap rx / tx / drop traceDave Barach1-2/+9
2019-09-20misc: classifier-based packet trace filterDave Barach1-0/+1
2019-09-07vlib: clean up the "pcap dispatch trace" debug CLIDave Barach1-0/+13
2019-08-01interface: fix pcap tx/rx trace cli handlingJohn Lo1-6/+0
2019-05-24Add callback multiplex supportDave Barach1-6/+12
2019-05-01Add node, frame to vlib main loop perf analysis callback argumentsDave Barach1-1/+3
2019-03-12Perf tune handoff queue pollingDave Barach1-0/+3
2019-02-26Move pcap rx/tx trace code out of the dpdk pluginDave Barach1-0/+16
2019-02-20calculate per-thread time offsetDave Barach1-1/+4
2019-02-02CLI control of graph dispatch elogsDave Barach1-0/+3
2019-01-30buffers: major cleanup and improvementsDamjan Marion1-3/+0
2019-01-27Fix issue with cpu_id and numa_code captured too earlyDamjan Marion1-1/+1
2019-01-24perfmon plugin: 2-way parallel stat collectionDave Barach1-3/+2
2019-01-20buffers: keep buffer_main in vlib_main_tDamjan Marion1-0/+3
2019-01-20Store numa-noda and cpu-index in vlib_main_tDamjan Marion1-1/+3
2018-11-30Metadata / opaque formatting belongs in vppDave Barach1-0/+1
2018-11-20Add buffer tracing to the dispatch tracerDave Barach1-0/+3
2018-11-17pcap-based dispatch tracerDave Barach1-0/+5
2018-11-01Move RPC calls off the binary API input queueDave Barach1-1/+3
2018-10-25Revert "Keep RPC traffic off the shared-memory API queue"Florin Coras1-1/+0
2018-10-24Keep RPC traffic off the shared-memory API queueDave Barach1-0/+1
2018-10-23Numa-aware, growable physical memory allocator (pmalloc)Damjan Marion1-17/+2
2018-10-22X86_64 perf counter pluginDave Barach1-0/+9
2018-10-01API / CLI event-log tracingDave Barach1-4/+4
2018-09-03Deprecate old buffer replication schemeDamjan Marion1-3/+0
2018-07-18Add config option to use dlmalloc instead of mheapDave Barach1-1/+6
2018-06-03dpdk: improve buffer alloc perfomanceDamjan Marion1-2/+0
2018-03-27vlib: make cloned structures cacheline alignedDamjan Marion1-0/+1
2018-03-14vlib: internal buffer manager reworkDamjan Marion1-1/+5
2018-03-05physmem: keep only one physmem_mainDamjan Marion1-2/+0
2017-12-15VPP-1102: fix dangling references in RPC handlingDave Barach1-0/+3
2017-10-14VPP-1029: Don't call clib_longjmp(...) directly from the SIGTERM handlerDave Barach1-0/+5
2017-09-11Recombine diags and minimum barrier open time changes (VPP-968)Colin Tregenza Dancer1-0/+9
2017-09-07vlib physmem reworkDamjan Marion1-2/+14
2017-09-05Refork worker thread data structures in parallel (VPP-970)Colin Tregenza Dancer1-0/+6
2017-05-16VPP-845: add configurable elog post-mortem dumpDave Barach1-0/+4
2017-05-10completelly deprecate os_get_cpu_number, replace new occurencesDamjan Marion1-1/+1
2017-04-06Use thread local storage for thread indexDamjan Marion1-1/+1
2017-03-31vlib: extend foreach_vlib_main macro to assert if workers are not parkedDamjan Marion1-0/+3
="o">.assertEqual(sd_params.get('IATYP'), 'IPv4') self.assertEqual(sd_params.get('ISADDR'), isaddr) self.assertEqual(sd_params.get('ISPORT'), "%d" % isport) self.assertEqual(sd_params.get('XATYP'), 'IPv4') self.assertEqual(sd_params.get('XSADDR'), xsaddr) self.assertEqual(sd_params.get('XSPORT'), "%d" % xsport) self.assertEqual(sd_params.get('PROTO'), "%d" % proto) self.assertTrue(sd_params.get('SSUBIX') is not None) self.assertEqual(sd_params.get('SV6ENC'), sv6enc) def test_dslite(self): """ Test DS-Lite """ nat_config = self.vapi.nat_show_config() self.assertEqual(0, nat_config.dslite_ce) self.vapi.dslite_add_del_pool_addr_range(start_addr=self.nat_addr, end_addr=self.nat_addr, is_add=1) aftr_ip4 = '192.0.0.1' aftr_ip6 = '2001:db8:85a3::8a2e:370:1' self.vapi.dslite_set_aftr_addr(ip4_addr=aftr_ip4, ip6_addr=aftr_ip6) self.vapi.syslog_set_sender(self.pg2.local_ip4, self.pg2.remote_ip4) # UDP p = (Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) / IPv6(dst=aftr_ip6, src=self.pg1.remote_hosts[0].ip6) / IP(dst=self.pg0.remote_ip4, src='192.168.1.1') / UDP(sport=20000, dport=10000)) self.pg1.add_stream(p) self.pg_enable_capture(self.pg_interfaces) self.pg_start() capture = self.pg0.get_capture(1) capture = capture[0] self.assertFalse(capture.haslayer(IPv6)) self.assertEqual(capture[IP].src, self.nat_addr) self.assertEqual(capture[IP].dst, self.pg0.remote_ip4) self.assertNotEqual(capture[UDP].sport, 20000) self.assertEqual(capture[UDP].dport, 10000) self.assert_packet_checksums_valid(capture) out_port = capture[UDP].sport capture = self.pg2.get_capture(1) self.verify_syslog_apmadd(capture[0][Raw].load, '192.168.1.1', 20000, self.nat_addr, out_port, self.pg1.remote_hosts[0].ip6, IP_PROTOS.udp) p = (Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) / IP(dst=self.nat_addr, src=self.pg0.remote_ip4) / UDP(sport=10000, dport=out_port)) self.pg0.add_stream(p) self.pg_enable_capture(self.pg_interfaces) self.pg_start() capture = self.pg1.get_capture(1) capture = capture[0] self.assertEqual(capture[IPv6].src, aftr_ip6) self.assertEqual(capture[IPv6].dst, self.pg1.remote_hosts[0].ip6) self.assertEqual(capture[IP].src, self.pg0.remote_ip4) self.assertEqual(capture[IP].dst, '192.168.1.1') self.assertEqual(capture[UDP].sport, 10000) self.assertEqual(capture[UDP].dport, 20000) self.assert_packet_checksums_valid(capture) # TCP p = (Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) / IPv6(dst=aftr_ip6, src=self.pg1.remote_hosts[1].ip6) / IP(dst=self.pg0.remote_ip4, src='192.168.1.1') / TCP(sport=20001, dport=10001)) self.pg1.add_stream(p) self.pg_enable_capture(self.pg_interfaces) self.pg_start() capture = self.pg0.get_capture(1) capture = capture[0] self.assertFalse(capture.haslayer(IPv6)) self.assertEqual(capture[IP].src, self.nat_addr) self.assertEqual(capture[IP].dst, self.pg0.remote_ip4) self.assertNotEqual(capture[TCP].sport, 20001) self.assertEqual(capture[TCP].dport, 10001) self.assert_packet_checksums_valid(capture) out_port = capture[TCP].sport p = (Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) / IP(dst=self.nat_addr, src=self.pg0.remote_ip4) / TCP(sport=10001, dport=out_port)) self.pg0.add_stream(p) self.pg_enable_capture(self.pg_interfaces) self.pg_start() capture = self.pg1.get_capture(1) capture = capture[0] self.assertEqual(capture[IPv6].src, aftr_ip6) self.assertEqual(capture[IPv6].dst, self.pg1.remote_hosts[1].ip6) self.assertEqual(capture[IP].src, self.pg0.remote_ip4) self.assertEqual(capture[IP].dst, '192.168.1.1') self.assertEqual(capture[TCP].sport, 10001) self.assertEqual(capture[TCP].dport, 20001) self.assert_packet_checksums_valid(capture) # ICMP p = (Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) / IPv6(dst=aftr_ip6, src=self.pg1.remote_hosts[1].ip6) / IP(dst=self.pg0.remote_ip4, src='192.168.1.1') / ICMP(id=4000, type='echo-request')) self.pg1.add_stream(p) self.pg_enable_capture(self.pg_interfaces) self.pg_start() capture = self.pg0.get_capture(1) capture = capture[0] self.assertFalse(capture.haslayer(IPv6)) self.assertEqual(capture[IP].src, self.nat_addr) self.assertEqual(capture[IP].dst, self.pg0.remote_ip4) self.assertNotEqual(capture[ICMP].id, 4000) self.assert_packet_checksums_valid(capture) out_id = capture[ICMP].id p = (Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) / IP(dst=self.nat_addr, src=self.pg0.remote_ip4) / ICMP(id=out_id, type='echo-reply')) self.pg0.add_stream(p) self.pg_enable_capture(self.pg_interfaces) self.pg_start() capture = self.pg1.get_capture(1) capture = capture[0] self.assertEqual(capture[IPv6].src, aftr_ip6) self.assertEqual(capture[IPv6].dst, self.pg1.remote_hosts[1].ip6) self.assertEqual(capture[IP].src, self.pg0.remote_ip4) self.assertEqual(capture[IP].dst, '192.168.1.1') self.assertEqual(capture[ICMP].id, 4000) self.assert_packet_checksums_valid(capture) # ping DS-Lite AFTR tunnel endpoint address p = (Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) / IPv6(src=self.pg1.remote_hosts[1].ip6, dst=aftr_ip6) / ICMPv6EchoRequest()) self.pg1.add_stream(p) self.pg_enable_capture(self.pg_interfaces) self.pg_start() capture = self.pg1.get_capture(1) capture = capture[0] self.assertEqual(capture[IPv6].src, aftr_ip6) self.assertEqual(capture[IPv6].dst, self.pg1.remote_hosts[1].ip6) self.assertTrue(capture.haslayer(ICMPv6EchoReply)) b4s = self.statistics.get_counter('/dslite/total-b4s') self.assertEqual(b4s[0][0], 2) sessions = self.statistics.get_counter('/dslite/total-sessions') self.assertEqual(sessions[0][0], 3) def tearDown(self): super(TestDSlite, self).tearDown() def show_commands_at_teardown(self): self.logger.info(self.vapi.cli("show dslite pool")) self.logger.info( self.vapi.cli("show dslite aftr-tunnel-endpoint-address")) self.logger.info(self.vapi.cli("show dslite sessions")) class TestDSliteCE(VppTestCase): """ DS-Lite CE Test Cases """ @classmethod def setUpConstants(cls): super(TestDSliteCE, cls).setUpConstants() cls.vpp_cmdline.extend(["dslite", "{", "ce", "}"]) @classmethod def setUpClass(cls): super(TestDSliteCE, cls).setUpClass() try: cls.create_pg_interfaces(range(2)) cls.pg0.admin_up() cls.pg0.config_ip4() cls.pg0.resolve_arp() cls.pg1.admin_up() cls.pg1.config_ip6() cls.pg1.generate_remote_hosts(1) cls.pg1.configure_ipv6_neighbors() except Exception: super(TestDSliteCE, cls).tearDownClass() raise @classmethod def tearDownClass(cls): super(TestDSliteCE, cls).tearDownClass() def test_dslite_ce(self): """ Test DS-Lite CE """ # TODO: add message to retrieve dslite config # nat_config = self.vapi.nat_show_config() # self.assertEqual(1, nat_config.dslite_ce) b4_ip4 = '192.0.0.2' b4_ip6 = '2001:db8:62aa::375e:f4c1:1' self.vapi.dslite_set_b4_addr(ip4_addr=b4_ip4, ip6_addr=b4_ip6) aftr_ip4 = '192.0.0.1' aftr_ip6 = '2001:db8:85a3::8a2e:370:1' aftr_ip6_n = socket.inet_pton(socket.AF_INET6, aftr_ip6) self.vapi.dslite_set_aftr_addr(ip4_addr=aftr_ip4, ip6_addr=aftr_ip6) r1 = VppIpRoute(self, aftr_ip6, 128, [VppRoutePath(self.pg1.remote_ip6, self.pg1.sw_if_index)]) r1.add_vpp_config() # UDP encapsulation p = (Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) / IP(dst=self.pg1.remote_ip4, src=self.pg0.remote_ip4) / UDP(sport=10000, dport=20000)) self.pg0.add_stream(p) self.pg_enable_capture(self.pg_interfaces) self.pg_start() capture = self.pg1.get_capture(1) capture = capture[0] self.assertEqual(capture[IPv6].src, b4_ip6) self.assertEqual(capture[IPv6].dst, aftr_ip6) self.assertEqual(capture[IP].src, self.pg0.remote_ip4) self.assertEqual(capture[IP].dst, self.pg1.remote_ip4) self.assertEqual(capture[UDP].sport, 10000) self.assertEqual(capture[UDP].dport, 20000) self.assert_packet_checksums_valid(capture) # UDP decapsulation p = (Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) / IPv6(dst=b4_ip6, src=aftr_ip6) / IP(dst=self.pg0.remote_ip4, src=self.pg1.remote_ip4) / UDP(sport=20000, dport=10000)) self.pg1.add_stream(p) self.pg_enable_capture(self.pg_interfaces) self.pg_start() capture = self.pg0.get_capture(1) capture = capture[0] self.assertFalse(capture.haslayer(IPv6)) self.assertEqual(capture[IP].src, self.pg1.remote_ip4) self.assertEqual(capture[IP].dst, self.pg0.remote_ip4) self.assertEqual(capture[UDP].sport, 20000) self.assertEqual(capture[UDP].dport, 10000) self.assert_packet_checksums_valid(capture) # ping DS-Lite B4 tunnel endpoint address p = (Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac) / IPv6(src=self.pg1.remote_hosts[0].ip6, dst=b4_ip6) / ICMPv6EchoRequest()) self.pg1.add_stream(p) self.pg_enable_capture(self.pg_interfaces) self.pg_start() capture = self.pg1.get_capture(1) capture = capture[0] self.assertEqual(capture[IPv6].src, b4_ip6) self.assertEqual(capture[IPv6].dst, self.pg1.remote_hosts[0].ip6) self.assertTrue(capture.haslayer(ICMPv6EchoReply)) def tearDown(self): super(TestDSliteCE, self).tearDown() def show_commands_at_teardown(self): self.logger.info( self.vapi.cli("show dslite aftr-tunnel-endpoint-address")) self.logger.info( self.vapi.cli("show dslite b4-tunnel-endpoint-address"))