sync master branch to develop branch - #769
Merged
Merged
Conversation
All LZ77 algorithms need to clear the literal length in the context to avoid coupling of literal data between data segments in the stream mode. Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
When tail data is being compress, if the buffer data is not cleared, a nospace or again status needs to be returned to notify the user to add output space. Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
The tail packet padding function depends on the driver. Therefore, this function is moved to the driver layer for implementation, so as to remove unnecessary processes at the algorithm layer. Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
When the output space is too large, the function is not affected. Therefore, the printf of displaying a large number of messages is deleted. Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
… device failure 1. Add max timeout control and adaptive backoff to prevent long usleep delays on device failure 2. Implement exponential backoff to reduce context switching overhead under high load. Signed-off-by: lizhi <lizhi206@huawei.com>
The key align size of hashjoin is changed now, make it match the hardware. Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
Some clean code to improve the readability of the wd_agg code. Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
Fix parameter validation during the coding process. Adopt constant-time programming techniques for handling sensitive data to enhance code resilience against attacks. Signed-off-by: Longfang Liu <liulongfang@huawei.com>
Add WD_DEFLATE branch in append_store_block() to output a 5-byte store block when stream compression receives an empty last packet Signed-off-by: ZongYu Wu <wuzongyu1@huawei.com>
In the HPRE module's big number comparison, the previous implementation used memcmp to compare big numbers of the same length. On little-endian platforms, this approach compares data starting from the Least Significant Bit (LSB), which can lead to incorrect results—such as a larger value in the lower bits being misinterpreted as greater overall, even if the higher bits are smaller. To address this, the comparison logic must be modified to consistently start from the Most Significant Bit (MSB). Signed-off-by: Longfang Liu <liulongfang@huawei.com>
The HPRE driver must store and process data in big-endian (MSB) format as specified by the chip design. Therefore, the comparison logic for this data should also be described and implemented following the big-endian convention. Signed-off-by: Longfang Liu <liulongfang@huawei.com>
The 'ret' value is assigned in the case of 'req->op_type == WD_RSA_GENKEY'. When 'op_type' is not 'WD_RSA_GENKEY', 'ret' is not initialized. If 'ret' is directly returned, the caller may incorrectly determine that the operation fails. Therefore, 'WD_SUCCESS' instead of 'ret' is directly returned. Signed-off-by: Weili Qian <qianweili@huawei.com>
The internal asynchronous polling interface is not used in any scenario, remove it. Signed-off-by: Weili Qian <qianweili@huawei.com>
When wd_get_alg_type() fails, the memory allocated by strdup() is not freed. fix it. Signed-off-by: Weili Qian <qianweili@huawei.com>
strdup () may fail to allocate memory. Therefore, the return value needs to be checked, fix it. Signed-off-by: Weili Qian <qianweili@huawei.com>
The header file <sys/poll.h> is deprecated in modern Linux systems(e.g., glibc). Current builds may trigger a compilation warning when -Werror is enabled: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> Therefore, use poll.h instead of sys/poll.h. Signed-off-by: Weili Qian <qianweili@huawei.com>
In the UADK no-SVA mode memory pool, queues are used to create memory pools, and algorithms are employed to find the required queues. However, a compression algorithm queue cannot simultaneously support both compression and decompression modes—a queue must be defined as either compression or decompression. Therefore, when allocating a memory pool, a queue of the corresponding type must be specified for use. To facilitate queue lookup for the memory pool, the algorithm name is distinguished by appending a "-comp" or "-decomp" suffix. Similarly, when users request a memory pool, the compression algorithm must also include the corresponding suffix for querying. Signed-off-by: Longfang Liu <liulongfang@huawei.com>
In the ZIP algorithm compression testing tool, when using no-SVA mode, the creation of the memory pool requires the use of different device queues based on compression and decompression operations. We address this distinction through a convention of appending suffixes. Therefore, when querying queues, suffixes need to be added for processing. Signed-off-by: Longfang Liu <liulongfang@huawei.com>
Multiplying two u32 values and assigning the result to a left-hand u64 value carries a risk of overflow, so the right-hand value needs to be explicitly cast to u64. Signed-off-by: Zhushuai Yin <yinzhushuai@huawei.com>
Since sess in cleanup_session() cannot be null, the check on sess can be removed. Signed-off-by: Weili Qian <qianweili@huawei.com>
Include missing header file: v1/wd_ecc.h v1/wd_comp.h. Remove internal header file v1/uacce.h. Signed-off-by: Qi Tao <taoqi10@huawei.com> Signed-off-by: Weili Qian <qianweili@huawei.com>
The -lpthread flags should be placed in LIBADD instead of LDFLAGS to follow libtool conventions. And add -lm for libwd_dae_la_LIBADD. Signed-off-by: Weili Qian <qianweili@huawei.com>
The log frequency limit function iuses the alarm function. If users use the alarm function, the log frequency limiting function may be affected. Therefore, the log frequency limiting function is changed to timer_settime. Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
Release v2.11 in 2026.06 Signed-off-by: Liulongfang <liulongfang@huawei.com>
Change error logging to debug level to reduce excessive error messages in Docker environment. Now includes errno and ret values for better debugging. Signed-off-by: lizhi <lizhi206@huawei.com>
When the packet length of the CCM algorithm exceeds 16 bits, the software and hardware comparison fails because the driver does not adapt to the scenario where the packet length exceeds 16 bits. Therefore, the algorithm needs to be modified. Signed-off-by: Zhushuai Yin <yinzhushuai@huawei.com>
When the packet length of the CCM algorithm exceeds 16 bits, the software and hardware comparison fails because the driver does not adapt to the scenario where the packet length exceeds 16 bits. Therefore, the algorithm needs to be modified. Signed-off-by: Zhushuai Yin <yinzhushuai@huawei.com>
|
lgtm |
1 similar comment
|
lgtm |
Conduct a comprehensive update of the scheduler's internal triple-array-based pooling scheme. Adopt new data organization methods such as hash buckets and segment linked lists to achieve efficient insertion and query operations. Implement pre-fetch queue processing for business thread sessions, creating thread-level sub-queue pools for fast packet reception queries. Provide new scheduling algorithms for the new UADK framework. Signed-off-by: Longfang Liu <liulongfang@huawei.com> Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
In the new UADK framework, update the dynamic registration management for user-space driver algorithm-driver pairs. After decoupling the framework and driver layers, ensure service scheduling, resource initialization, and the integrity of packet send/receive functionality, while maintaining the normal operation of existing features. Signed-off-by: Longfang Liu <liulongfang@huawei.com>
In the updated UADK framework, the management functions for hardware queue allocation and release have been decoupled from the framework layer to the user-space driver layer. However, for existing uacce hardware queues and pure software computation queues, we have created a set of common allocation and release interfaces, thereby reducing redundancy in the driver layer code and improving the reusability of the framework code. Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Longfang Liu <liulongfang@huawei.com> Signed-off-by: Zhushuai Yin <yinzhushuai@huawei.com>
This represents the core modification of the new framework. It implements unified abstract processing for all device queues across the entire UADK, and unifies the channel for service requests from UADK to user devices into queues. These queues simultaneously support hardware device queues, software computation queues, and instruction queues, thereby achieving unified queue management. Additionally, the binding relationship between the algorithm layer and the driver has been decoupled, allowing a single algorithm layer to map and utilize multiple types of devices simultaneously for algorithm acceleration, thus enabling heterogeneous fusion accelerated computing. Signed-off-by: Longfang Liu <liulongfang@huawei.com> Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: lizhi <lizhi206@huawei.com> Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com> Signed-off-by: Zhushuai Yin <yinzhushuai@huawei.com>
This modification primarily aims to enable the UADK Cipher algorithm to support the new heterogeneous scheduling framework, while the corresponding user-space driver must also be adapted accordingly. Signed-off-by: Zhushuai Yin <yinzhushuai@huawei.com> Signed-off-by: Longfang Liu <liulongfang@huawei.com> Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
This modification enables the UADK AEAD algorithm to support the new heterogeneous scheduling framework by adapting the corresponding user-space driver to the new wd_alg_driver registration framework. Specifically, wd_aead.c is updated to replace the old binding model with wd_get_drv_array/wd_ctx_bind_drivers, and the wd_aead_sess priv field is changed from void* to void** to accommodate per-context private data. Signed-off-by: Zhushuai Yin <yinzhushuai@huawei.com> Signed-off-by: Longfang Liu <liulongfang@huawei.com> Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
In the updated UADK framework, for asymmetric encryption algorithms such as RSA, DH, and ECC, the API layer needs to be adapted to the new UADK heterogeneous hybrid acceleration framework to ensure these algorithms can achieve heterogeneous hybrid acceleration. Signed-off-by: lizhi <lizhi206@huawei.com> Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
For compression algorithms in the updated UADK framework, the API layer needs to be adapted to the new UADK heterogeneous hybrid acceleration framework, thereby ensuring that both compression and decompression algorithms can achieve heterogeneous hybrid acceleration. Signed-off-by: Zongyu Wu <wuzongyu1@huawei.com> Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
For the newly added UDMA algorithm type, the API layer needs to be adapted to the new UADK heterogeneous hybrid acceleration framework, thereby ensuring that the data movement functionality can achieve hybrid acceleration combining hardware acceleration and instruction acceleration capabilities. Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
For big data acceleration algorithms, the API layer needs to be adapted to the new UADK heterogeneous hybrid acceleration framework, thereby ensuring that big data acceleration functionality can be adapted to and support the new hybrid acceleration framework. Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com> Signed-off-by: Zhushuai Yin <yinzhushuai@huawei.com>
For data digest algorithms, the API layer needs to be adapted to the new UADK heterogeneous hybrid acceleration framework, thereby ensuring that hash algorithms and authentication algorithm acceleration functions can adapt to and support the new hybrid acceleration framework, while supporting the fusion of hardware acceleration, instruction acceleration, and vector acceleration capabilities. Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com> Signed-off-by: Zhushuai Yin <yinzhushuai@huawei.com>
Convert GB2312 A3AC bytes to the UTF-8 mojibake form (C2 A3 C2 AC) so that subsequent patches in this series apply cleanly. The bytes render as the '£¬' mojibake — they will be corrected to ',' by the next patch. Signed-off-by: iamhchchch <510725557@qq.com>
…nfig2 Align with the master branch structure where the dead 'if (ret)' check between two wd_comp_init2_ calls is removed (it can never be true on the first call's success path). This makes the file structure consistent so subsequent patches apply cleanly on develop. Signed-off-by: iamhchchch <510725557@qq.com>
With the UADK framework updated to support heterogeneous hybrid acceleration functionality, the corresponding uadk_tool test framework also needs to be adapted and updated. It must simultaneously support both the legacy init interface and the new init2 interface, match new scheduling algorithm types, and add new DAE test functionality. Signed-off-by: Zhushuai Yin <yinzhushuai@huawei.com> Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com> Signed-off-by: Longfang Liu <liulongfang@huawei.com> Signed-off-by: lizhi <lizhi206@huawei.com> Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
The ZIP hardware design is compatible with the old BD, eliminating the need for uadk adaptation. Therefore, the special processing for v5 has been removed. In stateful decompression, the hardware reports its context state in ctx_core_status (the low 9 bits of dw30/isize). When ctx_core_status is non-zero while neither input is consumed nor output produced, the hardware needs the request to be resent. Return WD_EAGAIN to the user so that the request can be retried. Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
Strengthen the initialization logic in wd_alg_init2_ by adding WD_INIT2_MAX_RETRY (32) retry limit across all 10 algorithm modules (aead, agg, cipher, comp, dh, digest, ecc, join_gather, rsa, udma) to prevent infinite retry loops when no device is available. Signed-off-by: Longfang Liu <liulongfang@huawei.com>
Add --enable-debug configure option in configure.ac and Makefile.am. When enabled, build with -g -O0 -fno-omit-frame-pointer -DDEBUG to preserve symbols and disable optimization for full stack traces during debugging. Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
Drop redundant priv sentinel field from all algorithm modules (aead, cipher, comp, dh, digest, ecc, rsa) and replace with wd_alg_get_init() status guard. Clear comp drv_count on uninit to prevent use-after-free. Fix build errors Signed-off-by: Weili Qian <qianweili@huawei.com>
Use unsigned char in less_than_latter() so byte comparison treats values as unsigned, fixing ECC private-key range checks on platforms where plain char is signed. Define HWCAP_CE_SM3/HWCAP_CE_SM4/HWCAP_SVE as 0 on non-ARM architectures so wd_alg.c compiles with -Werror=undef. Signed-off-by: Junchong Pan <panjunchong@h-partners.com> Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
digest_init1() and aead_init1() in uadk_tool/test/test_sec.c declared "struct wd_sched sched;" on the stack without initialization, leaving sched_policy and callback fields as garbage. This bypassed the SCHED_POLICY_NONE/SINGLE rejection in wd_digest_init/wd_aead_init and led to a segfault on the first wd_do_digest_sync/async call. Zero-initialize the struct so sched_policy defaults to SCHED_POLICY_RR and all callbacks/handles are NULL. Signed-off-by: Weili Qian <qianweili@huawei.com>
Collaborator
|
looks good to me |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sync master branch to develop branch