DPDK card initialization

Several objects DPDK card initialization process involved

dev

NIC device object corresponding to a device pci

port

Port object, which corresponds to a similar network interface ifconfig

rx_queue/tx_queue

Port transceivers queue object
multi-core environment, the port can receive the response packet to specify the cpu to handle the packet.
By increasing the transceiver queue, according pentad hash core allocation process, to achieve the initial load balancing of computing resources
for each port of the incoming packet by the calculated hash rss module, sent to the corresponding queue of pending cpu

tx_desc/rx_desc

NIC driver dma number of transceiver queue.
Transceiver desc describes the information required to send and receive dma, such as source / destination addresses, length

Related API

Setting the transceiver port queue number, and port parameters

int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue,
        uint16_t nb_tx_queue, const struct rte_eth_conf *eth_conf);

The number of packet processing core transceiver: nb_rx_queue / nb_tx_queue configured according to

Set the port receive queue. rte_eth_dev_info_get can get the default configuration of rx_conf

int rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
        uint16_t nb_rx_desc, unsigned int socket_id,
        const struct rte_eth_rxconf *rx_conf,
        struct rte_mempool *mb_pool);

nb_rx_desc configured according to: NIC hardware, can not exceed the number of ring mb_pool in
mb_pool: NIC -> distribution of the drive receives a packet memory pool

Set the port transmit queue. rte_eth_dev_info_get can get the default configuration of tx_conf

int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,
        uint16_t nb_tx_desc, unsigned int socket_id,
        const struct rte_eth_txconf *tx_conf);

nb_tx_desc configured according to: NIC hardware

Each NIC tx / rx descriptor is determined, all port queues share descriptor
rte_eth_rx_queue_setup descriptor number and allowing each queue rte_eth_tx_queue_setup occupied specific allocation, based on the initial realization of Qos queue

Guess you like

Origin www.cnblogs.com/zl-yang/p/11058277.html