Struct ibverbs::Device

source ·
pub struct Device<'devlist>(/* private fields */);
Expand description

An RDMA device.

Implementations§

source§

impl<'devlist> Device<'devlist>

source

pub fn open(&self) -> Result<Context>

Opens an RMDA device and creates a context for further use.

This context will later be used to query its resources or for creating resources.

Unlike what the verb name suggests, it doesn’t actually open the device. This device was opened by the kernel low-level driver and may be used by other user/kernel level code. This verb only opens a context to allow user level applications to use it.

§Errors
  • EINVAL: PORT_NUM is invalid (from ibv_query_port_attr).
  • ENOMEM: Out of memory (from ibv_query_port_attr).
  • EMFILE: Too many files are opened by this process (from ibv_query_gid).
  • Other: the device is not in ACTIVE or ARMED state.
source

pub fn name(&self) -> Option<&'devlist CStr>

Returns a string of the name, which is associated with this RDMA device.

This name is unique within a specific machine (the same name cannot be assigned to more than one device). However, this name isn’t unique across an InfiniBand fabric (this name can be found in different machines).

When there are more than one RDMA devices in a computer, changing the device location in the computer (i.e. in the PCI bus) may result a change in the names associated with the devices. In order to distinguish between the device, it is recommended using the device GUID, returned by Device::guid.

The name is composed from:

  • a prefix which describes the RDMA device vendor and model
    • cxgb3 - Chelsio Communications, T3 RDMA family
    • cxgb4 - Chelsio Communications, T4 RDMA family
    • ehca - IBM, eHCA family
    • ipathverbs - QLogic
    • mlx4 - Mellanox Technologies, ConnectX family
    • mthca - Mellanox Technologies, InfiniHost family
    • nes - Intel, Intel-NE family
  • an index that helps to differentiate between several devices from the same vendor and family in the same computer
source

pub fn guid(&self) -> Result<Guid>

Returns the Global Unique IDentifier (GUID) of this RDMA device.

This GUID, that was assigned to this device by its vendor during the manufacturing, is unique and can be used as an identifier to an RDMA device.

From the prefix of the RDMA device GUID, one can know who is the vendor of that device using the IEEE OUI.

§Errors
  • EMFILE: Too many files are opened by this process.
source

pub fn index(&self) -> Result<i32>

Returns stable IB device index as it is assigned by the kernel

§Errors
  • ENOTSUP: Stable index is not supported

Trait Implementations§

source§

impl<'d> From<&'d *mut ibv_device> for Device<'d>

source§

fn from(d: &'d *mut ibv_device) -> Self

Converts to this type from the input type.
source§

impl<'devlist> Send for Device<'devlist>

source§

impl<'devlist> Sync for Device<'devlist>

Auto Trait Implementations§

§

impl<'devlist> RefUnwindSafe for Device<'devlist>

§

impl<'devlist> Unpin for Device<'devlist>

§

impl<'devlist> UnwindSafe for Device<'devlist>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.