Add transport connection ID accessors#88
Conversation
Signed-off-by: Cliff Burdick <cburdick@nvidia.com>
|
| Filename | Overview |
|---|---|
| include/daqiri/types.h | Renames AdvNetRdmaBurstHdr to BurstTransportHeader and rdma_hdr union member to transport_hdr in BurstParams — a source-breaking rename of a public struct field that correctly generalizes the transport abstraction. |
| include/daqiri/common.h | Adds get_connection_id(const BurstParams*) and set_connection_id(BurstParams*, uintptr_t) to the public free-function API; signatures and doc-comments are correct. |
| src/common.cpp | Implements both new accessors with null-pointer asserts consistent with existing helpers; straightforward and correct. |
| src/managers/rdma/daqiri_rdma_mgr.cpp | Migrates all rdma_hdr field accesses to transport_hdr; uses the new get/set_connection_id accessors for conn_id while still accessing other fields directly — mechanical and thorough. |
| src/managers/socket/daqiri_socket_mgr.cpp | Replaces two direct rdma_hdr.conn_id reads/writes with the new accessor calls; clean migration. |
| python/daqiri_common_pybind.cpp | Migrates rdma_conn_id to connection_id using the new accessors, but leaves rdma_wr_id with an RDMA-specific name and direct struct access — inconsistent with the accessor pattern introduced by this PR. |
| examples/socket_bench.cpp | Replaces direct rdma_hdr.conn_id assignment with set_connection_id — correct use of the new API. |
| docs/api-guide.md | Adds a short usage example for set_connection_id/get_connection_id; accurate but AGENTS.md and tutorial docs are not updated in this PR. |
| docs/daqiri-api.html | Adds a sidebar entry and method card for the new connection-ID functions; HTML is well-formed and consistent with existing entries. |
Sequence Diagram
sequenceDiagram
participant App as Application
participant API as common.h / common.cpp
participant Burst as BurstParams.transport_hdr
participant RDMA as RdmaMgr
participant Sock as SocketMgr
App->>API: set_connection_id(burst, conn_id)
API->>Burst: "transport_hdr.conn_id = conn_id"
App->>API: send_tx_burst(burst)
API->>RDMA: send_tx_burst(burst)
RDMA->>API: get_connection_id(burst)
API->>Burst: return transport_hdr.conn_id
RDMA->>RDMA: tx_rings_map_.find(conn_id)
App->>API: send_tx_burst(burst)
API->>Sock: send_tx_burst(burst)
Sock->>API: get_connection_id(burst)
API->>Burst: return transport_hdr.conn_id
Sock->>Sock: connections_.find(conn_id)
Sock->>Burst: set_connection_id(burst, conn_id)
App->>API: get_connection_id(rx_burst)
API-->>App: conn_id of peer that sent this burst
Comments Outside Diff (1)
-
docs/api-guide.md, line 1 (link)Doc-sync: AGENTS.md and several other docs not updated
This PR touches
include/daqiri/common.h(new public functions),include/daqiri/types.h(struct rename),src/managers/rdma/,src/managers/socket/, andexamples/socket_bench.cpp— all paths that require additional doc updates per.claude/rules/docs-sync.md.docs/api-guide.mdanddocs/daqiri-api.htmlwere updated, but the following are still missing:AGENTS.md— required by every changed source path (newget_connection_id/set_connection_idAPI surface,BurstTransportHeaderrename)docs/tutorials/benchmarking_examples.mdanddocs/tutorials/configuration-walkthrough.md— required byexamples/socket_bench.cppdocs/getting-started.md,docs/configuration.md, andREADME.md(Backends section) — required bysrc/managers/rdma/andsrc/managers/socket/
Rule Used: DAQIRI has no automated doc-sync gate beyond mkdoc... (source)
Reviews (1): Last reviewed commit: "#0 - Add transport connection ID accesso..." | Re-trigger Greptile
| */ | ||
| int64_t get_q_id(BurstParams *burst); | ||
|
|
||
| /** | ||
| * @brief Get the transport connection ID associated with a burst | ||
| * | ||
| * @param burst Burst structure with transport metadata | ||
| */ | ||
| uintptr_t get_connection_id(const BurstParams *burst); | ||
|
|
||
| /** | ||
| * @brief Set the transport connection ID associated with a burst | ||
| * | ||
| * @param burst Burst structure with transport metadata | ||
| * @param conn_id Connection ID representing a unique client/server connection | ||
| */ | ||
| void set_connection_id(BurstParams *burst, uintptr_t conn_id); | ||
|
|
There was a problem hiding this comment.
The commit title is #0 - Add transport connection ID accessors. GitHub issue numbers start at #1; #0 does not correspond to a real issue. Per CONTRIBUTING.md, an approved issue must exist before coding starts. Please link to the actual tracking issue and update the commit title accordingly (or amend if needed).
Rule Used: Commit titles must use imperative mood and be pref... (source)
| .def_property( | ||
| "rdma_wr_id", | ||
| [](const BurstParams &burst) { return burst.rdma_hdr.wr_id; }, | ||
| [](const BurstParams &burst) { return burst.transport_hdr.wr_id; }, | ||
| [](BurstParams &burst, uint64_t wr_id) { | ||
| burst.rdma_hdr.wr_id = wr_id; | ||
| burst.transport_hdr.wr_id = wr_id; | ||
| }); |
There was a problem hiding this comment.
rdma_wr_id Python property still uses an RDMA-specific name and bypasses the new accessor pattern
conn_id was correctly genericized to connection_id via the new get_connection_id/set_connection_id accessors, but wr_id still carries the rdma_ prefix in the Python API and directly accesses transport_hdr.wr_id. This leaves the Python binding half-migrated: consumers see connection_id (generic) next to rdma_wr_id (RDMA-specific), and wr_id is the only BurstTransportHeader field still accessed directly from binding code.
| .def_property( | |
| "rdma_wr_id", | |
| [](const BurstParams &burst) { return burst.rdma_hdr.wr_id; }, | |
| [](const BurstParams &burst) { return burst.transport_hdr.wr_id; }, | |
| [](BurstParams &burst, uint64_t wr_id) { | |
| burst.rdma_hdr.wr_id = wr_id; | |
| burst.transport_hdr.wr_id = wr_id; | |
| }); | |
| .def_property( | |
| "wr_id", | |
| [](const BurstParams &burst) { return burst.transport_hdr.wr_id; }, | |
| [](BurstParams &burst, uint64_t wr_id) { | |
| burst.transport_hdr.wr_id = wr_id; | |
| }); |
No description provided.