summaryrefslogtreecommitdiffstats
path: root/src/plugins/avf
AgeCommit message (Collapse)AuthorFilesLines
2021-02-15vlib: refactor checksum offload supportMohsin Kazmi1-8/+6
Type: refactor This patch refactors the offload flags in vlib_buffer_t. There are two main reasons behind this refactoring. First, offload flags are insufficient to represent outer and inner headers offloads. Second, room for these flags in first cacheline of vlib_buffer_t is also limited. This patch introduces a generic offload flag in first cacheline. And detailed offload flags in 2nd cacheline of the structure for performance optimization. Change-Id: Icc363a142fb9208ec7113ab5bbfc8230181f6004 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-01-21avf: use write combining store for queues tail updateRadu Nicolau3-2/+13
Performance improvement: on supported platforms, currently only Intel Tremont, use a write combining store to update the tail pointers. Also, Tremont node variant is added for all. Type: improvement Signed-off-by: Radu Nicolau <radu.nicolau@intel.com> Change-Id: Ie9606e403b7d9655184f778e3ffee3027c8c9edd
2021-01-21interface: rx queue infra rework, part oneDamjan Marion3-18/+32
Type: improvement Change-Id: I4008cadfd5141f921afbdc09a3ebcd1dcf88eb29 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-01-19avf: fix l2_len for csum offloadMohammed Hawari1-4/+3
Use vlib_buffer_t::current_data instead of vnet_buffer_opaque_t::l2_hdr_offset to compute l2_len for checksum offload (l2_hdr_offset might be invalid if packet originates from an L3 interface) Change-Id: I2031ea6fd6a7af4b6e186751e119ebd6161641b5 Type: fix Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2020-12-19avf: fix gcc compiling warning on ArmJieqiang Wang1-4/+4
Initializing struct avf_ip6_psh by {0} using gcc with O2 optimize option will trigger the -Werror=maybe-uninitialized compiling warning on Arm because gcc compiler will think some members of the struct avf_ip6_psh may not be initialized, which probably is a false positive in this case. The compiling error log is shown as below. Avoid this compiling warning by explicitly declaring the IPv6 src and dst ip in avf_ip6_psh as ip6_address_t. ccache /usr/lib/ccache/gcc-10 -DHAVE_FCNTL64 -DHAVE_GETCPU -DHAVE_MEMFD_CREATE -I/home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src -I. -Iinclude -I/home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src/plugins -Iplugins -Iplugins/avf -Wno-address-of-packed-member -g -fPIC -Werror -Wall -march=armv8-a+crc -O2 -fstack-protector -DFORTIFY_SOURCE=2 -fno-common -fPIC -DCLIB_MARCH_VARIANT=cortexa72 -march=armv8-a+crc+crypto -mtune=cortex-a72 -DCLIB_N_PREFETCHES=6 -MD -MT plugins/avf/CMakeFiles/avf_plugin_cortexa72.dir/output.c.o -MF plugins/avf/CMakeFiles/avf_plugin_cortexa72.dir/output.c.o.d -o plugins/avf/CMakeFiles/avf_plugin_cortexa72.dir/output.c.o -c /home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src/plugins/avf/output.c In file included from /home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src/vppinfra/vector_funcs.h:41, from /home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src/vppinfra/vector.h:196, from /home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src/vppinfra/string.h:48, from /home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src/vppinfra/mem.h:49, from /home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src/vppinfra/vec.h:42, from /home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src/vppinfra/format.h:44, from /home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src/vppinfra/elf.h:41, from /home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src/vppinfra/elf_clib.h:41, from /home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src/vlib/vlib.h:44, from /home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src/plugins/avf/output.c:18: /home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src/plugins/avf/output.c: In function ‘avf_device_class_tx_fn_cortexa72’: /home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src/vppinfra/byte_order.h:59:10: error: ‘*((void *)&psh+32)’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 59 | return __builtin_bswap16 (x); | ^~~~~~~~~~~~~~~~~~~~~ /home/snowball/tasks/test_vpp_build/test-patch-9/vpp/src/plugins/avf/output.c:115:23: note: ‘*((void *)&psh+32)’ was declared here 115 | struct avf_ip6_psh psh = { 0 }; | ^~~ Type: fix Change-Id: I2684b101b07823dfacc4a56cc29d152828d0cf37 Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
2020-12-18avf: optimized with NEON SIMD instructionLijian.Zhang1-1/+27
Optimize avf-input node processing function with NEON SIMD instruction. Type: improvement Change-Id: I3dd76ac659686209dda9b176fc426aeae639e99b Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
2020-12-14misc: move to new pool_foreach macrosDamjan Marion1-4/+4
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-04avf: fix coverity issueMohammed Hawari1-1/+2
Change-Id: I1b589c924326a98c4cabe5496ce72b20673b5153 Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Type: fix
2020-12-01avf: add TSO supportMohammed Hawari3-21/+120
Change-Id: Ica663e1d07225acf53fd74b0051a5a2a34174960 Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Type: improvement
2020-11-15avf: add L4 checksum offload supportMohammed Hawari3-6/+136
Change-Id: Ie90437cf597c5d53ab1cc41ea7db15b97614e2fc Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Type: improvement
2020-11-13avf: actually delete ethernet address if deletion was requestedAndrew Yourtchenko1-1/+1
fixes the coverity issue 214893. Type: fix Fixes: 1ab533cba2202e73c2296d7677d0b335f2afad7b Change-Id: I1159f5e23d1cdfcf6575c29d11e884703afee20f Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2020-11-12avf: don't switch process if already running process nodeDamjan Marion1-18/+25
Type: fix Change-Id: I82b11339402b5848b27c600f6484aaeee66cc888 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-11-09vlib: fix trace number accountingBenoît Ganne1-12/+16
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-26avf: use atomic store instead of barrierDamjan Marion2-4/+3
Type: improvement Change-Id: Ifea5f0c2fecb99fd320a2e1141f4b4f0d6a793ca Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-26vlib: add VLIB_REGISTER_LOG_CLASS macroDamjan Marion2-10/+12
Type: improvement Change-Id: Iafcaeb88fa3569e042fb9cb270cf062b145416e2 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-09avf: add add_del_mac_address handlerDamjan Marion2-33/+89
Type: improvement Change-Id: I4d0b1cd87cf2f58a653f40a300da4b7a43348a06 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-08interface: shorten vnet_hw_if_rx_modeDamjan Marion1-2/+2
This is part of bigger refactor. Type: refactor Change-Id: I6fc2c0a1e2d217a70952901bcf775b8485bd3c20 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-30avf: check duplicate pci address upon create interfaceSteven Luong1-0/+13
Entering duplicate pci address when creating an avf interface causes crash in register_node (gdb) f 4 145 error_exit (1); (gdb) up 354 clib_error ("more than one node named `%v'", n->name); (gdb) p n $1 = (vlib_node_t *) 0x7fffbbe55de4 (gdb) p n->name $2 = (u8 *) 0x7fffbc410b10 "avf-0/4/a/0-tx" (gdb) The fix is to loop through the pci addresses in the avf interface pool and to reject the duplicate. Type: improvement Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I4ed6fb630fb11982d85c5bb325d9f0d6beeaf023
2020-09-29avf: validate queue size configSteven Luong3-13/+52
Check CLI queue size is within the range of 64 and 4096 Enhance show hardware to display queue size and number of queues. Type: improvement Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I360e3cdb2e69e4ea7380ed924e71a5ae84ed4b64
2020-09-16avf: wrong argument passed to avf_log_errSteven Luong1-1/+1
Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ica4601c9d17e182cbc348989a9f75ab1cb18b78a
2020-09-11avf: add assert to ensure that adminq is used only from avf processDamjan Marion1-0/+5
Type: improvement Change-Id: Ib64c9b8207776986656e5a26c13a221edc6cc950 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-11avf: change promisc mode from the avf process nodeDamjan Marion2-7/+26
Avoid situations where promisc mode is chaged while avf process is suspended in the middle of adminq operation. Type: fix Change-Id: Ia1fc6551e83218b5938630ad3a15d4f3f0ceceff Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-11avf: fix race between avf and cli/api processDamjan Marion6-35/+43
device pool my grow during suspemd which will cause crash in avf process after it exits from suspend. Type: fix Change-Id: I51fec90088c909cfbaaca6c245272a28c0827ca0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-11avf: fix race between avf process node and avf_delete_if(...)Damjan Marion4-18/+34
It may happen that process node is suspended while it waits for response from adminq and during that time CLI or API process can call avf_delete_if. When avf process node resumes, it may happen that device is not there anymeore. This patch delegates interface deletion to process node, so CLI/API process just sends signal instead of deleting device instance itself. Type: fix Change-Id: I7f12e12df3071650f6e60ad7eb5af23b7acfe335 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-27ethernet: fix DMAC check and skip unnecessary ones (VPP-1868)John Lo1-16/+27
Fix and optimize DMAC check in ethernet-input node to utilize NIC or driver which support L3 DMAC-filtering mode so that DMAC check can be bypassed safely for interfaces/sub-interfaces in L3 mode. Checking of interface in L3-DMAC-filtering state to avoid DMAC check require the following: a) Fix interface driver init sequence for devices which supports L3 DMAC-filtering to indicate its capability and initialize interface to L3 DMAC-filtering state. b) Fix ethernet_set_flags() function and its associated callback flags_change() functions registered by various drivers in interface infra to provide proper L3 DMAC filtering status. Maintain interface/sub-interface L3 config count so DMAC checks can be bypassed if L3 forwarding is not setup on any main/sub-interfaces. Type: fix Ticket: VPP-1868 Signed-off-by: John Lo <loj@cisco.com> Change-Id: I204d90459c13e9e486cfcba4e64e3d479bc9f2ae
2020-05-22avf: interrupt mode, support for WB_ON_ITRDamjan Marion2-57/+103
Type: improvement Change-Id: I5c944c3f82e0f278b64f28e09a74f24514c029f0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-05-22avf: improve link speed handlingDamjan Marion1-34/+36
Support VIRTCHNL_VF_CAP_ADV_LINK_SPEED. Type: improvement Change-Id: Ie45c9d557d0369464cbb6881ee1259ef3807d7d5 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-03-25avf: fix rx queue refill on buffer alloc failureDamjan Marion1-6/+6
If buffer alloc fails, it may happend that rx queue will be stuck as old code only refills if at least one packet is received. Type: fix Change-Id: I388c4f8a9fb2c208bdc222e31b443cbe6b94af82 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-03-24avf: proper promisc handlingDamjan Marion2-7/+27
Type: fix Change-Id: Id20a0fe77372602fd211156ccee01c18d829d8df Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-02-25avf: Handle chain buffer in TX properlySteven Luong2-7/+140
For chain buffer, need to traverse b->next_buffer to transmit all buffers in the chain. Only set EOP at the last descriptor in the chain to signal this is a chain descriptor. Introduce slow path to handle ring wrap. This is needed because chain buffer may consist of multiple pieces and it may span from near the end of the ring to the beginning of the ring. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Id7c872f3e39e09f3566aa63f3cdba8f40736d508
2019-12-12avf: explicit types in apiOle Troan1-2/+3
Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: If693e066eeb9312d4535893c279446dc43e8baa2
2019-10-23avf: improve timeout handlingJakub Grajciar2-19/+47
Type: feature Change-Id: I8fa1d691ef7bc51ae5c44c344195207ce7d0a2e7 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-09-27avf: remote api boilerplateOle Troan6-211/+9
Type: refactor Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Iafa1c0d0c1195f88b1a55f0341459c3278c3b2e6 Signed-off-by: Ole Troan <ot@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-04avf: reduce default ITR intervalDamjan Marion1-1/+1
Type: fix Fixes: b4ff07a Change-Id: I361ec71944048734b73eec700e32531fb070194e Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-08-22avf: properly set irq queue masksDamjan Marion1-1/+2
Type: fix Fixes: ae91180 Change-Id: I9c55c3fdf41089d337b998e2e28abb23d81525ef Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-08-21avf: print queue id in packet traceDamjan Marion3-4/+6
Type: feature Change-Id: If3deb26b9ee3b9e677c9dc50789bf81fe6c11dee Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-08-21avf: fix init when num_rx_queues > num_tx_queuesDamjan Marion1-4/+4
Type: fix Fixes: ae91180 Change-Id: Id93b0f4d23ad7022e341e305bbd93ef2fff5787d Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-07-23api: binary api cleanupDave Barach2-3/+5
Multiple API message handlers call vnet_get_sup_hw_interface(...) without checking the inbound sw_if_index. This can cause a pool_elt_at_index ASSERT in a debug image, and major disorder in a production image. Given that a number of places are coded as follows, add an "api_visible_or_null" variant of vnet_get_sup_hw_interface, which returns NULL given an invalid sw_if_index, or a hidden sw interface: - hw = vnet_get_sup_hw_interface (vnm, sw_if_index); + hw = vnet_get_sup_hw_interface_api_visible_or_null (vnm, sw_if_index); if (hw == NULL || memif_device_class.index != hw->dev_class_index) return clib_error_return (0, "not a memif interface"); Rename two existing xxx_safe functions -> xxx_or_null to make it obvious what they return. Type: fix Change-Id: I29996e8d0768fd9e0c5495bd91ff8bedcf2c5697 Signed-off-by: Dave Barach <dave@barachs.net>
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-07-11avf: add more link speedsDamjan Marion2-1/+7
Type: feature Change-Id: I6f94f7ef5ffbd938457c9356a5a11f3d1afeb0a2 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-07-09vat: unload unused vat pluginsDave Barach1-19/+2
If the corresponding vpp plugin is absent, return a non-zero clib_error_t * from vat_plugin_register ("xxx plugin not loaded"). The vat plugin calls dlclose on the vat plugin, and it disappears. Depending on the plugin configuration, this can reduce the vpp virtual size by several gigabytes. Added a VAT_PLUGIN(<plugin-name>) macro to vat_helper_macros, clean up boilerplate vat_plugin_register() implementations. Fixed a number of non-standard vat_plugin_register methods. Type: refactor Change-Id: Iac908e5af7d5497c78d6aa9c3c51cdae08374045 Signed-off-by: Dave Barach <dave@barachs.net>
2019-06-25avf: fix clear hw statsFilip Tehlar3-2/+14
AVF plugin is missing a handler for clearing stats. This patch will implement it. Ticket: VPP-1701 Type: fix Change-Id: If4b4354da442065896bb001deda23f64ddc18fb4 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-06-18vppinfra: add format_hex_bytes_no_wrapDamjan Marion1-5/+5
Type: feature Change-Id: I53e1f05b2b048925fca3b2f6b0499ff9c3e6ee12 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-06-18avf: fix adminq enqueue errorsDamjan Marion2-5/+9
Type: fix Fixes: b4ff07a Change-Id: I2578ae3e093961fa8765568b5fedcf75ae9487f6 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-06-18avf: add logging macros and improve loggingDamjan Marion3-13/+134
Type: feature Change-Id: I3d7009505ddbb2c41d8619d9195c6a5373fa9a04 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-06-14avf: update known issues section in README.mdDamjan Marion1-5/+1
Type: docs Change-Id: I09f6984b74ebb7ee743881b4ad496618542eeaa5 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-06-12avf: add README.md section about spoofing checkDamjan Marion1-0/+10
Type: docs Change-Id: I4ae65ed22275abf0d15045f3b09625d6aaa3b67b Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-06-05avf: enable promiscuous modeSteven Luong3-1/+18
In order to receive multicast packets from the VF interface, promiscuos mode must be enable. Type: fix Fixes: b4ff07a Change-Id: I549bc37a05895d3355f2832c200e9262c95a27b5 Signed-off-by: Steven Luong <sluong@cisco.com>
2019-05-16init / exit function orderingDave Barach1-5/+6
The vlib init function subsystem now supports a mix of procedural and formally-specified ordering constraints. We should eliminate procedural knowledge wherever possible. The following schemes are *roughly* equivalent: static clib_error_t *init_runs_first (vlib_main_t *vm) { clib_error_t *error; ... do some stuff... if ((error = vlib_call_init_function (init_runs_next))) return error; ... } VLIB_INIT_FUNCTION (init_runs_first); and static clib_error_t *init_runs_first (vlib_main_t *vm) { ... do some stuff... } VLIB_INIT_FUNCTION (init_runs_first) = { .runs_before = VLIB_INITS("init_runs_next"), }; The first form will [most likely] call "init_runs_next" on the spot. The second form means that "init_runs_first" runs before "init_runs_next," possibly much earlier in the sequence. Please DO NOT construct sets of init functions where A before B actually means A *right before* B. It's not necessary - simply combine A and B - and it leads to hugely annoying debugging exercises when trying to switch from ad-hoc procedural ordering constraints to formal ordering constraints. Change-Id: I5e4353503bf43b4acb11a45fb33c79a5ade8426c Signed-off-by: Dave Barach <dave@barachs.net>