summaryrefslogtreecommitdiffstats
path: root/src/vnet/pg
AgeCommit message (Collapse)AuthorFilesLines
2020-11-13pg: fix uninitialized variable in pg mac filter CLIAndrew Yourtchenko1-1/+1
Fixes coverity issue 214887 Change-Id: I81bfc009faabcb74f950a94715a0395fac264ee9 Type: fix Fixes: 21fb4f71ee3824c8f177045f21fea258ece602a9 Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-11-09vlib: fix trace number accountingBenoît Ganne1-10/+17
When using classifier to filter traces, not all packets will be traced. In that case, we should only count traced packets. Type: fix Change-Id: I87d1e217b580ebff8c6ade7860eb43950420ae78 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-10-12misc: clang-11 and gcc-10 supportDamjan Marion1-1/+1
clang-11 complains: error: field 'buffer_template' with variable sized type 'vlib_buffer_t' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end] Type: improvement Change-Id: I2cb6b4fde723a05b42cf33dd8130df074f0362ab Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-08pg: Choose the input interface from the stream's rxNeale Ranns1-1/+3
Type: fix Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I656918a417d33ec6bea30054805e03ae19c38f2d
2020-10-08fib: Register multicast MAC with interface for accepting interfacesNeale Ranns3-0/+159
Type: fix Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: Ic6c76b65e2dcc08916373153944507a297c962c0
2020-08-14gso: packet coalesce libraryMohsin Kazmi7-9/+113
Type: feature Change-Id: Ia19d3611e596d9ec47509889b34e8fe793a0ccc3 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-06-16gso: fix the udp checksum in testMohsin Kazmi2-13/+8
Type: fix Change-Id: I7005e4763e73f3679c40f94bdab26d439cd23188 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-06-08vxlan: Fixed checksum caclculation offsetVladimir Isaev1-10/+19
VXLAN uses csum_offload for IPv6 packets. But without gso node we have csum calculated only for inner packet. This patch adds support for outer header csum calculation. Checksum for inner packet should be calculated before interface-output node (for example in vxlan node). Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Signed-off-by: Vladimir Isaev <visaev@netgate.com> Change-Id: Ica68429ede4426293769207cd83c791ebe72fe56
2020-05-04misc: binary api fuzz test fixesDave Barach1-1/+1
Add a hook to src/vlibapi/api_shared.c to fuzz (screw up) binary API messages, e.g. by xoring random data into them before processing. We specifically exempt client connection messages, and inband debug CLI messages. We step over msg_id, client index, client context, and sw_if_index. Otherwise, "make test" vectors fail too rapidly to learn anything. The goal is to reduce the number of crashes caused to zero. We're fairly close with this patch. Add vl_msg_api_max_length(void *mp), which returns the maximum plausible length for a binary API message. Use it to hardern vl_api_from_api_to_new_vec(...) which takes an additional argument - message pointer - so it can verify that astr->length is sane. If it's not sane, return a u8 *vector of the form "insane astr->length nnnn\0". Verify array lengths in vl_api_dhcp6_send_client_message_t_handler(...) and vl_api_dhcp6_pd_send_client_message_t_handler(...). Add a fairly effective binary API fuzz hook to the unittest plugin, and modify the "make test" framework.py to pass "api-fuzz { on|off }" to enable API fuzzing: "make API_FUZZ=on TEST=xxx test-debug" or similar Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I0157267652a163c01553d5267620f719cc6c3bde
2020-04-15pg: set vnet buffer flags in pg streamsDave Barach3-1/+11
See .../extras/pg/checksum_offload.pg for a nontrivial example, which deliberately sets bogus ip and udp checksums in the generated packets, then fixes the mess with (software emulated) hardware checksum offload. Validated via "pcap dispatch trace on max 1000 buffer-trace pg-input 100". Packets stuffed into loop1-output have the configured bogus ip and udp checksums. vnet_calc_checksums_inline(...) fixes the checksums, which are correct when packets visit loop1-tx. The packet generator is a dumb robot in this regard. If you ask for a ridiculous flag combination - example: ip4 and ip6 - your mileage may vary. Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I6d9e790f373bcd9e445a89113ca8e4c8f9aa9419
2020-02-26pg: API cleanupJakub Grajciar4-25/+21
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Ibf693e4b178d2579bc3afb9653bffc07fbb7dd0a Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-02-10misc: add FEATURE.yaml filesDave Barach1-0/+13
For src/vnet/classify, src/vnet/cop, src/vnet/pg, and src/vlib/unix Type: docs Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ib6ab734608693a1e9562a44808246950616e8d36
2019-12-17pg: don't leak open files in packet-generatorChristian E. Hopps1-0/+3
Fix pg code to close it's open file descriptors before zero'ing the pcap_main structure for re-use. Ticket: VPP-1780 Type: fix Signed-off-by: Christian E. Hopps <chopps@chopps.org> Change-Id: I32945c6476ae83b8d210ee67ac78db3e8f786f46
2019-12-10api: multiple connections per processDave Barach1-1/+1
Type: feature Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I2272521d6e69edcd385ef684af6dd4eea5eaa953
2019-12-06gso: fix the tap/virtio driver for header offsetMohsin Kazmi1-1/+24
Type: fix Change-Id: Ied34466907fa8ad44f997c600dbf481be4d22027 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-12-05gso: add protocol header parserMohsin Kazmi1-29/+9
Type: feature Change-Id: I7c6be2b96d19f82be237f6159944f3164ea512d0 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-12-04gso: remove the interface countMohsin Kazmi1-1/+0
Type: refactor Change-Id: I51405b9d09fb6fb03d08569369fdd4e11c647908 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-10-03misc: add "maxframe" and "rate" to packet-generator cli.Christian E. Hopps3-5/+13
Allow for setting the maximum number of generated packets to be included in the frame passed to next nodes. This is very important for testing code which may be susceptible to multi-frame vs single-frame bugs (e.g., code that is doing re-ordering where packets may be buffered between frames). Update: - remove redundant packet "rate" option. - reduce n_max_frame to u32 as that's what pulled from the CLI. Type: feature Signed-off-by: Christian E. Hopps <chopps@chopps.org> Change-Id: Ie362bbb110b2cf01d9f65c559bbe9101e17b7fdc Signed-off-by: Christian Hopps <chopps@labn.net>
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-23interface: use the correct condition for checking if the pcap fd is openAndrew Yourtchenko1-1/+1
The 9af7e2e87e used a comparison that fd is >= 0 to check that the pcap needs closing. While the pcap_close() function does reset the file descriptor to -1, the freshly initialized structure has it equal to 0. This causes the VPP to close stdin if the packets are being seen on pg interface without the capture file being opened. This triggers the vpp attempting to read from STDIN (another bug), which results in running out of memory. Change-Id: I11d61422701500a9b3e0dd52d59383f297d57f54 Type: fix Fixes: 9af7e2e87e Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-08-20fix pcap_write functionJack Xu1-1/+4
when use pcap cli to capture pcakets into two files rx01.pcap && rx02.pcap, the first time: 1)pcap rx trace on max 100 intfc any file rx01.pcap 2)......the process of capture data to buffer...... 3)pcap rx trace off the second time: 4)pcap rx trace on max 100 intfc any file rx02.pcap 5)......the process of capture data to buffer...... 6)pcap rx trace off the pcap_write function bug in this two lines pm->n_packets_captured = 0; if (pm->n_packets_captured >= pm->n_packets_to_capture) referring to calling pcap_close() will result in that the twice pcap cli both writes the packets into rx01.pcap, but nothing into rx02.pcap. Beside, the rx02.pcap file will not be created. solution: separate the pcap_close() out of pcap_write() Change-Id: Iedeb46f9cf0a4cb12449fd75a4014f95f3bb3fa8 Signed-off-by: Jack Xu <jack.c.xu@ericsson.com>
2019-08-17gso: fix l3 and l4 header offset in case of tagged interfaceMohsin Kazmi1-0/+14
previously, PG and virtio interfaces calculate wrong l3 and l4 header offset. This patch fixes this issue. Type: fix Ticket: VPP-1739 Change-Id: I5ba978e464babeb65e0711e1027320d46b3b9932 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-08-16gso: remove the ip checksum flag in case of ipv6Mohsin Kazmi1-1/+0
Type: fix Ticket: VPP-1727 Change-Id: Icfee35c5ab5e1c65079d1ca7bb514162319113e5 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-07-31pg: clarify the text of error messageAndrew Yourtchenko1-1/+1
Enabling capture on pg with the file already existing results in a misleading error message. Fix the text. Change-Id: I1aea49cfeda3b4bfe6ed7b18fd543948a078508a Type: fix Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-07-28pg: add GSO supportMohsin Kazmi6-11/+109
Type: feature Change-Id: I72676495a85fbecc946aa266a75234cce70c3a5e Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-07-18vlib: convert frame_index into real pointersAndreas Schultz1-1/+1
The fast path almost always has to deal with the real pointers. Deriving the frame pointer from a frame_index requires a load of the 32bit frame_index from memory, another 64bit load of the heap base pointer and some calculations. Lets store the full pointer instead and do a single 64bit load only. This helps avoiding problems when the heap is grown and frames are allocated below vm->heap_aligned_base. Type: refactor Change-Id: Ifa6e6e984aafe1e2755bff80f0a4dfcddee3623c Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com> Signed-off-by: Dave Barach <dave@barachs.net>
2019-06-29pg: format_pg_input_trace - reorder fieldsPaul Vinciguerra1-1/+1
00:00:00:814640: pg-input stream pcap0-sw_if_index-1, 42 bytes, 1 sw_if_index is changed to: 00:00:00:814640: pg-input stream pcap0-sw_if_index-1, 42 bytes, sw_if_index 1 Type: style Change-Id: I9bb32494c9c1d08bc7588f088ed67a60ed3236dd Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-05-22stats: support multiple works for error countersOle Troan1-3/+0
The current code only allowed access to the main thread error counters. That is not so useful for a multi worker instance. No return a vector indexed by thread of counter_t values. Type: fix Change-Id: Ie322c8889c0c8175e1116e71de04a2cf453b9ed7 Signed-off-by: Ole Troan <ot@cisco.com>
2019-05-17Tests: Raise exception if API cli_inband command fails.Paul Vinciguerra1-1/+2
* Configure tests to raise exception if cli_inband fails. * Fix failing tests. * Add filename detail to pcap.stat clib_error_return for debugging. Note: this change identifies spurious issues with packet-generator such as: CliFailedCommandError: packet-generator capture: pcap file '/tmp/vpp-unittest-Test6RD-v09RPA/pg0_out.pcap' does not exist. These issues resolve themselves on remaining test passes. Change-Id: Iecbd09daee954d892306d11baff3864a43c5b603 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-05-09add mactime plugin unit / code coverage testsDave Barach3-20/+30
The unit and code coverage tests are boring. The rest of the patch involves test and packet-generator infra cleanups. Teach the "make test-xxx" family of targets to set the api test plugin path correctly, to make "binary-api <api-message-name> <args>" debug CLI commands work correctly in the "make test" environment. Unfortunately involves both the top-level and test Makefiles. Add a minor pg cli feature, a CLI to manually set s->sw_if_index[VLIB_TX]. Consider the case where one configures an interface with both a device-input and an output feature. To test the output feature using the pg, it's necessary to inject packets into the interface output node with both b->sw_if_index[VLIB_TX] and b->sw_if_index[VLIB_RX] set correctly. For example: packet-generator new { name tx limit 15 size 128-128 interface local0 # rx: device input feature not configured on local0 tx-interface loop0 # tx: output node requires b->sw_if_index[VLIB_TX] node loop0-output data { hex 0x01005e7ffffa000dead0000008000102030405060708090a0b0c0d0e0f0102030405 } } Fix a longstanding bug in the packet generator stream setup. Remove kludges which set b->sw_if_index[VLIB_TX] to ~0 [in multiple places] instead of using the stream value s->sw_if_index[VLIB_TX], and setting THAT datum correctly. Change-Id: I1097a18e8db73661ded6b822c1d718f7e5cf36ed Signed-off-by: Dave Barach <dave@barachs.net>
2019-03-28Typos. A bunch of typos I've been collecting.Paul Vinciguerra1-1/+1
Change-Id: I53ab8d17914e6563110354e4052109ac02bf8f3b Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-02-22Add no-append flag to vlib_frame_tDamjan Marion1-0/+1
Change-Id: I01c4f5755d579282773ac227b0bc24f8ddbb2bd1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-20pg: fix payload hex-string bugKingwel Xie1-6/+8
Change-Id: I0ea98bf9c203398d9cf85d22994a10217bb511d2 Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
2019-02-20pg: fix tracing when device-input feature arc is usedDamjan Marion1-6/+4
Change-Id: I82240b43d3a5f3f33ac9ab2de106b3ec0ea31780 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-20pg: fix crash when multiple streams are enqueuing to the same nextDamjan Marion1-1/+1
Only with debug image and when next node is not ethernet-input... Change-Id: Iaa404b5d35d5c04996ff48cd16877858092b78d7 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-20pg: remove no-recycle optionDamjan Marion2-6/+0
Change-Id: Ic47bde2d08b2719b5c6c87cb2e9a8af0d2160e6e Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-09buffers: fix typoDamjan Marion3-3/+3
Change-Id: I4e836244409c98739a13092ee252542a2c5fe259 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-06buffers: make buffer data size configurable from startup configDamjan Marion3-5/+5
Example: buffers { default data-size 1536 } Change-Id: I5b4436850ca18025c9fdcfc7ed648c2c2732d660 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-25pg: bugfix for pg paylod hdr-sizeKingwel Xie1-3/+3
it was specified to 0 after https://gerrit.fd.io/r/16909 causes unformat_pg_ip4_header to wrongly set ip header len. do more check when assigning e->lsb_bit_offset to avoid negative value Change-Id: Ib772c7135cdeb355f0d60f1ee11602f6b5a0ff21 Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
2019-01-23pg: cli improvementKingwel Xie4-32/+97
1. show packet-generator verbose, display all edit-groups and hdr-size 2. unformat_pg_payload, always mark payload hdr-size as 0 3. packet-generator now can change rate/limit/size at runtime 4. validate_stream checks buffer min-size/max-size against all edit groups' header size 5. remove incorrect max packet size limit check in validate_stream(...) Change-Id: Ic45e4f2b98bc0fd7330e0b480dd677fa3c69a677 Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com> Signed-off-by: Dave Barach <dave@barachs.net>
2019-01-18Add vlib_buffer_copy_indices inline functionDamjan Marion1-4/+3
This reverts commit 1e59f9ddbdda14591967e1d66eab8623f9ba58e4. Change-Id: Iae1d372b887e170d28cac2fe4c61325ee5a5894a Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-06pktgen: support mixed multi/single chunk pcap replayDave Barach3-71/+165
Change-Id: I3d387b5e2b17f89ed688ea6cfee3fb6d782fe326 Signed-off-by: Dave Barach <dave@barachs.net>
2019-01-01buffers: remove unused codeDamjan Marion4-15/+7
Change-Id: If2bbfbc52994f5de0879763e0b7a7864498debb6 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-11-20ethernet-input optimizationsDamjan Marion1-1/+19
Change-Id: I4ec7750ef58363bd8966a16a2baeec6db18b7e9e Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-11-17pcap-based dispatch tracerDave Barach2-2/+2
To facilitate dispatch trajectory tracing, vlib_buffer_t decoding, etc. through Wireshark Change-Id: I31356b9fa1f40cba8830aaf10a86a9fbb7546438 Signed-off-by: Dave Barach <dave@barachs.net>
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach3-21/+25
Change-Id: Id4f37f5d4a03160572954a416efa1ef9b3d79ad1 Signed-off-by: Dave Barach <dave@barachs.net>
2018-11-13vlib rename vlib_frame_args(...) to vlib_frame_scalar_args(..)Damjan Marion1-2/+2
Typically we have scalar_size == 0, so it doesn't matter but vlib_frame_args was providing pointer to scalar frame data, not vector data. To avoid future confusion function is renamed to vlib_frame_scalar_args(...) Change-Id: I48b75523b46d487feea24f3f3cb10c528dde516f Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-10-27pg: incrementing len should be truncated byKingwel Xie1-12/+15
stream->max_packet_bytes This length is the payload length, and will impact the ip length when ip length is not specified. iplen = header_len + payload_len SO, better to make it comply with max_packet_bytes Change-Id: I8b0f7485e29fcaccae656f2d03b3b5e614300fb8 Signed-off-by: Kingwel Xie <kingwel.xie@ericsson.com>
2018-10-23c11 safe string handling supportDave Barach2-3/+3
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-19vppinfra: add atomic macros for __sync builtinsSirshak Das1-2/+3
This is first part of addition of atomic macros with only macros for __sync builtins. - Based on earlier patch by Damjan (https://gerrit.fd.io/r/#/c/10729/) Additionally - clib_atomic_release macro added and used in the absence of any memory barrier. - clib_atomic_bool_cmp_and_swap added Change-Id: Ie4e48c1e184a652018d1d0d87c4be80ddd180a3b Original-patch-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Sirshak Das <sirshak.das@arm.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com> Reviewed-by: Steve Capper <steve.capper@arm.com>