SlideShare a Scribd company logo
DPDK performance
How to not just do a demo with the DPDK
Stephen Hemminger
stephen@networkplumber.org
@networkplumber
Agenda
●
DPDK
– Background
– Examples
●
Performance
– Lessons learned
●
Open Issues
60 160 260 360 460 560 660 760 860 960 1060 1160 1260 1360 1460
0
200
400
600
800
1000
1200
1400
1600
1800
2000
Packet size (bytes)
Time(ns)
Server
Packet
Network
Infrastructure
Packet time vs size
Demo Applications
●
Examples
– L2fwd → Bridge/Switch
– L3fwd → Router
– L3fwd-acl → Firewall
– Load_balancer
– qos_sched → Quality Of Service
L3fwd
Route
Lookup
Transmit
Transmit
Transmit
TransmitReceive
Receive
Receive
Receive
Receive
Forwarding thread
Read Burst
Process Burst
Statistics:
Received Packets
Transmit Packets
Iterations
Packets processed
Time Budget
●
Packet
– 67.2ns = 201 cycles @ 3Ghz
●
Cache
– L3 = 8 ns
– L2 = 4.3
●
Atomic operations
– Lock = 8.25 ns
– Lock/Unlock = 16.1
Network stack challenges at increasing speeds – LCA 2015
Jesper Dangaard Brouer
Architecture choices
●
Legacy
– Existing proprietary code
●
BSD clone
●
DIY
– Build forwarding engine from scratch
Test fixture
Freebsd
(netmap)
Router
Linux
desktop
10G Fibre
192.18.1.0/27
10G Cat6
192.18.0.0/27
Management network
Dataplane CPU activity
Core Interface RX Rate TX Rate Idle
--------------------------------------------------------
1 p1p1 14.9M 0
2 p1p1 0 250
3 p33p1 0 250
4 p33p1 1 250
5 p1p1 0 250
6 p33p1 11.9M 1
Internal Instrumentation
Linux perf
●
Perf tool part of kernel source
●
Can look at kernel and application
– Drill down if has symbols
Perf – active thread
Samples: 16K of event 'cycles', Event count (approx.): 11763536471
14.93% dataplane [.] ip_input
10.04% dataplane [.] ixgbe_xmit_pkts
7.69% dataplane [.] ixgbe_recv_pkts
7.05% dataplane [.] T.240
6.82% dataplane [.] fw_action_in
6.61% dataplane [.] fifo_enqueue
6.44% dataplane [.] flow_action_fw
6.35% dataplane [.] fw_action_out
3.92% dataplane [.] ip_hash
3.69% dataplane [.] cds_lfht_lookup
2.45% dataplane [.] send_packet
2.45% dataplane [.] bit_reverse_ulong
Original model
Rx0.0
Rx0.1
Core 1
Core 2
Tx0.0
Rx1.0
Rx1.1
Core 3
Core 4
Tx0.1
Tx0.2
Tx0.3
Tx1.0
Tx1.1
Tx1.2
Tx1.3
Split thread model
Rx0.0
Rx0.1
Core 1
Core 5
Tx1
Core 2
Core 6
Tx1
Rx1.0
Rx1.1
Core 3
Core 4
Speed killer's
●
I/O
●
VM exit's
●
System call's
●
PCI access
●
HPET
●
TSC
●
Floating Point
●
Cache miss
●
CPU pipeline stall
TSC counter
while(1)
cur_tsc = rte_rdtsc();
diff_tsc = cur_tsc – prev_tsc;
if (unlikely(diff_tsc > drain_tsc)) {
for (portid = 0; portid < RTE_MAX_ETHPORTS; 
portid++) {
send_burst(qconf,
qconf­>tx_mbufs[portid].len,
portid);
CPU stall
Heisenburg: observing performance slows it down
fw_action_in
│ struct ip_fw_args fw_args = {
.m = m,
│ .client = client,
│ .oif = NULL };
1.54 │1d: movzbl %sil,%esi
0.34 │ mov %rsp,%rdi
0.04 │ mov $0x13,%ecx
0.16 │ xor %eax,%eax
57.66 │ rep stos %rax,%es:(%rdi)
4.68 │ mov %esi,0x90(%rsp)
20.45 │ mov %r9,(%rsp)
Why is QoS slow?
static inline void
rte_sched_port_time_resync(struct rte_sched_port *port)
{
uint64_t cycles = rte_get_tsc_cycles();
uint64_t cycles_diff = cycles ­ port­>time_cpu_cycles;
double bytes_diff = ((double) cycles_diff) / 
port­>cycles_per_byte;
/* Advance port time */
port­>time_cpu_cycles = cycles;
port­>time_cpu_bytes += (uint64_t) bytes_diff;
The value of idle
●
All CPU's are not equal
– Hyperthreading
– Cache sharing
– Thermal
If one core is idle, others can go faster
Idle sleep
●
100% Poll → 100% CPU
– CPU power limits
– No Turbo boost
– PCI bus overhead
●
Small sleep's
– 0 - 250us
– Based on activity
Memory Layout
●
Cache killers
– Linked lists
– Poor memory layout
– Global statistics
– Atomic
●
Doesn't help
– Prefetching
– Inlining
Mutual Exclusion
●
Locking
– Reader/Writer lock is expensive
– Read lock more overhead than spin lock
●
Userspace RCU
– Don't modify, create and destroy
– Impacts thread model
Longest Prefix Match
Nexthop
1.1.1.1
/24
table
1.1.1.X
If = dp0p9p1
gw = 2.2.33.5
1.1.3.6
LPM issues
●
Prefix → 8 bit next hop
●
Missing barriers
●
Rule update
●
Fixed size /8 table
PCI passthrough
●
I/O TLB size
– Hypervisor uses IOMMU to map guest
– IOMMU has small TLB cache
– Guest I/O exceeds TLB
●
Solution
– 1G hugepage on host KVM
– Put Guest in huge pages
– Only on KVM – requires manual configuration
DPDK Issues
●
Static configuration
– Features
– CPU architecture
– Table sizes
●
Machine specific initialization
– # of Cores, Memory Channels
●
Poor device model
– Works for Intel E1000 like devices
Conclusion
●
DPDK can be used to build fast router
– 12M pps per core
●
Lots of ways to go slow
– Fewer ways to go fast
Q & A
Thank you
Stephen Hemminger
stephen@networkplumber.org
@networkplumber

More Related Content

What's hot (20)

PDF
Intel dpdk Tutorial
Saifuddin Kaijar
 
PPTX
Understanding eBPF in a Hurry!
Ray Jenkins
 
PDF
DPDK & Layer 4 Packet Processing
Michelle Holley
 
PDF
Network Programming: Data Plane Development Kit (DPDK)
Andriy Berestovskyy
 
PPTX
Understanding DPDK algorithmics
Denys Haryachyy
 
PDF
DPDK in Containers Hands-on Lab
Michelle Holley
 
PDF
eBPF - Rethinking the Linux Kernel
Thomas Graf
 
PDF
Performance Wins with eBPF: Getting Started (2021)
Brendan Gregg
 
PDF
Linux kernel tracing
Viller Hsiao
 
PPSX
FD.io Vector Packet Processing (VPP)
Kirill Tsym
 
PDF
Fun with Network Interfaces
Kernel TLV
 
PDF
The Linux Block Layer - Built for Fast Storage
Kernel TLV
 
PDF
Hands-on ethernet driver
SUSE Labs Taipei
 
PDF
ACPI Debugging from Linux Kernel
SUSE Labs Taipei
 
PPTX
Debug dpdk process bottleneck & painpoints
Vipin Varghese
 
ODP
eBPF maps 101
SUSE Labs Taipei
 
PDF
Faster packet processing in Linux: XDP
Daniel T. Lee
 
PPTX
eBPF Basics
Michael Kehoe
 
PDF
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
Thomas Graf
 
PDF
BPF: Tracing and more
Brendan Gregg
 
Intel dpdk Tutorial
Saifuddin Kaijar
 
Understanding eBPF in a Hurry!
Ray Jenkins
 
DPDK & Layer 4 Packet Processing
Michelle Holley
 
Network Programming: Data Plane Development Kit (DPDK)
Andriy Berestovskyy
 
Understanding DPDK algorithmics
Denys Haryachyy
 
DPDK in Containers Hands-on Lab
Michelle Holley
 
eBPF - Rethinking the Linux Kernel
Thomas Graf
 
Performance Wins with eBPF: Getting Started (2021)
Brendan Gregg
 
Linux kernel tracing
Viller Hsiao
 
FD.io Vector Packet Processing (VPP)
Kirill Tsym
 
Fun with Network Interfaces
Kernel TLV
 
The Linux Block Layer - Built for Fast Storage
Kernel TLV
 
Hands-on ethernet driver
SUSE Labs Taipei
 
ACPI Debugging from Linux Kernel
SUSE Labs Taipei
 
Debug dpdk process bottleneck & painpoints
Vipin Varghese
 
eBPF maps 101
SUSE Labs Taipei
 
Faster packet processing in Linux: XDP
Daniel T. Lee
 
eBPF Basics
Michael Kehoe
 
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
Thomas Graf
 
BPF: Tracing and more
Brendan Gregg
 

Similar to Dpdk performance (20)

PPTX
PLNOG16: Obsługa 100M pps na platformie PC , Przemysław Frasunek, Paweł Mała...
PROIDEA
 
PDF
Performance challenges in software networking
Stephen Hemminger
 
PDF
Much Faster Networking
C4Media
 
PPTX
QCon 2015 Broken Performance Tools
Brendan Gregg
 
PPTX
High performace network of Cloud Native Taiwan User Group
HungWei Chiu
 
PDF
Van jaconson netchannels
Susant Sahani
 
PDF
100 M pps on PC.
Redge Technologies
 
PDF
Mininet: Moving Forward
ON.Lab
 
PPTX
High Performance Networking Leveraging the DPDK and Growing Community
6WIND
 
PDF
DPDK Integration: A Product's Journey - Roger B. Melton
harryvanhaaren
 
PPSX
FD.IO Vector Packet Processing
Kernel TLV
 
PDF
TRex Traffic Generator - Hanoch Haim
harryvanhaaren
 
PDF
Deep review of LMS process
Riyaj Shamsudeen
 
PDF
2009-01-28 DOI NBC Red Hat on System z Performance Considerations
Shawn Wells
 
PDF
Performance
Christophe Marchal
 
PDF
Linux Kernel vs DPDK: HTTP Performance Showdown
ScyllaDB
 
PPT
Servers and Processes: Behavior and Analysis
dreamwidth
 
PPT
Oow2007 performance
Ricky Zhu
 
PDF
Advanced RAC troubleshooting: Network
Riyaj Shamsudeen
 
PDF
Playing BBR with a userspace network stack
Hajime Tazaki
 
PLNOG16: Obsługa 100M pps na platformie PC , Przemysław Frasunek, Paweł Mała...
PROIDEA
 
Performance challenges in software networking
Stephen Hemminger
 
Much Faster Networking
C4Media
 
QCon 2015 Broken Performance Tools
Brendan Gregg
 
High performace network of Cloud Native Taiwan User Group
HungWei Chiu
 
Van jaconson netchannels
Susant Sahani
 
100 M pps on PC.
Redge Technologies
 
Mininet: Moving Forward
ON.Lab
 
High Performance Networking Leveraging the DPDK and Growing Community
6WIND
 
DPDK Integration: A Product's Journey - Roger B. Melton
harryvanhaaren
 
FD.IO Vector Packet Processing
Kernel TLV
 
TRex Traffic Generator - Hanoch Haim
harryvanhaaren
 
Deep review of LMS process
Riyaj Shamsudeen
 
2009-01-28 DOI NBC Red Hat on System z Performance Considerations
Shawn Wells
 
Performance
Christophe Marchal
 
Linux Kernel vs DPDK: HTTP Performance Showdown
ScyllaDB
 
Servers and Processes: Behavior and Analysis
dreamwidth
 
Oow2007 performance
Ricky Zhu
 
Advanced RAC troubleshooting: Network
Riyaj Shamsudeen
 
Playing BBR with a userspace network stack
Hajime Tazaki
 
Ad

More from Stephen Hemminger (13)

PDF
Staging driver sins
Stephen Hemminger
 
PDF
Netem -emulating real networks in the lab
Stephen Hemminger
 
PDF
Untold story
Stephen Hemminger
 
PDF
Llnw bufferbloat
Stephen Hemminger
 
ODP
Bufferbloat is alll Wet!
Stephen Hemminger
 
PDF
Userspace networking
Stephen Hemminger
 
PDF
Linux Bridging: Teaching an old dog new tricks
Stephen Hemminger
 
PDF
Taking the Fear Out of Contributing
Stephen Hemminger
 
ODP
Integrating Linux routing with FusionCLI™
Stephen Hemminger
 
ODP
Virtual Network Performance Challenge
Stephen Hemminger
 
ODP
A Baker's dozen of TCP
Stephen Hemminger
 
ODP
Virtual net performance
Stephen Hemminger
 
ODP
Online tools
Stephen Hemminger
 
Staging driver sins
Stephen Hemminger
 
Netem -emulating real networks in the lab
Stephen Hemminger
 
Untold story
Stephen Hemminger
 
Llnw bufferbloat
Stephen Hemminger
 
Bufferbloat is alll Wet!
Stephen Hemminger
 
Userspace networking
Stephen Hemminger
 
Linux Bridging: Teaching an old dog new tricks
Stephen Hemminger
 
Taking the Fear Out of Contributing
Stephen Hemminger
 
Integrating Linux routing with FusionCLI™
Stephen Hemminger
 
Virtual Network Performance Challenge
Stephen Hemminger
 
A Baker's dozen of TCP
Stephen Hemminger
 
Virtual net performance
Stephen Hemminger
 
Online tools
Stephen Hemminger
 
Ad

Recently uploaded (20)

PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Python basic programing language for automation
DanialHabibi2
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
July Patch Tuesday
Ivanti
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 

Dpdk performance