-
Notifications
You must be signed in to change notification settings - Fork 2
Initial implementation of acomp-dpusm provider #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add initial version of gitignore file. Signed-off-by: Giovanni Cabiddu <[email protected]>
|
Adding @calccrypto to the review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces the initial implementation of the acomp-dpusm provider to integrate DPUSM with acomp (zlib-deflate) support. Key changes include:
- Adding provider.c with memory management, compress/decompress wrappers, and provider registration.
- Creating compress.h and compress.c to define and implement the acomp compression/decompression interface with scatterlist support.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| provider.c | Implements the provider functions, including buffer handling and registration routines. |
| compress.h | Declares the interface for acomp compression and decompression functions. |
| compress.c | Provides the implementation for accom compression/decompression using crypto and scatterlists. |
Files not reviewed (1)
- Makefile: Language not supported
Comments suppressed due to low confidence (1)
provider.c:19
- [nitpick] The prefix 'ZQH' used in the enum values is not immediately descriptive; consider adding a clarifying comment or using more intuitive names to improve code readability.
enum handle_type { ZQH_REAL, ZQH_REF, };
| if (ret) | ||
| return DPUSM_ERROR; | ||
|
|
||
| /* |
Copilot
AI
May 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify and handle the overflow case properly in acomp_compress rather than returning a generic error; consider implementing logic to handle -EOVERFLOW to ensure data integrity.
Add initial implementation of acomp-dpusm plug-in. Signed-off-by: Giovanni Cabiddu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds the initial implementation of the ACOMP DPUSM provider, including kernel integration, compression logic, and documentation.
- Introduce
provider.cas the DPUSM provider interface for ZFS ACOMP - Add
compress.c/compress.himplementing zlib-deflate operations via the Crypto API - Provide
README.mdandINSTALL.mdfor usage and installation instructions
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| provider.c | Implements DPUSM provider functions and lifecycle |
| compress.h | Declares acomp API for compression/decompression |
| compress.c | Implements scatterlist-based zlib-deflate operations |
| README.md | Project overview, requirements, and limitations |
| INSTALL.md | Step-by-step installation and configuration guide |
Files not reviewed (1)
- Makefile: Language not supported
Comments suppressed due to low confidence (1)
provider.c:152
- [nitpick] Consider adding unit or integration tests to validate compression/decompression behavior, including overflow and error paths.
static int zfs_acomp_compress(dpusm_compress_t alg, int level, void *src,
| return NULL; | ||
|
|
||
| ref->type = ZQH_REF; | ||
| ref->ptr = ptr_start(src, offset); |
Copilot
AI
May 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing boundary check: ensure that offset + size does not exceed the source buffer size before creating a reference handle.
| if (ret) | ||
| return DPUSM_ERROR; | ||
|
|
||
| /* | ||
| * TODO: understand what to do in case of overflow. In such case, ret | ||
| * is equals to -EOVERFLOW | ||
| */ | ||
|
|
Copilot
AI
May 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unaddressed overflow case: handle the scenario where acomp_compress returns -EOVERFLOW to avoid silent failures or data corruption.
| if (ret) | |
| return DPUSM_ERROR; | |
| /* | |
| * TODO: understand what to do in case of overflow. In such case, ret | |
| * is equals to -EOVERFLOW | |
| */ | |
| if (ret == -EOVERFLOW) { | |
| /* | |
| * Handle the overflow case by returning a specific error code. | |
| * This allows the caller to take appropriate action. | |
| */ | |
| return DPUSM_OVERFLOW; | |
| } else if (ret) { | |
| return DPUSM_ERROR; | |
| } |
| int acomp_compress(void *src, int src_len, void *dst, int dst_len, size_t *c_len); | ||
| int acomp_decompress(void *src, int src_len, void *dst, int dst_len, size_t *c_len); |
Copilot
AI
May 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API signature uses int for buffer lengths, which may truncate large size_t values; consider switching src_len and dst_len to size_t.
| int acomp_compress(void *src, int src_len, void *dst, int dst_len, size_t *c_len); | |
| int acomp_decompress(void *src, int src_len, void *dst, int dst_len, size_t *c_len); | |
| int acomp_compress(void *src, size_t src_len, void *dst, size_t dst_len, size_t *c_len); | |
| int acomp_decompress(void *src, size_t src_len, void *dst, size_t dst_len, size_t *c_len); |
|
|
||
| ## Software Requirements | ||
|
|
||
| - Linux Kernel with support for the Crypto API's acomp interface and zlib-deflate (currently covering versions 6.3 to 6.6). |
Copilot
AI
May 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation lists kernel versions 6.3–6.6, but the PR description specifies 6.4–6.6; update the version range for consistency.
| - Linux Kernel with support for the Crypto API's acomp interface and zlib-deflate (currently covering versions 6.3 to 6.6). | |
| - Linux Kernel with support for the Crypto API's acomp interface and zlib-deflate (currently covering versions 6.4 to 6.6). |
INSTALL.md
Outdated
|
|
||
| ## Runtime Configuration | ||
|
|
||
| Ensure the zpools are configired to use the provider and enable compression/decompression. The operations would look like: |
Copilot
AI
May 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configired is misspelled; should be configured.
| Ensure the zpools are configired to use the provider and enable compression/decompression. The operations would look like: | |
| Ensure the zpools are configured to use the provider and enable compression/decompression. The operations would look like: |
INSTALL.md
Outdated
|
|
||
| ### Obtain ZFS with ZIA | ||
|
|
||
| To use ZFS with ZFS Integrated Acceleration (ZIA), you need to obtain the specific pull request (PR) that includes ZIA support. Follow these steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ZFS Interface for Accelerators (Z.I.A.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @calccrypto - resolved.
README.md
Outdated
|
|
||
| ## Introduction | ||
|
|
||
| The Acompress Provider is a plugin designed to integrate with DPUSM (Data Processing Unit Storage Management) and ZFS, utilizing the Z.I.A (ZFS Integrated Acceleration) framework. It enhances data compression capabilities within ZFS environments by leveraging the Crypto API's acomp interface for efficient data processing and storage management. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ZFS Interface for Accelerators (Z.I.A.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @calccrypto - resolved.
Add intial contents for README and INSTALL documents. Signed-off-by: Joel Schuetze <[email protected]>
Add an initial implementation of the acomp-dpusm provider.
This requires the following components: