Crate mlx_ethernet
source ·Expand description
This crate defines the layout of memory objects that make up the software interface between the Mellanox hardware and the driver, as well as functions to access different fields of these objects.
The Mellanox ethernet card is referred to as both the NIC (Network Interface Card) and the HCA (Host Channel Adapter).
All information is taken from the Mellanox Adapters Programmer’s Reference Manual (PRM) [Rev 0.54], unless otherwise specified. While this version of the manual was acquired by directly contacting Nvidia through their support site (https://support.mellanox.com/s/), an older version of the manual can be found at http://www.mellanox.com/related-docs/user_manuals/Ethernet_Adapters_Programming_Manual.pdf.
Modules
- Defines the Command Queue that is used to pass commands from the driver to the NIC. Also defines multiple enums that specify the valid input and output values for different commands.
- Completion Queues (CQ) are circular buffers used by the HCA to post completion reports upon completion of a work request. This module defines the layout of an CQ, the context used to initialize an CQ and related functions.
- Event Queues (EQ) are circular buffers used by the HCA to report completion events, errors and other asynchronous events. This module defines the layout of an EQ, the context used to initialize an EQ and related functions.
- This module defines the layout of the initialization segment as well as access functions. (PRM Section 5.4: Initialization Segment)
- The Receive Queue (RQ) object holds the descriptor ring used to hold incoming packets. The descriptor ring is referred to as a Work Queue Buffer. This module defines the layout of an RQ and the context used to initialize a RQ.
- The Send Queue (SQ) object holds the descriptor ring used to send outgoing messages and packets. The descriptor ring is referred to as a Work Queue Buffer. This module defines the layout of an SQ, the context used to initialize a SQ, the Transport Interface Send object attached to the queue and related functions.
- The Work Queue (WQ) contains a contiguous memory buffer used by SW to post I/O requests (WQEs) for HCA execution. A Work Request is posted to the HCA by writing to one or more Work Queue Elements (WQE) of the WQ and ringing the DoorBell, notifying the HCA that request has been posted. A WQ is created for every SQ and RQ and is comprised of WQE Basic Blocks (WQEBBs) which are 64 byte units.
Structs
- completion queue number
- event queue number
- flow group id
- flow table id
- protection domain
- receive queue number
- send queue number
- transport domain
- transport interface receive number
- transport interface send number
Functions
- Find the page size of the given
num_bytes
in units of 4KiB pages.