SlideShare une entreprise Scribd logo
1  sur  10
Télécharger pour lire hors ligne
CETH for XDP
Common Ethernet Driver Framework
for faster network I/O
Yan Chen(Y.Chen@Huawei.com)
Yunsong Lu (Yunsong.Lu@Huawei.com)
Leveraging IO Visor
• Performance Tuning
• Tracing
• Networking for Container: Dynamic E2E Monitoring
• Cloud Native NFV: Micro Data Path Container(MDPC)
• http://www.slideshare.net/IOVisor/evolving-virtual-networking-with-
io-visor-openstack-summit-austin-april-2016
Express I/O for XDP
• Kernel Network I/O has been a performance bottleneck
• Netmap and DPDK claimed 10x performance advantage 
• Bypass is not low-hanging fruit
• Could rebuilding EVERYTHING in userspace really do better?
• Unless all bottlenecks are removed, it’s still a long way to go
• Kernel is the place for better driver/platform eco-system
• Multi-vendor NICs and accelerators
• X86, ARM, Power, SPARC, etc.
• Programmability of XDP will enable innovation in “Network
Functional Applications”
History of CETH (Common Ethernet Driver Framework)
Designed for Performance and Virtualization:
1. Improve kernel networking performance for
virtualization, particularly vSwitch and virtual I/O
2. Simplify NIC drivers by consolidate common
functions, particularly for “internal” new NICs
accelerators
3. Standalone module for various kernel versions
Supports:
• Huawei’s EVS(Elastic Virtual Switch)
• NICs:
• Intel ixgbe
• Intel i40e (40G)
• Broadcom bnx2x
• Mellanox mlnx-en
• Emulex be2net
• Accelerators:
• Huawei SNP-lite
• Broadcom XLP
• Ezchip Gx36
• Huawei VDR
• vNIC:
• ctap(tap+vhost)
• virtio-net
• ceth-pair
Design Considerations (before XDP)
1. Efficient Memory/Buffer Management
o Pre-allocated packet buffer pool
o Efficient buffer acquire/recycle mechanism
o Data Prefetching
o Batching packet process
o Optimized for efficient cache usage
o Locking reduction/avoidance
o High performance copy
o Reduction of DMA mapping
o Huge pages, etc.
2. Flexible TX/RX Scheduling
o Threaded_irq
o All-in-interrupt handling
o Optional R2C or Pipeline Threading models
o Feature-triggered mode switching
3. Customizable Meta-data structure
o Cache-friendly data structure
o Hardware/accelerator friendly
o Extensible Metadata format is customizable
o SKB compatible
4. Compatible with Kernel IP stack
o Hardware Offloading friendly
o Checksum, VLAN, etc.
o TSO/GSO, LRO/GRO
o Easy to port existing Linux device drivers
o Reuse most existing non-datapath functions
o Guild for easy driver porting
5. Tools for easy performance tuning
o “ceth” tool to tune all parameters
o sysfs interfaces
Simplified CETH for XDP
1. Efficient Memory/Buffer Management
o Pre-allocated packet buffer pool
o Efficient buffer acquire/recycle mechanism
o Data Prefetching
o Batching packet process
o Optimized for efficient cache usage
o Locking reduction/avoidance
o High performance copy
o Reduction of DMA mapping
o Huge pages, etc.
2. Flexible TX/RX Scheduling
o Threaded_irq
o All-in-interrupt handling
o Optional R2C or Pipeline Threading models
o Feature-triggered mode switching
3. Customizable Meta-data structure
o Cache-friendly data structure
o Hardware/accelerator friendly
o Extensible Metadata format is customizable
o SKB compatible
4. Compatible with Kernel IP stack
o Hardware Offloading friendly
o Checksum, VLAN, etc.
o TSO/GSO, LRO/GRO
o Easy to port existing Linux device drivers
o Easy driver porting: less than 200LOC/driver
5. Tools for easy performance tuning
o “ceth” tool to tune all parameters
o Sysfs interfaces
Simple interfaces for drivers
• New Functions (CETH module)
o ceth_pkt_aquire()
o ceth_pkt_recycle()
o ceth_pkt_to_skb()
• Kernel modification
o __kfree_skb()
• Driver modifications
• allocate buffers from CETH
• optional: use pkt_t by default
• optimize the driver! 
• Performance
 30% performance improvement for packet
switching (br, ovs)
 40% of pktgen performance
 100% improvement for XDP forwarding
 33Mpps XDP dropping rate with 2 CPU threads
 Scalable with multiple hardware queues
Patch available based on latest XDP kernel tree.
Preliminary Performance numbers:
https://docs.google.com/spreadsheets/d/1nT0DO25lfS1QpB
LQkdIMm4LJl1v_VMScZVSOcRgkQOI/edit#gid=0
NOTE: all numbers were internally tested for development
purpose only.
Memory and Buffer Management
• Separate memory
management layer for
various optimizations,
like huge page
• Per-CPU or per-queue
buffer pool mechanisms
• May use skb by default
(pkt_t as buffer data
structure only)
• Can use non-skb meta-
data cross all XDP
functions
Packet Management
for XDP and protocol stack
driver
Buffer ManagementMemory Management
RX queue
RX queue
RX queue
RX queue
RX queue
RX queue
per-CPU
ceth_pkt buffer pool
per-CPU
ceth_pkt buffer pool
per-CPU
ceth_pkt buffer pool
ceth_pkt batch
in-use
ceth_pkt free
ceth_pkt free
ceth_pkt in-use
ceth_pkt batch
in-use
ceth_pkt free
ceth_pkt free
ceth_pkt in-use
ceth_pkt batch
in-use
ceth_pkt free
ceth_pkt free
ceth_pkt in-use
ceth_pkt batch
in-use
ceth_pkt free
ceth_pkt free
ceth_pkt in-use
default
paged memory implementation
using buddy allocator
contiguous pages
of batch size
page
page
page
contiguous pages
of batch size
page
page
page
contiguous pages
of batch size
page
page
page
per-CPU / per device queue
ceth_pkt buffer pool
recycled batch list
free ceth_pkt batch
ceth_pkt
ceth_pkt
ceth_pkt
free ceth_pkt batch
ceth_pkt
ceth_pkt
ceth_pkt
TX queue
current ceth_pkt batch
ceth_pkt batch
in-use
desc ring
if current batch is used up
and recycled list is not empty
take the first batch in recycled list
ceth_pkt
ceth_pkt
ceth_pkt
ceth_pkt
RX queue
desc ring
ceth_pkt
ceth_pkt
ceth_pkt
ceth_pkt
host protocol stack
forwarding
ceth_pkt_acquire()
__kfree_skb(skb)
ceth_pkt_to_skb(pkt)
netif_receive_skb(skb)
ceth_pkt
ceth_pkt in-use
ceth_pkt in-use
ceth_pkt
ceth_pkt
ceth_pkt in-use
ceth_pkt
ceth_pkt
contiguous pages
of batch size
page
page
page
page
if recycled list is empty
alloc_pages()
if recycled list is too long
free the batch directly
if recycled list idled for too long
free all pkt batches in the list
free ceth_pkt batch
ceth_pkt
ceth_pkt
ceth_pkt
ceth_pkt
whoever frees the last in-use ceth_pkt in a batch
will push the batch to head of recycled list
while taking the recycle list lock
drop
ceth_pkt_recycle(pkt)
optional
huge-page implementation
for mapping to user space
contiguous pages
of batch size
page
page
page
contiguous pages
of batch size
page
page
page
contiguous pages
of batch size
page
page
page
contiguous memory
frags of batch size
frag
frag
frag
frag
XDP
CETH pkt_t Structure
• Use one page for one packet
• Customizable meta data (for XDP)
• Header room for overlay
• SKB data structure ready
• Easy conversion between pkt_t and skb_buff
(with cost)
• Reuse skb_shared_info for fragments
frags[17]
end
skb_shared_info
head room
128 (64x2)
data
skb
data
sk_buff
232x2+8(64x8)
320 (64x5)
128 (64x2)
2880(64x45)
4K (64*64)
sk_buff2
fclone_ref=2
sk_buff_fclones
head
data
end
head
data
end
handle
data_offset
signature
meda data
ceth_pkt
list head
ceth_pkt_buffer
Next Steps (w/ XDP)
• Ongoing
1. Port more mm/bm features
2. Measure performance with XDP
use cases
3. optimize performance with
drivers (need help from driver
developers! )
4. Measure perfoermance
improvement of virtio
5. Direct Socket Interface for
userspace applications
• Discussions on mailing lists
1. Meta-data format
2. Offloading features, like TSO
3. Acceleration API
4. Virtualization Supports

Contenu connexe

Tendances

Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCBuilding Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCC
Kernel TLV
 
Virtualized network with openvswitch
Virtualized network with openvswitchVirtualized network with openvswitch
Virtualized network with openvswitch
Sim Janghoon
 

Tendances (20)

Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCBuilding Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCC
 
eBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux KerneleBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux Kernel
 
Replacing iptables with eBPF in Kubernetes with Cilium
Replacing iptables with eBPF in Kubernetes with CiliumReplacing iptables with eBPF in Kubernetes with Cilium
Replacing iptables with eBPF in Kubernetes with Cilium
 
DPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingDPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet Processing
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
 
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDPDockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
Understanding DPDK
Understanding DPDKUnderstanding DPDK
Understanding DPDK
 
Introduction of eBPF - 時下最夯的Linux Technology
Introduction of eBPF - 時下最夯的Linux Technology Introduction of eBPF - 時下最夯的Linux Technology
Introduction of eBPF - 時下最夯的Linux Technology
 
Cilium - BPF & XDP for containers
 Cilium - BPF & XDP for containers Cilium - BPF & XDP for containers
Cilium - BPF & XDP for containers
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDP
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
 
DPDK In Depth
DPDK In DepthDPDK In Depth
DPDK In Depth
 
Meet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracingMeet cute-between-ebpf-and-tracing
Meet cute-between-ebpf-and-tracing
 
Security Monitoring with eBPF
Security Monitoring with eBPFSecurity Monitoring with eBPF
Security Monitoring with eBPF
 
Introduction to eBPF and XDP
Introduction to eBPF and XDPIntroduction to eBPF and XDP
Introduction to eBPF and XDP
 
eBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to UserspaceeBPF Trace from Kernel to Userspace
eBPF Trace from Kernel to Userspace
 
Virtualized network with openvswitch
Virtualized network with openvswitchVirtualized network with openvswitch
Virtualized network with openvswitch
 

Similaire à CETH for XDP [Linux Meetup Santa Clara | July 2016]

DAOS - Scale-Out Software-Defined Storage for HPC/Big Data/AI Convergence
DAOS - Scale-Out Software-Defined Storage for HPC/Big Data/AI ConvergenceDAOS - Scale-Out Software-Defined Storage for HPC/Big Data/AI Convergence
DAOS - Scale-Out Software-Defined Storage for HPC/Big Data/AI Convergence
inside-BigData.com
 
Introduction to NVMe Over Fabrics-V3R
Introduction to NVMe Over Fabrics-V3RIntroduction to NVMe Over Fabrics-V3R
Introduction to NVMe Over Fabrics-V3R
Simon Huang
 
SOUG_GV_Flashgrid_V4
SOUG_GV_Flashgrid_V4SOUG_GV_Flashgrid_V4
SOUG_GV_Flashgrid_V4
UniFabric
 

Similaire à CETH for XDP [Linux Meetup Santa Clara | July 2016] (20)

Ceph Day Beijing - Ceph all-flash array design based on NUMA architecture
Ceph Day Beijing - Ceph all-flash array design based on NUMA architectureCeph Day Beijing - Ceph all-flash array design based on NUMA architecture
Ceph Day Beijing - Ceph all-flash array design based on NUMA architecture
 
Ceph Day Beijing - Ceph All-Flash Array Design Based on NUMA Architecture
Ceph Day Beijing - Ceph All-Flash Array Design Based on NUMA ArchitectureCeph Day Beijing - Ceph All-Flash Array Design Based on NUMA Architecture
Ceph Day Beijing - Ceph All-Flash Array Design Based on NUMA Architecture
 
Dataplane networking acceleration with OpenDataplane / Максим Уваров (Linaro)
Dataplane networking acceleration with OpenDataplane / Максим Уваров (Linaro)Dataplane networking acceleration with OpenDataplane / Максим Уваров (Linaro)
Dataplane networking acceleration with OpenDataplane / Максим Уваров (Linaro)
 
DAOS - Scale-Out Software-Defined Storage for HPC/Big Data/AI Convergence
DAOS - Scale-Out Software-Defined Storage for HPC/Big Data/AI ConvergenceDAOS - Scale-Out Software-Defined Storage for HPC/Big Data/AI Convergence
DAOS - Scale-Out Software-Defined Storage for HPC/Big Data/AI Convergence
 
Ceph Day Seoul - AFCeph: SKT Scale Out Storage Ceph
Ceph Day Seoul - AFCeph: SKT Scale Out Storage Ceph Ceph Day Seoul - AFCeph: SKT Scale Out Storage Ceph
Ceph Day Seoul - AFCeph: SKT Scale Out Storage Ceph
 
Heterogeneous Computing : The Future of Systems
Heterogeneous Computing : The Future of SystemsHeterogeneous Computing : The Future of Systems
Heterogeneous Computing : The Future of Systems
 
From Rack scale computers to Warehouse scale computers
From Rack scale computers to Warehouse scale computersFrom Rack scale computers to Warehouse scale computers
From Rack scale computers to Warehouse scale computers
 
PROSE
PROSEPROSE
PROSE
 
Introduction to DPDK
Introduction to DPDKIntroduction to DPDK
Introduction to DPDK
 
Walk Through a Software Defined Everything PoC
Walk Through a Software Defined Everything PoCWalk Through a Software Defined Everything PoC
Walk Through a Software Defined Everything PoC
 
Data Policies for the Kafka-API with WebAssembly | Alexander Gallego, Vectorized
Data Policies for the Kafka-API with WebAssembly | Alexander Gallego, VectorizedData Policies for the Kafka-API with WebAssembly | Alexander Gallego, Vectorized
Data Policies for the Kafka-API with WebAssembly | Alexander Gallego, Vectorized
 
Introduction to NVMe Over Fabrics-V3R
Introduction to NVMe Over Fabrics-V3RIntroduction to NVMe Over Fabrics-V3R
Introduction to NVMe Over Fabrics-V3R
 
Ceph Day Melbourne - Walk Through a Software Defined Everything PoC
Ceph Day Melbourne - Walk Through a Software Defined Everything PoCCeph Day Melbourne - Walk Through a Software Defined Everything PoC
Ceph Day Melbourne - Walk Through a Software Defined Everything PoC
 
NWU and HPC
NWU and HPCNWU and HPC
NWU and HPC
 
DPDK Summit 2015 - Aspera - Charles Shiflett
DPDK Summit 2015 - Aspera - Charles ShiflettDPDK Summit 2015 - Aspera - Charles Shiflett
DPDK Summit 2015 - Aspera - Charles Shiflett
 
Ceph
CephCeph
Ceph
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
 
SOUG_GV_Flashgrid_V4
SOUG_GV_Flashgrid_V4SOUG_GV_Flashgrid_V4
SOUG_GV_Flashgrid_V4
 
Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph
 
April 2014 IBM announcement webcast
April 2014 IBM announcement webcastApril 2014 IBM announcement webcast
April 2014 IBM announcement webcast
 

Dernier

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Dernier (20)

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 

CETH for XDP [Linux Meetup Santa Clara | July 2016]

  • 1. CETH for XDP Common Ethernet Driver Framework for faster network I/O Yan Chen(Y.Chen@Huawei.com) Yunsong Lu (Yunsong.Lu@Huawei.com)
  • 2. Leveraging IO Visor • Performance Tuning • Tracing • Networking for Container: Dynamic E2E Monitoring • Cloud Native NFV: Micro Data Path Container(MDPC) • http://www.slideshare.net/IOVisor/evolving-virtual-networking-with- io-visor-openstack-summit-austin-april-2016
  • 3. Express I/O for XDP • Kernel Network I/O has been a performance bottleneck • Netmap and DPDK claimed 10x performance advantage  • Bypass is not low-hanging fruit • Could rebuilding EVERYTHING in userspace really do better? • Unless all bottlenecks are removed, it’s still a long way to go • Kernel is the place for better driver/platform eco-system • Multi-vendor NICs and accelerators • X86, ARM, Power, SPARC, etc. • Programmability of XDP will enable innovation in “Network Functional Applications”
  • 4. History of CETH (Common Ethernet Driver Framework) Designed for Performance and Virtualization: 1. Improve kernel networking performance for virtualization, particularly vSwitch and virtual I/O 2. Simplify NIC drivers by consolidate common functions, particularly for “internal” new NICs accelerators 3. Standalone module for various kernel versions Supports: • Huawei’s EVS(Elastic Virtual Switch) • NICs: • Intel ixgbe • Intel i40e (40G) • Broadcom bnx2x • Mellanox mlnx-en • Emulex be2net • Accelerators: • Huawei SNP-lite • Broadcom XLP • Ezchip Gx36 • Huawei VDR • vNIC: • ctap(tap+vhost) • virtio-net • ceth-pair
  • 5. Design Considerations (before XDP) 1. Efficient Memory/Buffer Management o Pre-allocated packet buffer pool o Efficient buffer acquire/recycle mechanism o Data Prefetching o Batching packet process o Optimized for efficient cache usage o Locking reduction/avoidance o High performance copy o Reduction of DMA mapping o Huge pages, etc. 2. Flexible TX/RX Scheduling o Threaded_irq o All-in-interrupt handling o Optional R2C or Pipeline Threading models o Feature-triggered mode switching 3. Customizable Meta-data structure o Cache-friendly data structure o Hardware/accelerator friendly o Extensible Metadata format is customizable o SKB compatible 4. Compatible with Kernel IP stack o Hardware Offloading friendly o Checksum, VLAN, etc. o TSO/GSO, LRO/GRO o Easy to port existing Linux device drivers o Reuse most existing non-datapath functions o Guild for easy driver porting 5. Tools for easy performance tuning o “ceth” tool to tune all parameters o sysfs interfaces
  • 6. Simplified CETH for XDP 1. Efficient Memory/Buffer Management o Pre-allocated packet buffer pool o Efficient buffer acquire/recycle mechanism o Data Prefetching o Batching packet process o Optimized for efficient cache usage o Locking reduction/avoidance o High performance copy o Reduction of DMA mapping o Huge pages, etc. 2. Flexible TX/RX Scheduling o Threaded_irq o All-in-interrupt handling o Optional R2C or Pipeline Threading models o Feature-triggered mode switching 3. Customizable Meta-data structure o Cache-friendly data structure o Hardware/accelerator friendly o Extensible Metadata format is customizable o SKB compatible 4. Compatible with Kernel IP stack o Hardware Offloading friendly o Checksum, VLAN, etc. o TSO/GSO, LRO/GRO o Easy to port existing Linux device drivers o Easy driver porting: less than 200LOC/driver 5. Tools for easy performance tuning o “ceth” tool to tune all parameters o Sysfs interfaces
  • 7. Simple interfaces for drivers • New Functions (CETH module) o ceth_pkt_aquire() o ceth_pkt_recycle() o ceth_pkt_to_skb() • Kernel modification o __kfree_skb() • Driver modifications • allocate buffers from CETH • optional: use pkt_t by default • optimize the driver!  • Performance  30% performance improvement for packet switching (br, ovs)  40% of pktgen performance  100% improvement for XDP forwarding  33Mpps XDP dropping rate with 2 CPU threads  Scalable with multiple hardware queues Patch available based on latest XDP kernel tree. Preliminary Performance numbers: https://docs.google.com/spreadsheets/d/1nT0DO25lfS1QpB LQkdIMm4LJl1v_VMScZVSOcRgkQOI/edit#gid=0 NOTE: all numbers were internally tested for development purpose only.
  • 8. Memory and Buffer Management • Separate memory management layer for various optimizations, like huge page • Per-CPU or per-queue buffer pool mechanisms • May use skb by default (pkt_t as buffer data structure only) • Can use non-skb meta- data cross all XDP functions Packet Management for XDP and protocol stack driver Buffer ManagementMemory Management RX queue RX queue RX queue RX queue RX queue RX queue per-CPU ceth_pkt buffer pool per-CPU ceth_pkt buffer pool per-CPU ceth_pkt buffer pool ceth_pkt batch in-use ceth_pkt free ceth_pkt free ceth_pkt in-use ceth_pkt batch in-use ceth_pkt free ceth_pkt free ceth_pkt in-use ceth_pkt batch in-use ceth_pkt free ceth_pkt free ceth_pkt in-use ceth_pkt batch in-use ceth_pkt free ceth_pkt free ceth_pkt in-use default paged memory implementation using buddy allocator contiguous pages of batch size page page page contiguous pages of batch size page page page contiguous pages of batch size page page page per-CPU / per device queue ceth_pkt buffer pool recycled batch list free ceth_pkt batch ceth_pkt ceth_pkt ceth_pkt free ceth_pkt batch ceth_pkt ceth_pkt ceth_pkt TX queue current ceth_pkt batch ceth_pkt batch in-use desc ring if current batch is used up and recycled list is not empty take the first batch in recycled list ceth_pkt ceth_pkt ceth_pkt ceth_pkt RX queue desc ring ceth_pkt ceth_pkt ceth_pkt ceth_pkt host protocol stack forwarding ceth_pkt_acquire() __kfree_skb(skb) ceth_pkt_to_skb(pkt) netif_receive_skb(skb) ceth_pkt ceth_pkt in-use ceth_pkt in-use ceth_pkt ceth_pkt ceth_pkt in-use ceth_pkt ceth_pkt contiguous pages of batch size page page page page if recycled list is empty alloc_pages() if recycled list is too long free the batch directly if recycled list idled for too long free all pkt batches in the list free ceth_pkt batch ceth_pkt ceth_pkt ceth_pkt ceth_pkt whoever frees the last in-use ceth_pkt in a batch will push the batch to head of recycled list while taking the recycle list lock drop ceth_pkt_recycle(pkt) optional huge-page implementation for mapping to user space contiguous pages of batch size page page page contiguous pages of batch size page page page contiguous pages of batch size page page page contiguous memory frags of batch size frag frag frag frag XDP
  • 9. CETH pkt_t Structure • Use one page for one packet • Customizable meta data (for XDP) • Header room for overlay • SKB data structure ready • Easy conversion between pkt_t and skb_buff (with cost) • Reuse skb_shared_info for fragments frags[17] end skb_shared_info head room 128 (64x2) data skb data sk_buff 232x2+8(64x8) 320 (64x5) 128 (64x2) 2880(64x45) 4K (64*64) sk_buff2 fclone_ref=2 sk_buff_fclones head data end head data end handle data_offset signature meda data ceth_pkt list head ceth_pkt_buffer
  • 10. Next Steps (w/ XDP) • Ongoing 1. Port more mm/bm features 2. Measure performance with XDP use cases 3. optimize performance with drivers (need help from driver developers! ) 4. Measure perfoermance improvement of virtio 5. Direct Socket Interface for userspace applications • Discussions on mailing lists 1. Meta-data format 2. Offloading features, like TSO 3. Acceleration API 4. Virtualization Supports