Closed
Conversation
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.
Contributor
There was a problem hiding this comment.
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_asyncdeclaration and callback type indto.h - Implemented async memcpy in
dto.c, extended enums, constants, and log output - Documented the new API in
README.mdand updated header install inMakefile
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 ofbashfor the C function signature to improve readability and syntax highlighting.
```bash
dto.h:11
- dto.h uses
size_tbut does not include<stddef.h>. Add#include <stddef.h>to definesize_t.
void dto_memcpy_async(void *dest, const void *src, size_t n, callback_t cb, void* args);
dto.c:1513
- The callback
cbis 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) {
| 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/ |
There was a problem hiding this comment.
[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/ |
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.
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.
where callback_t cb is a function pointer in the calling application and flags pass various options to DSA