Skip to content

DTO async user-level function API #17

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

byrnedj
Copy link
Contributor

@byrnedj byrnedj commented Jun 11, 2025

This commit adds support for the async DTO API. This public API allows the caller to pass an arbitrary function to execute while the DSA job is executing.

  • void dto_memcpy_async(void *dest, const void src, size_t n, callback_t cb, void args);

where callback_t cb is a function pointer in the calling application.

This commit adds support for the async DTO API. This public API allows the caller to pass an arbitrary function to execute while the DSA job is executing.

- void dto_memcpy_async(void *dest, const void *src, size_t n, callback_t cb, void* args);

where callback_t cb is a function pointer in the calling application.
@byrnedj byrnedj requested review from Copilot and jsydir June 11, 2025 20:08
Copy link

@Copilot 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 a non-blocking memcpy API that invokes a user-provided callback during DSA offload and updates docs and installation rules.

  • Introduced dto_memcpy_async declaration and callback type in dto.h
  • Implemented async memcpy in dto.c, extended enums, constants, and log output
  • Documented the new API in README.md and updated header install in Makefile

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
dto.h Declare new async memcpy API and callback type
dto.c Implement dto_memcpy_async, update enums/constants
README.md Document dto_memcpy_async usage
Makefile Install dto.h to system include directory
Comments suppressed due to low confidence (3)

README.md:39

  • [nitpick] Use a C code fence (```c) instead of bash for the C function signature to improve readability and syntax highlighting.
```bash

dto.h:11

  • dto.h uses size_t but does not include <stddef.h>. Add #include <stddef.h> to define size_t.
void dto_memcpy_async(void *dest, const void *src, size_t n, callback_t cb, void* args);

dto.c:1513

  • The callback cb is invoked unconditionally; add a null check (if (cb) cb(args);) to avoid dereferencing a null pointer.
__attribute__((visibility("default"))) void dto_memcpy_async(void *dest, const void *src, size_t n, callback_t cb, void* args) {

@@ -16,6 +16,7 @@ install:
cp libdto.so.1.0 /usr/lib64/
ln -sf /usr/lib64/libdto.so.1.0 /usr/lib64/libdto.so.1
ln -sf /usr/lib64/libdto.so.1.0 /usr/lib64/libdto.so
cp dto.h /usr/include/
Copy link
Preview

Copilot AI Jun 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Avoid hardcoding /usr/include; use $(PREFIX)/include or DESTDIR to respect custom install paths and cross-compilation scenarios.

Suggested change
cp dto.h /usr/include/
cp dto.h $(DESTDIR)$(PREFIX)/include/

Copilot uses AI. Check for mistakes.

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.

1 participant