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>
impl<H: IxgbeHal, const QS: usize> IxgbeDevice<H, QS>
Sourcepub fn init(
base: usize,
len: usize,
num_rx_queues: u16,
num_tx_queues: u16,
pool: &Arc<MemPool>,
) -> IxgbeResult<Self>
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 regionlen- Length of the MMIO regionnum_rx_queues- Number of receive queues to initializenum_tx_queues- Number of transmit queues to initializepool- 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.
Sourcepub fn num_rx_queues(&self) -> u16
pub fn num_rx_queues(&self) -> u16
Returns the number of receive queues configured on this device.
Sourcepub fn num_tx_queues(&self) -> u16
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>
impl<H: IxgbeHal, const QS: usize> NicDevice<H> for IxgbeDevice<H, QS>
Source§fn get_link_speed(&self) -> u16
fn get_link_speed(&self) -> u16
Returns the link speed of this device.
Source§fn get_mac_addr(&self) -> [u8; 6]
fn get_mac_addr(&self) -> [u8; 6]
Returns the mac address of this device.
Source§fn reset_stats(&mut self)
fn reset_stats(&mut self)
Resets the stats of this device.
Source§fn send(&mut self, queue_id: u16, tx_buf: IxgbeNetBuf) -> IxgbeResult
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>
fn can_receive(&self, queue_id: u16) -> IxgbeResult<bool>
Whether can receiver packet.
Source§fn get_driver_name(&self) -> &str
fn get_driver_name(&self) -> &str
Returns the driver’s name. Read more
Source§fn recycle_tx_buffers(&mut self, queue_id: u16) -> IxgbeResult
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),
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 moreimpl<H: IxgbeHal, const QS: usize> Send for IxgbeDevice<H, QS>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more