Skip to content

Conversation

@dragonJACson
Copy link
Contributor

  1. Define custom Error type for getting device list and open device.
  2. Provide the ability to access Device from DeviceList using index.
  3. Define a trait for accessing DeviceInfo, implement it for both Device and DeviceContext.
  4. More unit-tests.


/// Trait for common device information access
pub trait DeviceInfo {
/// Returns the name of the device, for example, `mlx5_0`
Copy link
Contributor Author

@dragonJACson dragonJACson Feb 21, 2025

Choose a reason for hiding this comment

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

@FujiZ Do you think return an empty String when device name is NULL would be a better solution? I think it would make life easier.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure. Theoretically NULL is different from a NULL-ternimated empty string, but the users usually do not care about the difference.

@dragonJACson dragonJACson force-pushed the dev/refine-device branch 4 times, most recently from aff5c05 to 74ba624 Compare February 21, 2025 15:42
@codecov
Copy link

codecov bot commented Feb 21, 2025

Codecov Report

Attention: Patch coverage is 94.64286% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ibverbs/device.rs 92.50% 3 Missing ⚠️
Files with missing lines Coverage Δ
src/ibverbs/device_context.rs 87.05% <100.00%> (+0.47%) ⬆️
src/ibverbs/queue_pair.rs 76.89% <ø> (+1.22%) ⬆️
src/ibverbs/device.rs 87.50% <92.50%> (+10.22%) ⬆️

1. Define custom Error type for getting device list and open device.
2. Provide the ability to access Device from DeviceList using index.
3. Define a trait for accessing DeviceInfo, implement it for both
   Device and DeviceContext.
4. More unit-tests.

Signed-off-by: Luke Yue <lukedyue@gmail.com>
Signed-off-by: Luke Yue <lukedyue@gmail.com>
@dragonJACson dragonJACson changed the title feat(ibverbs): improve Device and DeviceList implementation feat(ibverbs): improve Device and DeviceList implementation Feb 22, 2025
@dragonJACson dragonJACson merged commit a2fb4c7 into main Feb 23, 2025
5 checks passed
@dragonJACson dragonJACson deleted the dev/refine-device branch February 23, 2025 13:37
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.

3 participants