Commit 87c7460
committed
feat(ibverbs): add GlobalRoutingHeader wrapper for parsing GRH from buffers
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>1 parent 4810ef0 commit 87c7460
2 files changed
Lines changed: 336 additions & 160 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
65 | 68 | | |
66 | 69 | | |
67 | 70 | | |
| |||
251 | 254 | | |
252 | 255 | | |
253 | 256 | | |
254 | | - | |
| 257 | + | |
255 | 258 | | |
256 | 259 | | |
257 | 260 | | |
| |||
270 | 273 | | |
271 | 274 | | |
272 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
273 | 303 | | |
274 | 304 | | |
275 | 305 | | |
| |||
439 | 469 | | |
440 | 470 | | |
441 | 471 | | |
| 472 | + | |
442 | 473 | | |
443 | 474 | | |
444 | 475 | | |
| |||
0 commit comments