Thursday, 6 July 2017

DPDK APIs

1) LPM Library:
     Longest prefix match(LPM)table search for 32-bit keys that is typically used to find the best route match in IP forwarding applications.

    Main Methods: Add LPM rule, Delete LPM rule and lookup LPM Key with 32bit Key provided.

2) Hash Library:
    Hash Library for creating hash table for fast lookup:
   The main configuration parameters for the hash are: • Total number of hash entries • Size of the key in bytes.
 The main methods exported by the hash are: 
   -  Add entry with key
   -  Delete entry with key
   -  Lookup for entry with key
 3) Timer Library:
   This library provides an interface to add, delete and restart a timer. 
   Each lcore contains three lists: a list of pending timers, a list of expired timers, and a list of done timers.  These lists are accessed when resetting or stopping a timer and in the rte_timer_manage() function, which runs the expired timers.

  The timer library uses the rte_get_timer_cycles()  function that uses the High Precision Event Timer (HPET) or the CPU’s Time Stamp Counter (TSC) to provide a reliable time reference. 

 4)Poll Mode Driver(PMD) API
   By default, all functions exported by a PMD are lock-free functions.
   A packet is represented by an rte_mbuf structure, which is a generic metadata structure containing all necessary housekeeping information. This includes fields and status bits corresponding to offload hardware features, such as checksum computation of IP headers or VLAN tags.

5) MBuf Library:
   For the storage of the packet data (including protocol headers), two approaches were considered: 
1. Embed metadata within a single memory buffer the structure followed by a fixed size area for the packet data.
 2. Use separate memory buffers for the metadata structure and for the packet data.
The advantage of the first method is that it only needs one operation to allocate/free the whole memory representation of a packet. On the other hand, the second method is more flexible and allows the complete separation of the allocation of metadata structures from the allocation of packet data buffers. The first method was chosen for the Intel® DPDK.
This library provides some functions for manipulating the data in a packet mbuf. 
For instance: 
• Get data length 
• Get a pointer to the start of data 
• Prepend data before data 
• Append data after data 
• Remove data at the beginning of the buffer (rte_pktmbuf_adj()) 
• Remove data at the end of the buffer (rte_pktmbuf_trim()) 

6)Mempool Library:
   A memory pool is an allocator of a fixed-sized object. In the Intel® DPDK, it is identified by name and uses a ring to store free objects.
 
 
The mbuf library provides the ability to allocate and free buffers (mbufs) that may be used by the Intel® DPDK application to store message buffers. The message buffers are stored in a mempool.

7) Ring Library:
  The ring allows the management of queues. Instead of having a linked list of infinite size, the rte_ring has the following properties: • FIFO 
• Maximum size is fixed, the pointers are stored in a table.
 Multi-consumer or single-consumer dequeue
 • Multi-consumer or single-producer enqueue 
• Bulk dequeue - Dequeues the specified count of objects if successful; otherwise fails
 • Bulk enqueue - Enqueues the specified count of objects if successful; otherwise fails 

8) Memory Sharing:
multi-process application working using the Intel® DPDK is to ensure that memory resources are properly shared among the processes making up the multi-process application. 
Once there are blocks of shared memory available that can be accessed by multiple processes, then issues such as inter-process communication (IPC) becomes much simpler. 




 

No comments:

Post a Comment