Skip to content

Conversation

@JacobBarthelmeh
Copy link
Contributor

@JacobBarthelmeh JacobBarthelmeh commented Sep 2, 2025

This PR adds support for SHM (Shared Memory) POSIX DMA transport to wolfHSM, enabling pass-by-reference communication between client and server through shared memory segments with optimized memory allocation.

Implements DMA transport layer with static memory management for improved performance
Adds client/server configuration infrastructure for multiple transport types (TCP, SHM, DMA)
Enhances POSIX examples to support configurable transport types with command-line options

Copy link
Contributor

@billphipps billphipps left a comment

Choose a reason for hiding this comment

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

I like the refactoring to provide a single client/server example that has both transports included. We need to rework the config so there's a shared configuration header file that both the client and server apps can include. Need to split the wh_posix_*.c files into server and client versions (probably just move the contents back into their respective .c files). I'll chat with you about this.

@bigbrett
Copy link
Contributor

@JacobBarthelmeh OK if we mark this as draft until it is ready for final review and CI is passing?

@JacobBarthelmeh JacobBarthelmeh marked this pull request as draft September 10, 2025 17:51
@JacobBarthelmeh JacobBarthelmeh force-pushed the staticmemory branch 2 times, most recently from fa5a043 to 98a1c72 Compare September 12, 2025 15:42
Copy link
Contributor

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 adds support for SHM (Shared Memory) POSIX DMA transport to wolfHSM, enabling pass-by-reference communication between client and server through shared memory segments with optimized memory allocation.

  • Implements DMA transport layer with static memory management for improved performance
  • Adds client/server configuration infrastructure for multiple transport types (TCP, SHM, DMA)
  • Enhances POSIX examples to support configurable transport types with command-line options

Reviewed Changes

Copilot reviewed 34 out of 36 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
wolfhsm/wh_server.h Adds IsDmaTransport function declaration
wolfhsm/wh_client.h Adds DMA-related types, callbacks, and function declarations
src/wh_server.c Implements DMA transport detection and auto-configuration
src/wh_client_dma.c New file implementing DMA address processing and validation
src/wh_client_crypto.c Updates SHA256 DMA function with proper address translation
src/wh_client.c Adds DMA transport detection and auto-configuration
port/posix/posix_transport_dma.h New header defining DMA transport interface
port/posix/posix_transport_dma.c New implementation of DMA transport with static memory
examples/posix/ Updated POSIX examples with multi-transport support and configuration
benchmark/ Enhanced benchmark suite with transport type selection

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@JacobBarthelmeh JacobBarthelmeh force-pushed the staticmemory branch 2 times, most recently from c7748aa to a2fd02b Compare September 12, 2025 20:01
@JacobBarthelmeh JacobBarthelmeh changed the title add SHM POSIX example add DMA by offset feature, SHM POSIX example, and support for args with benchmarking Sep 14, 2025
Copy link
Contributor

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

Copilot reviewed 39 out of 41 changed files in this pull request and generated 8 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@JacobBarthelmeh JacobBarthelmeh marked this pull request as ready for review September 15, 2025 16:41
@JacobBarthelmeh
Copy link
Contributor Author

Run git-clang-format

@JacobBarthelmeh JacobBarthelmeh force-pushed the staticmemory branch 2 times, most recently from 708033a to 53a1f4b Compare September 15, 2025 20:05
Copy link
Contributor

@bigbrett bigbrett left a comment

Choose a reason for hiding this comment

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

@JacobBarthelmeh Great additions from a functionality standpoint!! I think from a layout/organization perspective there is still some work to be done. Here is a first round of review comments that I think should be addressed.

Copy link
Contributor

@billphipps billphipps left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you!

@billphipps billphipps merged commit 9e6a072 into wolfSSL:main Sep 26, 2025
10 checks passed
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.

4 participants