
Tang L,etal. SciChinaInfSci December 2015 Vol. 58 120103:4
page
Page length 4K
Base address of page
Memory
Directory
Offset
…
Page
Directory
+
Page i
CPU
L1 TLB
L2 TLB
Pipeline
Virtual
Address
Physical address
(a)
SKB
SKB 1
SKB 2
SKB 3
Pkt buffer
Pkt
Data
…
frag_list
frag[0]
…
Header data
SKB Buff
Cache
Slab
allocator
SKB Buffer
Allocation
list
s_mom
free
Slab
descriptor
…
Allocated
object
Cache
Date
Cache
(b)
Figure 2 Virtual-to-physical address translation and SKB allocation. (a) Virtual to physical address translation; (b) SKB
allocation.
relationship of virtual-to-physical address translation), then by the physical address, CPU will directly
look up in L1 and L2 cache or the memory to get the target data. If TLB misses, CPU will turn to look up
in L2 TLB. (3) If TLB hits in L2 TLB, then CPU will directly look up in L1 and L2 cache or the memory
to get the target data by the physical address. If TLB misses, then CPU will look up the memory page
table to obtain the physical addresses and update TLB. Cache access is similar to TLB access, and the
virtual-to-physical address translation is illustrated as in Figure 2(a). It is generally considered that packet
processing only contains two memory access (SKB memory access and data memory access) overheads. In
fact, CPU processing involves many memory accesses: SKB allocation memory access, SKB deallocation
memory access, Slab allocation memory access, Slab deallocation memory access, SKB memory access
and data memory access, etc. In this paper, we mainly investigate SKB allocation memory access.
For example, when Linux system allocates SKB, OS will ask SKB Buffer Management program to
allocate it. SKB Buffer Management will get skbuff from SKB buffer cache (this buffer was allocated by
Slab allocator), and then it gets data buffer from the data cache, and connects the data buffer address to
skbuff, finally returns the allocated SKB to SKB Buffer Management. SKB is composed of skbuff area
and data area. Skbuff consists of objects allocated by slab allocator; the processing is like this: when
there is no allocated objects in SKB buffer cache, SKB Buffer Management will call Slab allocator to
allocate an object. Firstly, slab allocator looks up the Slab allocation table (Slab allocation table stores
the current object status of the assigned page), and then allocates the unallocated object from one slab if
there is still unallocated object in the partial entry. Otherwise, if objects are all allocated, slab allocator
will take a free slab from an unallocated one and allocate it, and add the unallocated slab into the partial
entry set eventually, as shown in Figure 2(b).
The virtual-to-physical address translation overhead and the buffer management overhead are involved
in many complex processes and memory access operations, thus occupying a large portion of packet
processing overheads, and that is why researchers try to optimize these two overheads.
3 Current optimization solutions
To reduce the two overheads and optimize the packet processing performance, a lot of methods have been
proposed in recent years. These methods can be classified into two categories. One is via software, in
which, only software is employed to optimize packet processing (for example: packet reception, and buffer
management, etc.). The other is via hardware, in which, researchers try to modify CPU architecture or
adopt an embedded coprocessor to improve the performance.