summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip4_forward.c
AgeCommit message (Collapse)AuthorFilesLines
2019-06-04Punt: specify packets by IP protocol TypeNeale Ranns1-2/+12
Change-Id: I0c2d6fccd95146e52bb88ca4a6e84554d5d6b2ed Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-06-03ARP: add feature arcNeale Ranns1-0/+6
- arp-input, registered with the ethernet protocol dispatcher, performs basic checks and starts the arc - arp-reply; first feature on the arc replies to requests and learns from responses (no functional change) - arp-proxy; checks against the proxy DB arp-reply and arp-proxy are enabled when the interface is appropriately configured. Change-Id: I7d1bbabdb8c8b8187cac75e663daa4a5a7ce382a Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-05-31VPP-1692: move NULL pointer checkDave Barach1-5/+5
TBH, this looks like merge damage or some such. Perfectly fine NULL pointer check, about three lines after it was needed. Change-Id: I52831062e30533a59fb76b644ee5ae389676d2ae Signed-off-by: Dave Barach <dave@barachs.net>
2019-05-30IP load-balance; perf improvement using the usual reciepeNeale Ranns1-137/+106
before and after: ip4-load-balance 1.54e1 ip4-load-balance 1.36e1 p.s. Quad loops were not beneficial Change-Id: I7bc01fc26288f0490af74db2b1b7993526c3d982 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-05-06ip4_load_balance: leverage vlib_get_buffersZhiyong Yang1-13/+11
vlib_get_buffers can save 1.2 clocks/pkt from 16.1 to 14.9 clocks/pkt on Skylake. Change-Id: I79d8b58b192280af5e5a5f73562b6301e1821cec Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2019-04-10Make tcp/udp/icmp compute checksum safer for buffer-chain caseJohn Lo1-1/+1
Change-Id: I046e481a67fbeffdaa8504c8d77d232b986a61ee Signed-off-by: John Lo <loj@cisco.com>
2019-04-08fixing typosJim Thompson1-2/+2
Change-Id: I215e1e0208a073db80ec6f87695d734cf40fabe3 Signed-off-by: Jim Thompson <jim@netgate.com>
2019-03-28IPSEC: run encrpyt as a feautre on the tunnelNeale Ranns1-8/+19
Change-Id: I6527e3fd8bbbca2d5f728621fc66b3856b39d505 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-26ip6-rewrite: bug fix buffer->error in dual loopKingwel Xie1-3/+12
error should be recorded in buffer so that process-error-punt can handle them correctly Per Damjan's comments, move counter to under else clause of last error0==NONE check. Both v4 and v6 are changed. Change-Id: I707c7877ccb12589337155173fc4a5200b42ee93 Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
2019-02-19tap gso: experimental supportAndrew Yourtchenko1-7/+37
This commit adds a "gso" parameter to existing "create tap..." CLI, and a "no-gso" parameter for the compatibility with the future, when/if defaults change. It makes use of the lowest bit of the "tap_flags" field in the API call in order to allow creation of GSO interfaces via API as well. It does the necessary syscalls to enable the GSO and checksum offload support on the kernel side and sets two flags on the interface: virtio-specific virtio_if_t.gso_enabled, and vnet_hw_interface_t.flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO. The first one, if enabled, triggers the marking of the GSO-encapsulated packets on ingress with VNET_BUFFER_F_GSO flag, and setting vnet_buffer2(b)->gso_size to the desired L4 payload size. VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO determines the egress packet processing in interface-output for such packets: When the flag is set, they are sent out almost as usual (just taking care to set the vnet header for virtio). When the flag is not enabled (the case for most interfaces), the egress path performs the re-segmentation such that the L4 payload of the transmitted packets equals gso_size. The operations in the datapath are enabled only when there is at least one GSO-compatible interface in the system - this is done by tracking the count in interface_main.gso_interface_count. This way the impact of conditional checks for the setups that do not use GSO is minimized. "show tap" CLI shows the state of the GSO flag on the interface, and the total count of GSO-enabled interfaces (which is used to enable the GSO-related processing in the packet path). This commit lacks IPv6 extension header traversal support of any kind - the L4 payload is assumed to follow the IPv6 header. Also it performs the offloads only for TCP (TSO - TCP segmentation offload). The UDP fragmentation offload (UFO) is not part of it. For debug purposes it also adds the debug CLI: "set tap gso {<interface> | sw_if_index <sw_idx>} <enable|disable>" Change-Id: Ifd562db89adcc2208094b3d1032cee8c307aaef9 Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-02-14Add -fno-common compile optionBenoît Ganne1-0/+2
-fno-common makes sure we do not have multiple declarations of the same global symbol across compilation units. It helps debug nasty linkage bugs by guaranteeing that all reference to a global symbol use the same underlying object. It also helps avoiding benign mistakes such as declaring enum as global objects instead of types in headers (hence the minor fixes scattered across the source). Change-Id: I55c16406dc54ff8a6860238b90ca990fa6b179f1 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-01-30Use IP and MAC API types for neighborsNeale Ranns1-9/+3
use address_t and mac_address_t for IPv6 and ARP entries and all other API calls in ip.api aprat from the route ones, that will follow in a separate commit Change-Id: I67161737c2184d3f8fc1e79ebd2b55121c5b0191 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-01-10ARP/ND: copy opaque2 persistent fields to new packetNeale Ranns1-1/+4
Change-Id: Ic65f686aaccaf8450732d88d7471b587faccaa9d Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-13ip4_rewrite_inline: fix variable errorZhiyong Yang1-2/+2
Change-Id: I0470b4b13095583fe018f565f100342fab45715e Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2018-12-12Change ipsec feature node namesPierre Pfister1-4/+4
ipsec4-output and ipsec6-output were conflicting with ipsec interface names ("ipsec<id>") and vnet/interface.c autogenerated output node ("<ifname>-output"). Changing feature names seems to be the less invasive option. This patch also changes "input" feature names for consistency. Change-Id: I4ba10d07e9ba09df20aa2500104252b06b55f8f7 Signed-off-by: Pierre Pfister <ppfister@cisco.com>
2018-12-10IP-local: any IP can appear as the source (VPP-1522)Neale Ranns1-3/+15
Change-Id: Ib0d9b533d72c899b77c9a7bd1daa9b4a55b7221c Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-11-28Remove useless prefetch in ip4-rewrite nodeSimon Zhang1-1/+1
Prefetching first 2 packets' header is useless cause of the prefetching action is not done before using the packets. There's no performance drop in Xeon platform and slightly performance gain in Atom platform after rmoving the prefetch. Change-Id: Ib4b074af20d7cd5053aecc7147b162141aec31f5 Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
2018-11-26Add a feature arc consistency checkDave Barach1-0/+4
Verify that last node in the computed feature order matches reality. This check doesn't make sense in all cases, so we skip it if the newly-added vnet_feature_arc_registration_t ".last_in_arc" datum is a NULL pointer. Change-Id: Ia99c3e2b2da2e4780a7d5bc71670c5742a66fef2 Signed-off-by: Dave Barach <dave@barachs.net>
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach1-12/+12
Change-Id: Id4f37f5d4a03160572954a416efa1ef9b3d79ad1 Signed-off-by: Dave Barach <dave@barachs.net>
2018-11-08IP load-balance; trace at the end of the node so the flow hash used is displayedNeale Ranns1-3/+3
Change-Id: Idbce0393fc9e6e8dbb2765ed164ba7f90d1ffccc Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-11-02arp:add error counters for all failure casesEyal Bari1-98/+82
Change-Id: Ided6c661edc9e2035fd7b472c312e2380d3f9c0b Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-10-29Use throttle_t for ND throttlingNeale Ranns1-2/+6
Change-Id: I93c6b7bccd1a1ab71625ae29c99c974581186c4d Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-10-23c11 safe string handling supportDave Barach1-3/+3
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-22ipsec: split ipsec nodes into ip4/ip6 nodesKlement Sekera1-4/+4
Change-Id: Ic6b27659f1fe9e8df39e80a0441305e4e952195a Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-10-04Support reassembly for fragments coming to ip4-local nodeJuraj Sloboda1-0/+7
Change-Id: I3aa4708c1c3cdda344f282d56b617677080eaaa1 Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
2018-10-02ip4-local: classify protos that skip csum and src checkFlorin Coras1-13/+38
Makes it easy to add protocols that skip L4 checks. Change-Id: I80ff95685bfa17e29c5800d9c96153cdc7739be2 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-27IPIP and IPv6 fragmentationOle Troan1-1/+1
- Error where ICMPv6 error code doesn't reset VLIB_TX = -1 Leading to crash for ICMP generated on tunnelled packets - Missed setting VNET_BUFFER_F_LOCALLY_ORIGINATED, so IP in IPv6 packets never got fragmented. - Add support for fragmentation of buffer chains. - Remove support for inner fragmentation in frag code itself. Change-Id: If9a97301b7e35ca97ffa5c0fada2b9e7e7dbfb27 Signed-off-by: Ole Troan <ot@cisco.com>
2018-08-30Refactor the ARP throttle into a common type so it can be reusedNeale Ranns1-21/+3
Change-Id: Ic7f7af983d5b6d756748023aa0c650f53e9285cf Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
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>