Skip to content

Conversation

@gcabiddu
Copy link
Contributor

@gcabiddu gcabiddu commented May 7, 2025

Add an initial implementation of the acomp-dpusm provider.

This requires the following components:

Add initial version of gitignore file.

Signed-off-by: Giovanni Cabiddu <[email protected]>
@gcabiddu gcabiddu requested review from Copilot and jdschuet May 7, 2025 16:16

This comment was marked as resolved.

@gcabiddu
Copy link
Contributor Author

gcabiddu commented May 7, 2025

Adding @calccrypto to the review.

@gcabiddu gcabiddu requested a review from Copilot May 7, 2025 16:53

This comment was marked as resolved.

@gcabiddu gcabiddu requested a review from Copilot May 7, 2025 19:00

This comment was marked as resolved.

Copy link

Copilot AI left a 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;

/*
Copy link

Copilot AI May 7, 2025

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.

Copilot uses AI. Check for mistakes.
Add initial implementation of acomp-dpusm plug-in.

Signed-off-by: Giovanni Cabiddu <[email protected]>
Copy link

Copilot AI left a 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.c as the DPUSM provider interface for ZFS ACOMP
  • Add compress.c/compress.h implementing zlib-deflate operations via the Crypto API
  • Provide README.md and INSTALL.md for 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);
Copy link

Copilot AI May 13, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines +171 to +178
if (ret)
return DPUSM_ERROR;

/*
* TODO: understand what to do in case of overflow. In such case, ret
* is equals to -EOVERFLOW
*/

Copy link

Copilot AI May 13, 2025

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.

Suggested change
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;
}

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +15
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);
Copy link

Copilot AI May 13, 2025

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.

Suggested change
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);

Copilot uses AI. Check for mistakes.

## Software Requirements

- Linux Kernel with support for the Crypto API's acomp interface and zlib-deflate (currently covering versions 6.3 to 6.6).
Copy link

Copilot AI May 13, 2025

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.

Suggested change
- 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).

Copilot uses AI. Check for mistakes.
INSTALL.md Outdated

## Runtime Configuration

Ensure the zpools are configired to use the provider and enable compression/decompression. The operations would look like:
Copy link

Copilot AI May 13, 2025

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.

Suggested change
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:

Copilot uses AI. Check for mistakes.
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:

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.)

Copy link
Contributor Author

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.

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.)

Copy link
Contributor Author

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants