#include <stdint.h>
#include <inttypes.h>
#include <rte_eal.h>
#include <rte_ethdev.h>
#include <rte_cycles.h>
#include <rte_lcore.h>
#include <rte_mbuf.h>
#define RX_RING_SIZE 128 //接收环大小
#define TX_RING_SIZE 512 //发送环大小
#define NUM_MBUFS 8191
#define MBUF_CACHE_SIZE 250
#define BURST_SIZE 32
static const struct rte_eth_conf port_conf_default = {
.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN } //用于配置以太网端口的默认结构。
};
/* basicfwd.c: Basic DPDK skeleton forwarding example. */
/*
* Initializes a given port using global settings and with the RX buffers
* coming from the mbuf_pool passed as a parameter.
*/
/*
指定网口的队列数,本列中指定的队列
在tx、rx两个方向上,设置缓冲区
*/
static inline int
port_init(uint8_t port, struct rte_mempool *mbuf_pool) //初始化网卡配置;
{
struct rte_eth_conf port_conf = port_conf_default; //网口配置=默认的网口配置
const uint16_t rx_rings = 1, tx_rings = 1; /
DPDK Skeleton代码详读
最新推荐文章于 2023-09-13 16:06:20 发布