300x250
example/skeleton에 정의되어있는 basicfwd.c 이다.
실행 절차는 다음과 같다.
in main() :
The main function, which does initialization and calls the per-lcore functions.
- Initialize the EAL
- Check that there is an even number of ports to send/receive on
- creates a new mempool in memory to hold the mbufs
- Initialize all ports (port_init()으로 들어감)
11. call lcore_main on the master core only (lcore_main 으로 들어감)
in port_init() :
Initializes a given port using global settings and with the RX buffers coming from the mbuf_pool passed as a parameter.
- Configure the Ethernet device
- Allocate and set up 1 RX queue per Ethernet port
- Allocate and set up 1 TX queue per Ethernet port
- Start the Ethernet port
- Display the port MAC address
- Enable RX in promiscuous mode for the Ethernet device
in lcore_main() :
this is the main thread that does the work, reading from an input port and writing to an output port.
- Chech that the port is on the smae NUMA node as the polling thread for best performance.
- run until the application is quit or killed(infinity loop)
(1) Receive packets on a port and forward them on the paired port.
The mapping is 0->1, 1->2, 2->3, 3->2, etc....
(2) Get burst of RX packets, from first port of pair
(3) send burst of TX pakcets, to second port of pair
(4) free any unsent packets
반응형
'IT > DPDK' 카테고리의 다른 글
dpdk 커널 설정과 example 코드 컴파일 (4) | 2016.01.26 |
---|---|
DPDK란? (0) | 2016.01.26 |