aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
AgeCommit message (Collapse)AuthorFilesLines
2019-11-06tcp: IPv6 flow label supportTarun Gupta1-4/+25
Type:feature For cases when proxy is in use IPv6 flow label received in origin pkt needs to be added to ipv6 header of outgoing pkts from proxy to original destination and vice versa. Signed-off-by: Tarun Gupta <tarungup@cisco.com> Change-Id: I143f7e67237c0f865333078628a016b50ad5e630 Signed-off-by: Tarun Gupta <tarungup@cisco.com>
2019-11-05ip: Fragmentation fixesNeale Ranns5-115/+155
Type: fix if the packet is about to be fragmented, then don't call any of the actions that expect the rewrite to have been written. 1) don't double count packets thru the adjacency (original & fragments) 2) don't double decrement the TTL for fragments 3) return to ip4-midchain post ip-frag if that's where we started. 4) only run midchain/mcast fixups if not fragmenting (if no errors) Change-Id: Ib2866787a42713ee5871b87b597d8f74b901044b Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-10-30ip: cleanup typos in documentationPaul Vinciguerra8-17/+17
Type: style Change-Id: I7d44b7fab1b8b196e4934cb4832ee51084c5bf98 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-10-29ip: refactor ip4_mtrie to use atomic store-releasejaszha031-14/+5
ip4_mtrie used full memory barrier compare-and-swap in set_leaf () and set_root_leaf () even though only one thread updates the trie. Replaced such instances of compare-and-swap with atomic store-release. Type: refactor Change-Id: Ic6e3c84480697915541acd16dcc630d1c436137d Signed-off-by: Jason Zhang <jason.zhang2@arm.com> Reviewed-by: Lijian Zhang <Lijian.Zhang@arm.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2019-10-29ip: refactor ip4_mtrie to atomically unset leavesjaszha031-4/+6
ip4_mtrie set leaves atomically in set_leaf () and set_root_leaf () but deleted leaves using regular stores in unset_leaf () and unset_root_leaf (). Changed leaf deletion to update mtrie using atomic store-release. Slight performance improvement was observed in benchmarking on Qualcomm and Xeon machines. Benchmarking involved running 'ip route add' and 'ip route del' on vpp instances. Below are the routes/second for adding and deleting 100k routes before and after the store-release changes: Xeon Add Routes Before: 1.140e6, 1.139e6, 1.148e6, 1.158e6, 1.155e6 Xeon Add Routes After: 1.167e6, 1.170e6, 1.174e6, 1.173e6, 1.169e6 Xeon Del Routes Before: 7.287e7, 8.089e7, 6.048e7, 7.171e7, 7.821e7 Xeon Del Routes After: 8.729e7, 7.353e7, 7.856e7, 8.209e7, 7.787e7 Qualcomm Add Routes Before: 3.709e5, 3.954e5, 3.739e5, 3.759e5, 3.671e5 Qualcomm Add Routes After: 3.879e5, 3.967e5, 3.936e5, 3.764e5, 3.817e5 Qualcomm Del Routes Before: 1.286e7, 1.379e7, 1.353e7, 1.230e7, 1.331e7 Qualcomm Del Routes After: 1.411e7, 1.355e7, 1.373e7, 1.394e7, 1.314e7 Type: refactor Change-Id: If3acd25a2fb87addd0eb13d82d3c8f46579e8060 Signed-off-by: Jason Zhang <jason.zhang2@arm.com> Reviewed-by: Lijian Zhang <Lijian.Zhang@arm.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2019-10-28ip: Punt rather than drop unkown IPv6 ICMP packetsNeale Ranns1-5/+5
Type: feature Change-Id: Ib137c453ff2dd5b9d028c653afa80e6b2b81b9e0 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-10-28ping: move the echo responder into the ping pluginNeale Ranns2-200/+3
Type: feature Change-Id: I246346b82858e73b16d727e2106350bc0fc3c6f2 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-10-28ip: reassembly fix sanity checksKlement Sekera2-5/+5
use correct value for sanity checks Type: fix Change-Id: If33db5ce3e4a26f7876c2a67832ca2947563e211 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-10-28ip: fix tracing of packet flagsKlement Sekera1-1/+1
This fixes incorrect tracing of flags such as MORE_FRAGMENTS. Type: fix Change-Id: Ia5698418a7cbb45c18bc9c95f560cea020e63c39 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-10-28ip: reassembly: fix use-after-freeBenoît Ganne2-5/+10
When processing the last buffer of a reassembled packet, the current buffer will be freed and must be reloaded using the updated index. Type: fix Change-Id: Ib39e29e60eb527b4cd4828a3aa37d82c8dddd709 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-10-25dhcp: fix crash on unicast renewal sendNeale Ranns1-4/+1
Type: fix - when the addresses were learnt a copy of the client was sent to the main thread, this meant the unicast adjacecny was saved on the copy not on the original. - Add logging. - Improve the proxy-node that hands the clint packets so the DHCP packets are traced. - allow a renewal to configure new address data Change-Id: I6ab0afcccbc4a1cdefdd1b8beeda8fc7ba20ec1f Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-10-18ip: trivial typos in docsPaul Vinciguerra2-9/+9
Type: style Change-Id: I620f15b96ee5401e0145a139f06d343d7c4fadb4 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-10-17ip: punt API cleanupJakub Grajciar1-6/+6
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I7048f8ec598a8b06d75bdfb5d2fab9f6337c9474 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-10-17ip: rd_cp API cleanupJakub Grajciar1-4/+6
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I1cc42b57fbf72e2ced8b5d1283c34de2f7ff948a
2019-10-14ping: Move to pluginMohsin Kazmi5-1369/+11
Type: refactor Change-Id: I51d5bf54dfd408aa0c406cbdf0f4be10ef19d10d Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-10-11ip: reassembly: trace ip headers over worker handoffsKlement Sekera5-27/+87
This change adds tracing of IP headers when doing a handoff between worker threads. This eases debugging. Type: feature Change-Id: I2195b070a364cba13a658ec1cee5154fc4c3a8b0 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-10-11ip: RD-CP API incorrect reply codeNeale Ranns1-1/+1
Type: fix Change-Id: Ie436d51999dc1384a0db492f28a7e66620e14551 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-10-10ip: fix clang debug compilationBenoît Ganne1-3/+1
The non-extern declaration confuses clang linker in debug mode. The function is defined as inline above anyway. Type: fix Fixes: c6215d902f Change-Id: Ic7e4477631cf0bcfb31ab3f81effe3642dd4223e Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-10-10tcp: custom checksum calculations for Ipv4/Ipv6Srikanth A4-100/+97
Type: feature Based on the configuration, we can disable checksum offload capability and calculate checksum while pushing the TCP & IP header. This saves some cycles when VPP stack is used in legacy hardware devices. Signed-off-by: Srikanth A <srakula@cisco.com> Change-Id: Ic1b3fcf3040917e47ee65263694ebf7437ac5668 (cherry picked from commit 3642782a2748503f5b5ccf89d1575c1d489948ef)
2019-10-09map: use ip6-full-reassembly instead of own codeKlement Sekera4-0/+70
Remove map's implementation of reassembly and use common ip6-full-reassembly functionality. This makes it easier to maintain by removing duplicate code/functionality. Type: refactor Change-Id: I430e888b704e28c100a9ce075d1460cb529e4676 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-10-09ip: fix coverity warningKlement Sekera1-3/+7
Type: fix Fixes: 0eb75d0e9c7624a4e8ac69fea7dbe12d39b75096 Change-Id: I8bcdc06b33bf4e12752b90dc3445fa51af552a46 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-10-09mpls: support fragmentation of mpls output packetRajesh Goel2-2/+41
Type: fix Signed-off-by: Rajesh Goel <rajegoel@cisco.com> Change-Id: Ie4372c5cf58ab215cdec5ce56f8a994daaba2844
2019-10-09ip: only install IPv6 prefixes in FIB when the interface is upNeale Ranns1-39/+36
otherwise they get installed twice and the reference counting means they are not removed. This is the same behaviour as IPv4. Type: fix Change-Id: I9266e04ccff6ff06a577e85973a2ddbeb9dfc52b Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-10-07ip: remove dead code in ip6-svrKlement Sekera1-27/+0
Type: fix Fixes: de34c35fc73226943538149fae9dbc5cfbdc6e75 Change-Id: Ia714c2e46627864091d3f686dbced4cdd9c1a773 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-10-07ip: add tracing for ipv6 frag headersKlement Sekera1-0/+24
Type: feature Change-Id: I0e049b28d8c21b67ea4545e865eda4e88f10e485 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-10-07ip: reassembly add missing gotoKlement Sekera1-0/+1
Type: fix Fixes: de34c35fc73226943538149fae9dbc5cfbdc6e75 Change-Id: I256ef153b3b27a1f7ab7daa45015a2ec4bc84076 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-10-07ip: reassembly remove dead codeKlement Sekera1-8/+0
Type: fix Fixes: de34c35fc73226943538149fae9dbc5cfbdc6e75 Change-Id: I79589f648f4c75762e5277fb94636a91fa36ccdd Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-10-07ip: MFIB CLI fix for parsing path flagsNeale Ranns1-3/+0
Type: fix Change-Id: I7ed9726d8c5ca26715a84b004a18fd7f93142486 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-10-06ip: Fix IP unnumbered dump of one interfaceNeale Ranns1-1/+1
Type: fix Change-Id: I35fb6fdfba50c4a59cf1ffb94cb51487bcf5afc9 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-10-04ip: fix use-after-free in IPv6 SLAAC expirationBenoît Ganne1-3/+11
Type: fix Change-Id: I46b166b3a10c4543eafa4422531dd3c725db45f1 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-10-02ip: mfib CLI 'via local' fixNeale Ranns1-0/+2
Type: fix Change-Id: I6fd7bb27b95a50d37424f65dc51e8b341f8b1b28 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-09-30ip: svr: fix feature refcountsKlement Sekera2-14/+20
Reference counts need to be per-interface as opposed to global. This allows configuring the feature on more than one interface correctly. Type: fix Fixes: de34c35fc73226943538149fae9dbc5cfbdc6e75 Change-Id: I05534ac59fa86e67290737ec6c61df2c19acab48 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-09-26ip: fix use-after-free in reassemblyBenoît Ganne2-6/+8
- ip{4,6}_reass_finalize() frees the reassembly context: do not access it after the call. - traces access reassembly context: free it after and not before tracing. Type: fix Change-Id: Ia3aaea9c7b74932e249e013be04b9bd7298fd187 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-09-26ip: add shallow virtual reassembly functionalityKlement Sekera10-87/+2778
Type: feature Change-Id: Ibc8334e26c7e6f6120696c3e313b6e11d73dab99 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-09-25ip: respect buffer boundary when searching for ipv6 headersKlement Sekera2-34/+81
Type: fix Change-Id: I5a5461652f8115fa1270e20f748178fb5f5450f2 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-09-25api: split api generated filesOle Troan2-11/+2
Split generation of API message enum and the typedefs into separate files, so that the type file can be included from elsewhere. Generate a C file for VPP that contains the API registration, this was previously done via X macros by the C pre- processor. This allows deleting lots of skeleton/copy paste code for each feature. plugins/flowprobe plugins/map examples/sample-plugin vnet/ipip used as Guinea pigs. Generate a C Test file for VAT, that does the same for VAT plugins. Also add support for a per-message CLI option, that is currently limited to VAT help text. option vat_help = "<help text>"; Type: refactor Change-Id: I245e3104bb76f7e1fb69a59ab20cc7c8dfcdd460 Signed-off-by: Ole Troan <ot@cisco.com>
2019-09-25fib: fix some typos in fib/mtrieLijian.Zhang4-10/+10
Type: fix Change-Id: I1af0e4a9bc23a3b6b6d3a74df093801ab6cae1f8 Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
2019-09-25ip: refactor reassemblyKlement Sekera9-825/+868
this is a preparation step for introducing other reassembly types Type: refactor Change-Id: I197e299dbd729b00eead31667913b8ceff915d63 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2019-09-24vlib: add flag to explicitelly mark nodes which can init per-node packet traceDamjan Marion1-0/+1
Type: feature Change-Id: I913f08383ee1c24d610c3d2aac07cef402570e2c Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-09-23api: add missing format_vl_api_ip[46]_address_with_prefix_tJakub Grajciar1-0/+12
Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Iad7067962b1dd8d3a1335f07e89a62f901e82dff
2019-09-23fib: do not dump no-longer valid adjacenciesBenoît Ganne1-1/+6
In some cases, we can refer to no-longer adjacencies (eg. in traces). Do not dump them in this case as they are probably incorrect (memory can be reused). Type: fix Change-Id: Ib653ba066bb6595ec6ec37d313a3124bce0eeed3 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-09-23ip: fix memory leak in ip_dump handlerMatthew Smith1-0/+2
Type: fix A vector allocated by vl_api_ip_dump_t_handler() was not being freed. Change-Id: I13425b8087e60df60c6aaa1230aa7e6d60b101a8 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2019-09-19api: split vl_api_prefix into twoOle Troan3-2/+25
One type for address with prefix and one type for prefix. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Icfec51d9b7d5cde1d69fbecdd97498688ab7b295 Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Klement Sekera <ksekera@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com>
2019-09-16api: autogenerate api trace print/endianOle Troan4-7/+97
In addition to the external vppapitrace tool, VPP itself supports dumping of API trace files. In two formats, "custom-dump" and "dump". "dump" gives a human friendly list, and "custom-dump" is meant to give a list of commands that can be fed to VAT. This patch only deals with "dump". Prior to this fix, auto-generation was only done for the basic types. This fix adds support for any type, including lists, and supports pretty-printing of enums, strings, IP addresses, MAC addresses and so on. Usage: api trace dump <api-trace-file> For example Change-Id: I4e485680e6dcfce7489299ae6cf31d835071ac40 ---------- trace 48 ----------- vl_api_sw_interface_set_flags_t: _vl_msg_id: 75 client_index: 0 context: 10 sw_if_index: 1 flags: IF_STATUS_API_FLAG_ADMIN_UP ---------- trace 49 ----------- vl_api_sw_interface_add_del_address_t: _vl_msg_id: 88 client_index: 0 context: 11 sw_if_index: 1 is_add: 1 del_all: 0 prefix: 172.16.1.1/24 ---------- trace 51 ----------- vl_api_cli_inband_t: _vl_msg_id: 819 client_index: 0 context: 13 cmd: packet-generator capture pg0 pcap /tmp/vpp-unittest-TestMAP-YhcmDX/pg0_out.pcap disable ---------- trace 58 ----------- vl_api_ip_neighbor_add_del_t: _vl_msg_id: 199 client_index: 0 context: 20 is_add: 1 neighbor: sw_if_index: 2 flags: IP_API_NEIGHBOR_FLAG_NONE mac_address: 0202.0000.ff02 ip_address: fd01:2::2 Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I5556d06008de2762e7c2d35a8b0963ae670b3db1 Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com>
2019-09-11ip: apply dual loop unrolling in ip4_inputLijian.Zhang1-0/+68
Too many prefetches within loop unrollings induce bottleneck and performance degradation on some CPUs which have less cache line fill buffers, e.g, Arm Cortex-A72. Apply dual loop unrolling and tune prefetches manually to resolve hot-spot with prefetch instructions. It saves about 11.5% cycles with ip4_input node on Cortex-A72 CPUs. Type: feature Change-Id: I1ac9eb21061a804af2a414b420217fbcda3689c9 Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
2019-09-11ip: apply dual loop unrolling in ip4_rewriteLijian.Zhang1-0/+131
Too many prefetches within loop unrollings induce bottleneck and performance degradation on some CPUs which have less cache line fill buffers, e.g, Arm Cortex-A72. Apply dual loop unrolling and tune prefetches manually to remove hot-spot with prefetch instructions, to get throughput improvement. It brings about 7% throughput improvement and saves 28% clocks with ip4_rewrite nodes on Cortex-A72 CPUs. Type: feature Change-Id: I0d35ef19faccbd7a5a4647f50bc369bfcb01a20d Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
2019-09-10tcp: enable gso in tcp hoststackSimon Zhang1-0/+2
Type: feature Change-Id: If68d07fbe8c6f7fffd2f93c7e854367082927e4f Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
2019-09-07ip: fix udp/tcp checksum corner casesDave Barach2-5/+31
When checksumming chained buffers with odd lengths: insert a NULL byte, or the calculation fails. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: John Lo <loj@cisco.com> Change-Id: I380f7c42897bdb28c8c29aa1c4cdaaa849cc9ecc
2019-09-03api: enforce vla is last and fixed string typeOle Troan1-2/+2
Enforce that variable length fields are the last element of API messages. Add a 'fixed' version of string type, since dealing with multiple variable length strings turned out too painful for the C language bindings. The string type is now: { string name[64]; // NUL terminated C-string. Essentially decays to u8 name[64] string name[]; // Variable length string with embedded len field (vl_api_string_t) }; The latter notation could be made available to other types as well. e.g. { vl_api_address_t addresses[]; } instead of { u32 n_addr; vl_api_address_t addresses[n_addr]; }; Type: fix Change-Id: I18fa17ef47227633752ab50453e8d20a652a9f9b Signed-off-by: Ole Troan <ot@cisco.com>
2019-09-02ipsec ip tcp l2: multiarch nodes cannot be declared as staticDamjan Marion2-2/+2
Credits to ray.kinsella@intel.com who spotted the issue and identified root cause. Type: fix Change-Id: I4afe74c47769484309f6aebca2de56ad32c8041f Signed-off-by: Damjan Marion <damarion@cisco.com>