summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip4_forward.c
AgeCommit message (Collapse)AuthorFilesLines
2018-08-23ip4: rework rewrite node to use vlib_buffer_enqueue_to_next()Damjan Marion1-355/+270
- perf improvement is around 3 clock per packet - it properly prefetches ip header and rewrite area Credits to zhiyong.yang@intel.com for spotting that in some cases rewrite area is not prefetched. Change-Id: Ie02913de7bd7f42b7df2617fb5fa87c74ab53c23 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-17VPP-1392: VXLAN fails with IP fragmentationOle Troan1-1/+1
Not only is it wasteful to send all fragments back through ip4-lookup, but it doesn't work with tunnel mechanisms that don't have IP enabled on their payload side. Change-Id: Ic92d95982dddaa70969a2a6ea2f98edec7614425 Signed-off-by: Ole Troan <ot@cisco.com>
2018-08-13Multiarch for ip4 forwarding nodesDamjan Marion1-59/+49
Change-Id: I68b55fc641da9dacc3343628b3e0cf77d3533313 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-09Thread-safe ARP / ND throttlingDave Barach1-35/+20
Change-Id: I810d834c407bd404d5f0544cdec0674f0bb92d31 Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Dave Barach <dbarach@cisco.com>
2018-07-21fix IP directed broadcast node declarationsMatthew Smith1-1/+1
The dev build ('make build') was failing because ip4_rewrite_bcast() and ip6_rewrite_bcast() are declared static and were not referenced. The node functions that were set for directed broadcast rewrite: ip4_rewrite_bcast_node - ip4_rewrite() ip6_rewrite_bcast_node - ip6_rewrite() Changed to: ip4_rewrite_bcast_node - ip4_rewrite_bcast() ip6_rewrite_bcast_node - ip6_rewrite_bcast() The release build ('make build-release') succeeds because there is a VLIB_NODE_FUNCTION_MULTIARCH() call referencing the function. That macro is empty for dev builds. Change-Id: I2a05f00ca43d0eae8ff2e3026991e69917003fe1 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-07-20IP directed broadcastNeale Ranns1-6/+99
with ip direct broadcast enable a packet to the interface's subnet broadcast address with be sent L2 broadcast on the interface. dissabled, it will be dropped. it is disabled by default, which preserves current behaviour Change-Id: If154cb92e64834e97a541b32624354348a0eafb3 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-07-11avoid using thread local storage for thread indexDamjan Marion1-2/+2
It is cheaper to get thread index from vlib_main_t if available... Change-Id: I4582e160d06d9d7fccdc54271912f0635da79b50 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-06-26node functions cannot be always_inlineDamjan Marion1-1/+1
Thanks to gcc-8 for highlighting this... Change-Id: I53bfab631a40fd1b680c76a48b0307a33fa2b154 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-06-19Check get packet template allocation failure (VPP-1321)John Lo1-0/+3
After calling vlib_packet_template_get_packet(), make sure packet buffer is allocated before using it. Change-Id: Idb5199f4e2c9596137b2101e502d611f474a6ffe Signed-off-by: John Lo <loj@cisco.com>
2018-06-14Use unicast DMAC for IP neighbor pool refresh probesJohn Lo1-5/+17
Change-Id: I12fbebd1d24c37dc77c147773ea522c8a4b7b99d Signed-off-by: John Lo <loj@cisco.com>
2018-06-14MTU: IP fragmentation added to ip4-rewrite and ip6-rewriteOle Troan1-3/+9
Change-Id: Ibae260273f25a319153be37470aed49ff73e957a Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-04ip4: optimize ip4_localFlorin Coras1-253/+318
"sh run" says the number of clocks for my tcp based throughput test dropped from ~43 to ~23 Change-Id: I719439ba7fc079ad36be1432c5d7cf74e3b70d73 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-06-04ip: save fib index for buffer in ip lookupFlorin Coras1-22/+19
Avoids recomputing the fib index in ip local for locally delivered packets and should incur no extra cost when forwarding packets. Change-Id: Id826ffa8206392087327f154337eabc8a801b4d7 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-05-23VPP-1283: IPv4 PMTU missing MTU value in ICMP4 message.Ole Troan1-30/+39
Change-Id: I7a4133c59ff45b0744b48e246a049d9f015026fc Signed-off-by: Ole Troan <ot@cisco.com>
2018-05-15No overlapping sub-nets on any interface in the same table/VRF (VPP-943)Neale Ranns1-25/+38
DBGvpp# set int ip addr loop0 10.10.10.10/24 DBGvpp# set int ip addr loop0 10.10.10.11/24 set interface ip address: failed to add 10.10.10.11/24 which conflicts with 10.10.10.10/24 for interface loop0 Change-Id: Iba63ffafbd36b6146ce86adb78139da9d55b40ba Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-04-18Mcast rewrite optimisationsNeale Ranns1-3/+25
hard code the address mask offsets. This are protocol specific and only used on ethernet when used at all. Change-Id: Ib1f6f33682f53254ffbb5a241a1583e65420e0c7 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-04-13Revert "MTU: Setting of MTU on software interface (instead of hardware ↵Damjan Marion1-57/+41
interface)" This reverts commit 70083ee74c3141bbefb185525315f1b34497dcaa. Reverting as this patch is causing following crash: 0: /home/damarion/cisco/vpp3/build-data/../src/vnet/devices/devices.h:131 (vnet_get_device_input_thread_index) assertion `queue_id < vec_len (hw->input_node_thread_index_by_queue)' fails Aborted Change-Id: Ie2a365032110b1f67be7a9d832885b9899813d39 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-13MTU: Setting of MTU on software interface (instead of hardware interface)Ole Troan1-41/+57
Change-Id: I98bd454a761a1032738a21edeb0fe847e801f901 Signed-off-by: Ole Troan <ot@cisco.com>
2018-03-21reassembly: feature/concurrencyKlement Sekera1-14/+3
This change makes ip reassembly an interface feature, while adding concurrency support. Due to this, punt is no longer needed to test reassembly. Change-Id: I467669514ec33283ce935be0f1dd08f07684f0c7 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-03-18Remove unnumbered configuration on interface deleteNeale Ranns1-1/+2
Change-Id: Iae5532c3d53e208831f3b2782242d9e59d367087 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-03-016RD: Rewritten 6RD RFC5969 support.Ole Troan1-1/+2
Change-Id: Ic30fbcb2630f39e45345d7215babf5d7ed4b33a0 Signed-off-by: Ole Troan <ot@cisco.com>
2018-02-12Improve MTU handlingNeale Ranns1-13/+30
- setting MTU on an interface updates the L3 max bytes too - value cached in the adjacency is also updated - MTU exceeded generates ICMP to sender Change-Id: I343ec71d8e903b529594c4bd0543f04bc7f370b3 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-02-09ip4_forward: set pkt error in case potential memory corruptChun Li1-0/+2
Change-Id: Ib9eb65d2ba166f5883a8ce8d37298c696113f2be Signed-off-by: Chun Li <chunl2@cisco.com>
2018-02-08ip: move lookup inline functions to header fileVijayabhaskar Katamreddy1-372/+1
Needed to allow other code paths to reuse them. Change-Id: I9e469527c6b2e9a6fec7af5f17d8b400a2e85826 Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com>
2018-02-07classifier-based ACL: refactor + add output ACLAndrew Yourtchenko1-0/+7
For implementation of MACIP ACLs enhancement (VPP-1088), an outbound classifier-based ACL would be needed. There was an existing incomplete code for outbound ACLs, it looked almost exact copy of input ACLs, minus the various enhancements, trying to sync that code seemed error-prone and cumbersome to maintain in the longer run. This change refactors the input+output ACLs processing into a unified routine (thus any changes will have effect on both), and also adds the API to set the output interface ACL, with the same format and semantics as the existing input one (except working on output ACL of course). WARNING: IP outbound ACL in L3 mode clobbers the ip.* fields in the vnet_buffer_opaque_t, since the code is using l2_classify.* The net_buffer (p0)->ip.save_rewrite_length is rescued into l2_classify.pad.l2_len, and used to rewind the header in case of drop, so that ipX_drop prints something sensible. Change-Id: I62f814f1e3650e504474a3a5359edb8a0a8836ed Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-02-01IPv4/6 reassemblyKlement Sekera1-3/+10
Change-Id: Ic5dcadd13c88b8a5e7896dab82404509c081614a Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-01-31Improved tracing for the IP[46] not-enabled case.Neale Ranns1-9/+9
now we get 00:00:03:665501: pg-input ... 00:00:03:665681: ethernet-input ... 00:00:03:665691: ip6-input UDP: 2001::1 -> ffef::1 tos 0x00, flow label 0x0, hop limit 64, payload length 108 UDP: 1234 -> 1234 length 108, checksum 0x7b25 00:00:03:665695: ip6-not-enabled UDP: 2001::1 -> ffef::1 tos 0x00, flow label 0x0, hop limit 64, payload length 108 UDP: 1234 -> 1234 length 108, checksum 0x7b25 00:00:03:665706: error-drop ethernet-input: no error Same goes for IPv4 Change-Id: Ia360df39b43281d3a0aa1b686f04b73cfa37c546 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-01-30Allow the provider of a midchain adjacency to pass context data that is ↵Neale Ranns1-3/+6
returned in the fixup function Change-Id: I458e6e03b03e27775df33a2fd302743126d6ac44 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-01-09DVR: run L3 output featuresNeale Ranns1-1/+1
- rename l2_bridged to is_dvr. Including on the ip.api this was new in the 18.01 release so no compatability issues. - steal the free space in vnet_buffer_opaque_t for use with flags. - run the ipX-output feature arc from the DVR DPO Change-Id: I040e5976d1dbe076fcdda3a40a7804f56337ce3f Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-12-15Fix icmp/udp/tcp punt/drop pathsVijayabhaskar Katamreddy1-2/+2
Send packets to ip4/6_punt/drop nodes instead of error-drop/punt nodes dbarach: clean up an annoying checkstyle issue: indent 2.2.10 (OpenSUSE version) and indent 2.2.11 (Ubuntu / CentOS versions) had an artistic disagreement about ip_frag.c. Change-Id: I660bee28a064af9c6c70371363081e941d1c3a94 Signed-off-by: Vijayabhaskar Katamreddy <vkatamre@cisco.com> Signed-off-by: Dave Barach <dave@barachs.net>
2017-12-13IP bi-direction multicast - same cable check on egressNeale Ranns1-1/+16
Change-Id: I655382f7f74181dd7c795a2b22f151f76b50e793 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-12-13Separate heap for IPv4 mtriesNeale Ranns1-0/+29
Change-Id: I497e9f6489dd35219bcf2b51ac992467aac4c8eb Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-11-29Add some indent-off to the node declarations in ip4-forwardNeale Ranns1-19/+42
Change-Id: Icab8f1411da22bd56ef0de3b100eaa9519a42f52 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-11-07vnet: ip4/6_local-> don't drop TCP/UCP marked for cksum calc fixJakub Grajciar1-7/+7
Change-Id: Id14826eefe43168747c8ba69b3b600441a7d4047 Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech>
2017-11-03vnet: ip4/6_local->don't drop packet if marked for TCP/UDP offload cksum ↵Jakub Grajciar1-5/+14
calculation Change-Id: I62f625a93e5d818caef382316035cd5447bd8fef Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech>
2017-10-15ip: avoid arp assert if out of buffers (VPP-1030)Florin Coras1-0/+4
Change-Id: Ia31b978c6c1619c3e0075a84fcbbb6ccbf1c0076 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-10-10session: add support for application namespacingFlorin Coras1-0/+5
Applications are now provided the option to select the namespace they are to be attached to and the scope of their attachement. Application namespaces are meant to: 1) constrain the scope of communication through the network by association with source interfaces and/or fib tables that provide the source ips to be used and limit the scope of routing 2) provide a namespace local scope to session layer communication, as opposed to the global scope provided by 1). That is, sessions can be established without assistance from transport and network layers. Albeit, zero/local-host ip addresses must still be provided in session establishment messages due to existing application idiosyncrasies. This mode of communication uses shared-memory fifos (cut-through sessions) exclusively. If applications request no namespace, they are assigned to the default one, which at its turn uses the default fib. Applications can request access to both local and global scopes for a namespace. If no scope is specified, session layer defaults to the global one. When a sw_if_index is provided for a namespace, zero-ip (INADDR_ANY) binds are converted to binds to the requested interface. Change-Id: Ia0f660bbf7eec7f89673f75b4821fc7c3d58e3d1 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-10-10punt and drop features:Neale Ranns1-72/+5
- new IPv4 and IPv6 feature arcs on the punt and drop nodes - new features: - redirect punted traffic to an interface and nexthop - police punted traffic. Change-Id: I53be8bf4e06545add8a3619e462de5ffedd0a95c Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-10-09NAT: hairpinning rework (VPP-1003)Matus Fabian1-1/+9
Change-Id: I7c6911cd6ac366fe62675fd0ff8b0246a25ea1db Signed-off-by: Matus Fabian <matfabia@cisco.com>
2017-10-04[aarch64] Fixes CLI crashes on dpaa2 platform.Christophe Fontaine1-3/+3
- always use 'va_args' as pointer in all format_* functions - u32 for all 'indent' params as it's declaration was inconsistent Change-Id: Ic5799309a6b104c9b50fec309cba789c8da99e79 Signed-off-by: Christophe Fontaine <christophe.fontaine@enea.com>
2017-10-03Repair vlib API socket serverDave Barach1-8/+16
- Teach vpp_api_test to send/receive API messages over sockets - Add memfd-based shared memory - Add api messages to create memfd-based shared memory segments - vpp_api_test supports both socket and shared memory segment connections - vpp_api_test pivot from socket to shared memory API messaging - add socket client support to libvlibclient.so - dead client reaper sends ping messages, container-friendly - dead client reaper falls back to kill (<pid>, 0) live checking if e.g. a python app goes silent for tens of seconds - handle ping messages in python client support code - teach show api ring about pairwise shared-memory segments - fix ip probing of already resolved destinations (VPP-998) We'll need this work to implement proper host-stack client isolation Change-Id: Ic23b65f75c854d0393d9a2e9d6b122a9551be769 Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-09-20Add ip6-local feature arcPierre Pfister1-1/+7
ip4-local feature arc existed but not ip6-local one. This patch also adds node name to the 'show ip local' command and fixes a minor include issue in vnet/ip/ip4.h file. Change-Id: I9bb8a7159917d58f89afcce974680de20d946a70 Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2017-09-15dpdk: cli to check for buffer leakageFlorin Coras1-0/+1
Use buffer pre_data and existing buffer trace trajectory code to find out dpdk buffer leakages. Change-Id: I26a5d8bd2f23d01cb6070ffc3ddcc6d3d863b575 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-09-11arp/glean: fix hash computationFlorin Coras1-1/+2
Change-Id: Ifef8a9328bb865f6ddb041bafe3699153f89755a Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-09-11FIB table add/delete APINeale Ranns1-97/+4
part 2; - this adds the code to create an IP and MPLS table via the API. - but the enforcement that the table must be created before it is used is still missing, this is so that CSIT can pass. Change-Id: Id124d884ade6cb7da947225200e3bb193454c555 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-08-16ip4: cleanup ip localFlorin Coras1-153/+85
Change-Id: I4f751b0181f25ec6c4abd3a9c7b0386d80743b3a Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-08-11Fix tcp multi buffer segments retransmissionFlorin Coras1-5/+7
- Fix tcp/udp sw checksum computation - Fix allocation of multi buffer tcp segments for retransmits - Send FIN only if/when tx fifo is empty Change-Id: I2e43a14b87a72c9e547b4339b9a51811cf5732c4 Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-08-08L2 over MPLSNeale Ranns1-3/+3
[support for VPWS/VPLS] - switch to using dpo_proto_t rather than fib_protocol_t in fib_paths so that we can describe L2 paths - VLIB nodes to handle pop/push of MPLS labels to L2 Change-Id: Id050d06a11fd2c9c1c81ce5a0654e6c5ae6afa6e Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-08-02Fix vpp crash sending arp or probing neighb (VPP-917)Pavel Kotucek1-0/+14
VPP crash when trying to send arp message or to probe neighbor over interface with IP address but without hw address (local0 and tunnels - vxlan, gre, ...) Change-Id: I08a1c97d3ea913fc11b2886cf73b2ccc31356664 Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
2017-07-20Fix coverity issue introduced with IP checksum offload commitDamjan Marion1-3/+3
Change-Id: Ib5ad1369678389534426902ce698bccf7a6d9ec2 Signed-off-by: Damjan Marion <damarion@cisco.com>