monarch_rdma/backend/ibverbs/
efa_device.rs1use std::sync::Arc;
12
13use typeuri::Named;
14
15use super::device::IbvDeviceImpl;
16use super::efa_domain::EfaDomain;
17use super::primitives::IbvConfig;
18use super::primitives::IbvContext;
19use crate::register_ibv_device_impl;
20
21#[derive(Debug, Named)]
23pub struct EfaDevice;
24
25impl IbvDeviceImpl for EfaDevice {
26 type Domain = EfaDomain;
27
28 fn backend_name() -> &'static str {
29 "efa"
30 }
31
32 fn is_instance(ctx: Arc<IbvContext>) -> bool {
33 unsafe { rdmaxcel_sys::rdmaxcel_is_efa_dev(ctx.as_ptr()) != 0 }
36 }
37
38 fn apply_config_defaults(config: &mut IbvConfig) {
39 config.max_send_sge = 1;
40 config.max_recv_sge = 1;
41 config.max_dest_rd_atomic = 0;
42 config.max_rd_atomic = 0;
43 }
44}
45
46register_ibv_device_impl!(EfaDevice);