aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2023-03-19vppinfra: fix pool free bitmap allocationVladislav Grishenko3-1/+58
Using clib_bitmap_vec_validate makes free bitmap vector to be x64 times bigger (assuming x86_64) than necessary when non-zero and possible oom due (u32)(0 - 1) math with zero alloc. Fix it with clib_bitmap_validate which takes bit size, not index and ensure at least one bit is allocated. Type: fix Change-Id: I7e191f4e2fb3722a06bb800e1d075f7c7e2dcec9 Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru>
2023-03-18vppinfra: fix corner-cases in bihash lookupDave Barach18-39/+205
In a case where one pounds on a single kvp in a KVP_AT_BUCKET_LEVEL table, the code would sporadically return a transitional value (junk) from a half-deleted kvp. At most, 64-bits worth of the kvp will be written atomically, so using memset(...) to smear 0xFF's across a kvp to free it left a lot to be desired. Performance impact: very mild positive, thanks to FC for doing a multi-thread host stack perf/scale test. Added an ASSERT to catch attempts to add a (key,value) pair which contains the magic "free kvp" value. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I6a1aa8a2c30bc70bec4b696ce7b17c2839927065
2023-03-17vppinfra: move sha2.h to crypto/Damjan Marion2-1/+591
Type: refactor Change-Id: I3d0c57b82e5bdb4575c1ca13e463685fd11b7f11 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-17vppinfra: auto-free test memoryDamjan Marion5-59/+10
Type: improvement Change-Id: Ibc40a02c8c45fc8d9409c9a86fea7aaf70d9c048 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-17vppinfra: add FOREACH_ARRAY_ELT macroDamjan Marion1-0/+2
Type: improvement Change-Id: Iac1b3a66176c9a38a161246159140f30a1c168da Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-16vppinfra: add clib_crc32c testcase into infra testsAndrew Yourtchenko2-0/+55
Type: test Change-Id: Id96448ba3ab69a5b22dfc27812fc17194136b969 Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2023-03-16session: support active opens with same source portFlorin Coras2-3/+14
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2b426e9e988c32d261f36367087f358d8cc25e2f
2023-03-15vppinfra: widen the scope of test_vector_funcsDamjan Marion12-23/+23
Location changed and binary renamed to test_infra Also it is built by default. Type: improvement Change-Id: I27cd97f274501ceb7a01213e2bc9676cea00f39c Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-15crypto-native: 256-bit AES CBC supportDamjan Marion8-86/+369
Used on intel client CPUs which suppport VAES instruction set without AVX512 Type: improvement Change-Id: I5f816a1ea9f89a8d298d2c0f38d8d7c06f414ba0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-15build: add support for intel alderlake and sapphirerapids, part 2Damjan Marion1-1/+3
Type: improvement Change-Id: I64ca5bd3a959190111f61c5311a908d242c10bad Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-15dma_intel: fix potential invalid batch statusMarvin Liu1-5/+6
DMA batch status was set by hardware. Its value may be variable between cpus twice accesses. Saving the value of status can fix it. Type: fix Signed-off-by: Marvin Liu <yong.liu@intel.com> Change-Id: Ibc9337239555744a571685b486c986991c3e9b18
2023-03-14dpdk: enable Google Virtual EthernetMarvin Liu2-0/+7
Recognize and drive google virtual ethernet (gve) in google cloud. Type: feature Signed-off-by: Marvin Liu <yong.liu@intel.com> Change-Id: Ia559615ac059cabbca5d10bcd4049e87beaad638
2023-03-14vlib: fix clib_crc32c on odd lengths and clib_crc32c_u8Andrew Yourtchenko1-1/+1
Fix the typo in the intrinsic name, which caused incorrect intrinsic to be used. Type: fix Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com> Change-Id: Ib7fde14d12897e4d1bfb5a01f6d65025473e4f8e
2023-03-14session vcl: refactor builtin tx event for main txFlorin Coras9-36/+50
Rename unused SESSION_IO_EVT_BUILTIN_TX to SESSION_IO_EVT_TX_MAIN and leverage it for non-connected udp tx. Non-connected udp sessions are listeners and are therefore allocated on main thread. Consequently, whenever session queue node is not polling main, tx events generated by external applications might be missed or processed with some delay. To solve this, request that apps use SESSION_IO_EVT_TX_MAIN tx events as opposed to SESSION_IO_EVT_TX and send that to first worker as opposed to main. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5df5ac3dc80c0f192b2eefb1d465e9deefe8786b
2023-03-14session: pre-alloc required dma batchesMarvin Liu2-0/+3
Specify the number of max_batches when applying for dma config. Skip this round when no batch available from vlib_dma_batch_new. Type: improvement Signed-off-by: Marvin Liu <yong.liu@intel.com> Change-Id: Ic6e0acf81ba4fc3ed33aea6ac6990ef841021c59
2023-03-14vlib: pre-alloc dma backend batchesMarvin Liu2-0/+28
Allocate and initialize dma batch structure when adding dma config. The number of required dma batches is set by max_batches parameter. Thus dma batches are not allocated dynamically in worker thread. Application need to check the return value of vlib_dma_batch_new. Type: improvement Signed-off-by: Marvin Liu <yong.liu@intel.com> Change-Id: I5d05a67b59634cf2862a377d5ab77cb1040343ce
2023-03-14session: format transport connection flagsFlorin Coras2-18/+59
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Id87c41c472898d4f66b0771f18f822d1069bbfd0
2023-03-14session: cleanup lcl endpt freelist before all allocFlorin Coras1-4/+5
Make sure endpoint freelist is drained before alloc of fixed local source port is tried. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I302deee5609a463af8135185af71722ac8c55a27
2023-03-14build: add support for intel alderlake and sapphirerapidsDamjan Marion2-1/+28
Disabled by default.. Type: improvement Change-Id: I36176c009e0873c048874ae38a7ea0a91449235c Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-14crypto-native: avoid crash on 12th and 13th gen Intel client CPUsDamjan Marion1-2/+4
Those CPUs are announcing VAES capability but they don't support AVX512. Type: fix Fixes: 73a60b2 Change-Id: I7b4be95e91bb6f367cd71461f1126690f3ecd988 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-14memif: don't leak error strings in API handlersDamjan Marion2-4/+12
Type: fix Fixes: ab4d917 Change-Id: I226044f64e1577033798fd203a2e981c894830d6 Signed-off-by: Damjan Marion <damarion@cisco.com>
2023-03-13udp: Use udp_output_get_connection instead of udp_connection_getSteven Luong1-12/+11
udp_output_get_connection handles correctly if the connection is a listener whereas udp_connection_get does not which may lead to a crash. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I40b57287a8686820d29872cae2cfd6ae27a57c26
2023-03-13avf: 512-bit SIMD version of avf_tx_prepareLeyi Rong2-0/+53
Exploiting AVX-512 operations on avf_tx_prepare(). Type: improvement Signed-off-by: Leyi Rong <leyi.rong@intel.com> Change-Id: I01e0b4a2e2d440659b4298668a868d983f5091c3
2023-03-10vcl: init ldp config before vcl initFlorin Coras1-26/+31
This avoids printing ldp debug messages while debug is disabled and vcl is initializing. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5dfd1d59032db937fea146b6b84b8e26307a0de0
2023-03-10vlib: 512-bit SIMD version of vlib_buffer_freeLeyi Rong2-2/+73
Process 8 packets perf batch in vlib_buffer_free_inline() when CLIB_HAVE_VEC512 is enabled. Type: improvement Signed-off-by: Leyi Rong <leyi.rong@intel.com> Change-Id: I78b8a525bce25ee355c9bf0e0f651698a8c45bda
2023-03-10af_packet: fix the broken functionality upon admin downMohsin Kazmi2-41/+25
Type: fix In vpp, file descriptor handler closes the fd upon error if there is no error handling function is registered. This patch fixes the issue for af_packet interface by registering the error handling function. Errors will also be gracefully logged. Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I260d780ac54ffd0199dcd6ca5b95e5afe957e968
2023-03-09vcl: fix select connected deq notificationFlorin Coras1-6/+12
Also make sure that only sessions with fifos try to set deq notification flag on fifo Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I878c2d2e18bb98109ee03b42a4f0f8c48aa23e9f
2023-03-09vcl: fix epoll out evt on connectFlorin Coras1-1/+1
Make sure session has a tx fifo. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibde40645b401ca0255da298ea4ba691ee924a2d2
2023-03-08session: Use session->thread_index to correctly retrieve the sessionSteven Luong1-1/+3
For non-connected udp, when retrieving the subscriber session to send the notification, it uses the current worker thread index whereas the subscriber session is actually on the main thread. Using the worker thread may cause a crash since the corresponding session may not be valid in the worker thread context and even if it is valid, it is the wrong session. This scenario is seen when the application forks and adds subscribers to the worker thread session. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I236ee9d9ff9f3b2f7f9f8e782d70d1080aa1b627
2023-03-08quic: use tx instead of builtin_tx event with timersFlorin Coras1-3/+2
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic11069c912a5e59bb3ea0e0c6de6cfcc879c5f4e
2023-03-07avf: enable rss action of flowXinyao Cai4-152/+2925
This patch enables RSS action of avf flow. Type: feature Signed-off-by: Xinyao Cai <xinyao.cai@intel.com> Change-Id: I65de18d0c2eaa415893959563ea917a6b1956550
2023-03-07vlib: stop worker threads on main loop exitVladislav Grishenko1-1/+2
If not, worker threads may continue own loops after deinit and/or thread0 exit with related crashes due no rpc capability, unmapped shared memory, etc. Main loop exit handlers that uses barrier sync will be happy too as long as recursive barrier sync is supported. Type: feature Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru> Change-Id: I255a796b06936d96715683e3f062128060233dc6
2023-03-07avf: fix cli memory leak with incorrect optionsTianyu Li1-37/+19
Remove extra line_input and unformat_user. Type: fix Fixes: b4ff07a2f843 ("Intel Adaptive Virtual Function native device driver plugin") Signed-off-by: Tianyu Li <tianyu.li@arm.com> Change-Id: I9e502f3b254d0b1c7d8fd4b80925338a18da8269
2023-03-07udp: crash in format_udp_connectionSteven Luong1-1/+1
format_udp_connection takes 2 arguments from the caller. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ie618a809936a01c094982f9a8c81309826e0b087
2023-03-07build: check for presence of python plyDamjan Marion1-0/+16
Type: improvement Change-Id: I4f190607bfce404fbe68ec968e6923509ea9519b Signed-off-by: Damjan Marion <dmarion@me.com>
2023-03-07build: make Python3 mandatoryDamjan Marion1-23/+17
Type: refactor Change-Id: Iac27ac4d11745b68c57a0394ced51942db8f0431 Signed-off-by: Damjan Marion <dmarion@0xa5.net>
2023-03-06tcp: allow syns in closed stateFlorin Coras1-2/+3
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If223096cf912c1748ae417b40585a9bea5d9d9a9
2023-03-06vcl: do not stop listeners on vls epoll delFlorin Coras1-1/+7
Although removal from epoll means listener no longer accepts new sessions, the accept queue built by vpp cannot be drained by stopping the listener. Morover, some applications, e.g., nginx, might constantly remove and add listeners to their epfds. Removing listeners in such situations causes a lot of churn in vpp as segments and segment managers need to be recreated. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ia412b3f8d50fbb4881a99ff024f798353b521af7
2023-03-06vcl: always drain libc epoll with eventfds in ldpFlorin Coras1-17/+36
Otherwise if vcl epoll lt events are ignored by the app, libc and vcl mq events are never drained. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1e22f6da46d56236c52714181f6c20dcb80a33a5
2023-03-06vlib: fix vlib_log for elogluoyaozu1-8/+8
test output before fix: DBGvpp# event-logger clear DBGvpp# test log warn cli log test-log for-elog cli/log [warn ]: test-log for-elog DBGvpp# test log info cli log test-log for-elog cli/log [info ]: test-log for-elog DBGvpp# show event-logger 2 of 131072 events in buffer, logger running 53.022586433: log-notice: test-log for-elog 60.318329361: log-debug: test-log for-elog DBGvpp# test output after fix: DBGvpp# event-logger clear DBGvpp# test log warn cli log test-log for-elog cli/log [warn ]: test-log for-elog DBGvpp# test log info cli log test-log for-elog cli/log [info ]: test-log for-elog DBGvpp# show event-logger 2 of 131072 events in buffer, logger running 18.362721151: log-warn: test-log for-elog 25.124570555: log-info: test-log for-elog DBGvpp# Type: fix Signed-off-by: luoyaozu <luoyaozu@foxmail.com> Change-Id: Ie1122787f9efb611cdafc671b4ccf68b43984924
2023-03-06lb: keep AddressSanitizer happyBenoît Ganne2-3/+2
vec_alloc() does not mark vector as accessible contrary to vec_validate(). Also removes redundant memset(0) as vector allocation always zeroed new memory. Type: fix Change-Id: I8309831b964a618454ed0bebbcdec7ec21149414 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-03-06vppinfra: fix memory tracesBenoît Ganne1-49/+82
- allocates the memory trace spinlock independently from the main heap - disable tracing on a per thread basis - make sure we hold the memory trace spinlock when changing tracing Type: fix Change-Id: I7d84f22132abdc895343d447cd3a2c574786f58d Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-03-06af_packet: fix the first packet offsetMohsin Kazmi1-1/+1
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I927ba4e6f10ae4527f339a890c3a0de33a84b7eb
2023-03-06af_xdp: fix netns configurationBenoît Ganne1-1/+2
- clib_open_netns() expects a NULL-terminated C-string - if no netns was given, we should not try to format it otherwise we'll get "(nil)" as netns name. Type: fix Change-Id: I7b6022f6e8999640d0d2a83b854455b15fa4c134 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-03-06vlib: avoid non-mp-safe cli process node updatesVladislav Grishenko1-56/+34
Node renames, clone and node_by_name hash updates should be done in vlib_node_register() / vlib_node_rename() under barrier, or else runtime per-node stats can be either inaccurate or lead to UB. Drop cli process nodes renaming rather than adding barrier syncronization on reuse, nodes will get "unix-cli-process-ID" stable names, description and terminal names are preserved and can be obtained with "show cli-sessions" and "show terminal" commands. Also fix insufficient name width for "show cli-sessions" with table formatting, output sample: DBGvpp# sh cli-sessions PNI FD Name Flags 708 14 unix-cli-local:10558 iSLpa 710 15 unix-cli-127.0.0.1:33252 ISlpA DBGvpp# sh terminal Terminal name: unix-cli-127.0.0.1:33252 Terminal node: unix-cli-process-1 Terminal mode: char-by-char Terminal width: 158 Terminal height: 43 ANSI capable: yes Interactive: yes History enabled: yes History limit: 50 Pager enabled: yes Pager limit: 100000 CRLF mode: CR+LF Type: improvement Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru> Change-Id: I40af4c0a5e5be92d5e3ebcd440fa55390aeb0e8b
2023-03-06interface: more cleaning after set flags is failed in vnet_create_sw_interfacevarasteh1-0/+1
There's a chance that vnet_sw_interface_set_flags_helper() has successfully called some sw interface add callback functions before returning the error. So the sw interface del callbacks should also be called Type: fix Signed-off-by: varasteh <mahdy.varasteh@gmail.com> Change-Id: I2cd7dc6d5b3a5ebfd2c4d1a6be5390083dee6401 Signed-off-by: varasteh <mahdy.varasteh@gmail.com>
2023-03-06interface: add the missing tag keyword in the cli helperMohsin Kazmi1-1/+2
Type: style Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I6399ad2b0b30f94c6c51db1afc39f5e875dfaa67
2023-03-06crypto: remove VNET_CRYPTO_OP_FLAG_INIT_IV flagBenoît Ganne8-133/+9
IV requirements vary wildly with the selected mode of operation. For example, for AES-CBC the IV must be unpredictable whereas for AES counter mode (CTR or GCM), it can be predictable but reusing an IV with the same key material is catastrophic. Because of that, it is hard to generate IV in a generic way, and it is better left to the crypto user (eg. IPsec). Type: improvement Change-Id: I32689c591d8c6572b8d37c4d24f175ea6132d3ec Signed-off-by: Benoît Ganne <bganne@cisco.com>
2023-03-06memif: fix input vector rate of memif-input nodeLiangxing Wang1-1/+4
Explicitly set the ptd->n_packets to 0 if no packet is received in memif_device_input_inline(). Otherwise ptd->n_packets just keeps last time rx packets number, then this stale number is added to memif_input_node->vectors_since_last_overflow in every dispatch_node() call for memif_input_node. Type: fix Signed-off-by: Liangxing Wang <liangxing.wang@arm.com> Change-Id: Ide98a481c925262f9a609535a314f784cab424d8
2023-03-06vlib: fix macro define command not work in startup config exec scriptXiaoming Jiang1-81/+8
Type: fix Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com> Change-Id: Idb34490199a78d5b0c1fe2382b6483a6e3a6fd1f