Skip to main content

IxgbeDevice

Struct IxgbeDevice 

Source
pub struct IxgbeDevice<H: IxgbeHal, const QS: usize> { /* private fields */ }
Expand description

The main Intel 82599 device driver.

Implementations§

Source§

impl<H: IxgbeHal, const QS: usize> IxgbeDevice<H, QS>

Source

pub fn init( base: usize, len: usize, num_rx_queues: u16, num_tx_queues: u16, pool: &Arc<MemPool>, ) -> IxgbeResult<Self>

Initializes a new ixgbe device.

This function performs the complete device initialization sequence including:

  • Global reset
  • Link configuration (auto-negotiation)
  • RX/TX queue initialization
  • Promiscuous mode enable
§Arguments
  • base - Physical base address of the device’s MMIO region
  • len - Length of the MMIO region
  • num_rx_queues - Number of receive queues to initialize
  • num_tx_queues - Number of transmit queues to initialize
  • pool - Memory pool for packet buffer allocation
§Returns

An initialized device ready for packet I/O.

§Errors

Returns IxgbeError if:

  • DMA allocation fails
  • Queue size is invalid
  • Memory pool is exhausted
§Panics

Panics if num_rx_queues or num_tx_queues exceeds MAX_QUEUES.

Source

pub fn num_rx_queues(&self) -> u16

Returns the number of receive queues configured on this device.

Source

pub fn num_tx_queues(&self) -> u16

Returns the number of transmit queues configured on this device.

Trait Implementations§

Source§

impl<H: IxgbeHal, const QS: usize> NicDevice<H> for IxgbeDevice<H, QS>

Returns the link speed of this device.

Source§

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

Returns the mac address of this device.

Source§

fn reset_stats(&mut self)

Resets the stats of this device.

Source§

fn send(&mut self, queue_id: u16, tx_buf: IxgbeNetBuf) -> IxgbeResult

Sends a network buffer to the network. If currently queue is full, returns an error with type IxgbeError::QueueFull`.

Source§

fn can_receive(&self, queue_id: u16) -> IxgbeResult<bool>

Whether can receiver packet.

Source§

fn can_send(&self, queue_id: u16) -> IxgbeResult<bool>

Whether can send packet.

Source§

fn get_driver_name(&self) -> &str

Returns the driver’s name. Read more
Source§

fn recycle_tx_buffers(&mut self, queue_id: u16) -> IxgbeResult

Polls the transmit queue for completed packets and frees their buffers. Read more
Source§

fn receive_packets<F>( &mut self, queue_id: u16, packet_nums: usize, f: F, ) -> IxgbeResult<usize>
where F: FnMut(IxgbeNetBuf),

Receives up to packet_nums packets from the network. Read more
Source§

impl<H: IxgbeHal, const QS: usize> Send for IxgbeDevice<H, QS>

Source§

impl<H: IxgbeHal, const QS: usize> Sync for IxgbeDevice<H, QS>

Auto Trait Implementations§

§

impl<H, const QS: usize> Freeze for IxgbeDevice<H, QS>

§

impl<H, const QS: usize> !RefUnwindSafe for IxgbeDevice<H, QS>

§

impl<H, const QS: usize> Unpin for IxgbeDevice<H, QS>
where H: Unpin,

§

impl<H, const QS: usize> UnsafeUnpin for IxgbeDevice<H, QS>

§

impl<H, const QS: usize> !UnwindSafe for IxgbeDevice<H, QS>

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>,

Source§

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>,

Source§

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.