Struct mlx5::ConnectX5Nic

source ·
pub struct ConnectX5Nic { /* private fields */ }
Expand description

Struct representing a ConnectX-5 network interface card.

Implementations§

source§

impl ConnectX5Nic

Functions that setup the NIC struct and transmit packets.

source

pub fn init( mlx5_pci_dev: &PciDevice, num_tx_descs: usize, num_rx_descs: usize, mtu: u16 ) -> Result<&'static IrqSafeMutex<ConnectX5Nic>, &'static str>

Initializes the new ConnectX-5 network interface card that is connected as the given PciDevice. (steps taken from the PRM, Section 7.2: HCA Driver Start-up)

Arguments
  • mlx5_pci_dev: Contains the pci device information for this NIC.
  • num_tx_descs: The number of descriptors in each transmit queue.
  • num_rx_descs: The number of descriptors in each receive queue.
  • mtu: Maximum Transmission Unit in bytes
source

pub fn mac_address(&self) -> [u8; 6]

Returns the MAC address of the physical function

source

pub fn send(&mut self, buffer: TransmitBuffer) -> Result<(), &'static str>

Adds a packet to be sent to the transmit queue and returns once it is sent.

source

pub fn send_fastpath(&mut self, buffer_addr: PhysicalAddress, buffer: &[u8])

Adds a packet to be sent to the transmit queue.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.