300x250

example/skeleton에 정의되어있는 basicfwd.c 이다.
실행 절차는 다음과 같다.

in main() :
The main function, which does initialization and calls the per-lcore functions.
  1. Initialize the EAL
  2. Check that there is an even number of ports to send/receive on
  3. creates a new mempool in memory to hold the mbufs
  4. 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.
  1. Configure the Ethernet device
  2. Allocate and set up 1 RX queue per Ethernet port
  3. Allocate and set up 1 TX queue per Ethernet port
  4. Start the Ethernet port
  5. Display the port MAC address
  6. 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.
  1. Chech that the port is on the smae NUMA node as the polling thread for best performance.
  2. 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

+ Recent posts