-
Notifications
You must be signed in to change notification settings - Fork 5
feat: provide vital things to make UD work #82
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @dragonJACson, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces an initial version of an Unreliable Datagram (UD) ping-pong example, along with the necessary API extensions in the sideway library to support UD queue pairs. The changes to the core library are well-structured, adding support for address handles and UD-specific send operations with proper error handling and resource management. The new ud_pingpong_split.rs example, however, could be improved. It currently relies heavily on unwrap(), expect(), and panic!() for error handling, which makes the code brittle. Switching to Result propagation would make the example more robust and a better showcase of idiomatic Rust. There are also a few other areas for improvement in the example, such as handling an ignored Result and simplifying a function with too many arguments.
| fn parse_single_work_completion( | ||
| &self, wc: &ExtendedWorkCompletion, ts_param: &mut TimeStamps, scnt: &mut u32, rcnt: &mut u32, | ||
| outstanding_send: &mut bool, rout: &mut u32, rx_depth: u32, need_post_recv: &mut bool, to_post_recv: &mut u32, | ||
| use_ts: bool, | ||
| ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function parse_single_work_completion has a large number of arguments (11), which harms readability and maintainability. This is why clippy::too_many_arguments is disabled for this file. Consider grouping related arguments into a state-holding struct. For instance, counters (scnt, rcnt, rout), flags (outstanding_send, need_post_recv), and post-receive parameters (to_post_recv) could be encapsulated within a PingPongState struct passed by mutable reference. This would simplify the function signature and improve code organization.
|
I provide an initial support for UD QP in this commit, while a lot of interface design left to be discussed.
|
7780437 to
5fd86de
Compare
- Surface port LIDs from `PortAttr`.
- Add `ProtectionDomain::create_ah` for creating address handle.
- Extend queue-pair attributes/guards with QKey accessors and new
`setup_ud_send{,_imm}` helpers, wiring them through basic, extended,
and generic post-send guards via `ibv_wr_set_ud_addr`
Signed-off-by: Luke Yue <lukedyue@gmail.com>
`ibv_qp_to_qp_ex` would dereference the result of `ibv_create_qp_ex`, a null pointer dereferencing would prevent `NonNull::new().ok_or()?` returning a `CreateQueuePairError`. Checking the pointer before passing it to `ibv_qp_to_qp_ex` to fix it. Signed-off-by: Luke Yue <lukedyue@gmail.com>
87c7460 to
397dac1
Compare
Signed-off-by: Luke Yue <lukedyue@gmail.com>
e8e4b54 to
20f0dc7
Compare
…uffers Add a smoltcp-style `GlobalRoutingHeader<T>` wrapper that provides zero-copy read/write access to Global Routing Header fields directly from byte buffers. - `new_unchecked` / `new_checked` constructors for buffer wrapping - Field accessors: version, traffic_class, flow_label, payload_length, next_header, hop_limit, source_gid, destination_gid - Mutable setters for all fields when buffer is writable - `as_ptr` / `as_mut_ptr` for FFI interop - `grh` for copying to owned `ibv_grh` struct Also add `--debug-grh` flag to ud_pingpong_split example to print received GRH on each iteration for debugging purposes. Signed-off-by: Luke Yue <lukedyue@gmail.com>
20f0dc7 to
51b8f00
Compare
AddressHandle,setup_ud_addr.ibv_create_qp_exreturnsNULL.This should close #64