SlideShare a Scribd company logo
© 2018 NETRONOME SYSTEMS, INC.
Jakub Kicinski
BPF Hardware Offload Deep Dive
© 2018 NETRONOME SYSTEMS, INC. 2
BPF Sandbox
○ As a goal of BPF IR JITing of BPF IR to most RISC cores should be very easy
○ BPF VM provides a simple and well understood execution environment
○ Designed by Linux kernel-minded architects making sure there are no
implementation details leaking into the definition of the VM and ABIs
○ Unlike higher level languages BPF is a intermediate representation (IR) which
provides binary compatibility, it is a mechanism
○ BPF is extensible through helpers and maps allowing us to make use of special
HW features (when gain justifies the effort)
© 2018 NETRONOME SYSTEMS, INC. 3
BPF Ecosystem
○ Kernel infrastructure improves, including verifier/analyzer, JIT compilers for all
common host architectures and some common embedded architectures like
ARM or x86
○ Linux kernel community is very active in extending performance and improving
BPF feature set, with AF_XDP being a most recent example
○ Android APF targets smaller processors in mobile handsets for filtering wake ups
from remote processors (most likely network interfaces) to improve battery life
© 2018 NETRONOME SYSTEMS, INC. 4
BPF Universe
r0 = 0
r2 = *(u32 *)(r1 + 4)
r1 = *(u32 *)(r1 + 0)
r3 = r1
r3 += 14
if r3 > r2 goto 7
r0 = 1
r2 = *(u8 *)(r1 + 12)
if r2 != 34 goto 4
r1 = *(u8 *)(r1 + 13)
r0 = 2
if r1 == 34 goto 1
r0 = 1
...
array LPM
helpers
data storage maps
hash
device
perf
event
socket
anchor maps
program
user space
© 2018 NETRONOME SYSTEMS, INC. 5
r0 = 0
r2 = *(u32 *)(r1 + 4)
r1 = *(u32 *)(r1 + 0)
r3 = r1
r3 += 14
if r3 > r2 goto 7
r0 = 1
r2 = *(u8 *)(r1 + 12)
if r2 != 34 goto 4
r1 = *(u8 *)(r1 + 13)
r0 = 2
if r1 == 34 goto 1
r0 = 1
...
array LPM
helpers
data storage maps
hash
device
perf
event
socket
anchor maps
program
User space
BPF Universe
● Translate the program code into device’s native machine code
○ Use advanced instructions
○ Optimize instruction scheduling
○ Optimize I/O
● Provide device-specific implementation of the helpers
● Use hardware accelerators for maps
○ Use of richer memory architectures
○ Algorithmic lookup engines
○ TCAMs
● Filter packets directly in the NIC
● Handle advanced switching/routing
● Application-specific packet reception policies
© 2018 NETRONOME SYSTEMS, INC. 6
• Optimized for standard server based cloud data centers
• Based on the Netronome Network Flow Processor 4xxx line
• Low profile, half length PCIe form factor for all versions
• Memory: 2GB DRAM
• <25W Power, typical 15-20W
© 2018 NETRONOME SYSTEMS, INC. 7
SoC Architecture-Conceptual Components
4x PCIe Gen 3x8
Multi-threaded transactional memory
engines and accelerators optimized for
network processing
Flow processing cores
distributed into ‘islands’
of 12 (up to 7 islands)
ASIC based packet
processors, crypto
engines, etc…
14Tbps distributed
fabric-crucial
foundation for many
core architecturesUp to 100 Gbps
© 2018 NETRONOME SYSTEMS, INC. 8
NFP SoC Architecture
© 2018 NETRONOME SYSTEMS, INC. 9
NFP SoC Architecture
BPF maps
BPF
programs
© 2018 NETRONOME SYSTEMS, INC. 10
NFP SoC Packet Flow
© 2018 NETRONOME SYSTEMS, INC. 11
NFP SoC Packet Flow
© 2018 NETRONOME SYSTEMS, INC. 12
NFP SoC Packet Flow
© 2018 NETRONOME SYSTEMS, INC. 13
NFP SoC Packet Flow
© 2018 NETRONOME SYSTEMS, INC. 14
NFP SoC Packet Flow
© 2018 NETRONOME SYSTEMS, INC. 15
Memory Architecture - Latencies
NIC
Chip
Island (x6 per Chip)
CTM (256 KB)
IMEM (4 MB)
DRAM
(2+GB)
CLS
(64 KB)
Thread (x4 per Core)
800Mhz Core
LMEM
(1 KB)
GPRs
x50 BPF
workers
LMEM - 1-3 cycles
CLS - 20-50 cycles
CTM - 50-100 cycles
IMEM - 150-250 cycles
GPRS/xfer regs - 1 cycle
DRAM - 150-500 cycles
© 2018 NETRONOME SYSTEMS, INC. 16
Memory Architecture
Thread 0 Thread 1 Thread 2 Dispatcher Thread Thread
CPP Read X and
Yield
Yield
CPP Write Y
Yield
Push Value X
Pull Value Y
Return Value Y
Yield
Yield
Flow Processing Core Cluster Target Memory
Multithreaded Transactional Memory Architecture Hides Latency
© 2018 NETRONOME SYSTEMS, INC. 17
Kernel Offload - BPF Offload Memory Mapping
NIC
Chip
Island (x6 per Chip)
CTM (256 KB)
IMEM(4 MB)
DRAM
(2+GB)
CLS
(64 KB)
Thread (x4 per Core)
800Mhz Core
LMEM
(1 KB)
GPRs
10 Registers
(64-bit, 32-bit
subregisters)
512 byte
stack
Maps, varying
sizes
Driver
x50 BPF
workers
© 2018 NETRONOME SYSTEMS, INC. 18
Programming Model
● Program is written in standard manner
● LLVM compiled as normal
● iproute/tc/libbpf loads the program
requesting offload
● The nfp_bpf_jit.c converts the BPF
bytecode to NFP machine code (and
we mean the actual machine code :))
● Translation reuses a significant amount
of verifier infrastructure
© 2018 NETRONOME SYSTEMS, INC. 19
BPF Object Creation (maps)
1. Get map file descriptors:
a. For existing maps - get access to a file descriptor:
i. from bpffs (pinned map) - open a pseudo file
ii. by ID - use BPF_MAP_GET_FD_BY_ID bpf syscall command
b. Create new maps - BPF_MAP_CREATE bpf syscall command:
union bpf_attr {
struct { /* anonymous struct used by BPF_MAP_CREATE command */
__u32 map_type; /* one of enum bpf_map_type */
__u32 key_size; /* size of key in bytes */
__u32 value_size; /* size of value in bytes */
__u32 max_entries; /* max number of entries in a map */
__u32 map_flags; /* BPF_MAP_CREATE related
* flags defined above.
*/
__u32 inner_map_fd; /* fd pointing to the inner map */
__u32 numa_node; /* numa node (effective only if
* BPF_F_NUMA_NODE is set).
*/
char map_name[BPF_OBJ_NAME_LEN];
__u32 map_ifindex; /* ifindex of netdev to create on */
__u32 btf_fd; /* fd pointing to a BTF type data */
__u32 btf_key_type_id; /* BTF type_id of the key */
__u32 btf_value_type_id; /* BTF type_id of the value */
};
© 2018 NETRONOME SYSTEMS, INC. 20
BPF object creation (programs)
1. Get program instructions;
2. Perform relocations (replace map references with file descriptors IDs);
3. Use BPF_PROG_LOAD to load the program;
union bpf_attr {
struct { /* anonymous struct used by BPF_PROG_LOAD command */
__u32 prog_type; /* one of enum bpf_prog_type */
__u32 insn_cnt;
__aligned_u64 insns;
__aligned_u64 license;
__u32 log_level; /* verbosity level of verifier */
__u32 log_size; /* size of user buffer */
__aligned_u64 log_buf; /* user supplied buffer */
__u32 kern_version; /* checked when prog_type=kprobe */
__u32 prog_flags;
char prog_name[BPF_OBJ_NAME_LEN];
__u32 prog_ifindex; /* ifindex of netdev to prep for */
/* For some prog types expected attach type must be known at
* load time to verify attach type specific parts of prog
* (context accesses, allowed helpers, etc).
*/
__u32 expected_attach_type;
};
© 2018 NETRONOME SYSTEMS, INC. 21
BPF Object Creation (libbpf)
● With libbpf use the extended attributes to set the ifindex:
struct bpf_prog_load_attr {
const char *file;
enum bpf_prog_type prog_type;
enum bpf_attach_type expected_attach_type;
int ifindex;
};
int bpf_prog_load_xattr(const struct bpf_prog_load_attr *attr,
struct bpf_object **pobj, int *prog_fd);
Normal kernel BPF ABIs are used, opt-in for offload by setting ifindex.
© 2018 NETRONOME SYSTEMS, INC. 22
Map Offload
kernel/
bpf/
syscall.c
kernel/
bpf/
offload.c
drivers/
net/
ethernet/
netronome/
nfp/
bpf/
struct
bpf_map_dev_ops
BPF
syscall
is
offloaded
?
BPF_MAP_CREATE,
BPF_MAP_LOOKUP_ELEM,
BPF_MAP_UPDATE_ELEM,
BPF_MAP_DELETE_ELEM,
BPF_MAP_GET_NEXT_KEY,
create, free
lookup, update,
delete, get_next_key
netdevice
ops
(ndo_bpf)
Linux network
config lock
Device Control
message
handler
© 2018 NETRONOME SYSTEMS, INC. 23
Map Offload
● Maps reside entirely in device memory
● Programs running on the host do not have access to offloaded maps and vice
versa (because host cannot efficiently access device memory)
● User space API remains unchanged
Kernel NFP
offloaded
program
offloaded maps
XDP
maps
cls_bpf
bpfilter
PCIe
Ethernet
© 2018 NETRONOME SYSTEMS, INC. 24
Map Offload
● Each map in the kernel has set of ops associated:
● Each map type (array, hash, LRU, LPM, etc.) has its own set of ops which
implement the map specific logic
● If map_ifindex is set the ops are pointed to an empty set of “offload ops”
regardless of the type (bpf_offload_prog_ops)
● Only calls from user space will now be allowed
/* map is generic key/value storage optionally accessible by eBPF programs */
struct bpf_map_ops {
/* funcs callable from userspace (via syscall) */
int (*map_alloc_check)(union bpf_attr *attr);
struct bpf_map *(*map_alloc)(union bpf_attr *attr);
void (*map_release)(struct bpf_map *map, struct file *map_file);
void (*map_free)(struct bpf_map *map);
int (*map_get_next_key)(struct bpf_map *map, void *key, void *next_key);
/* funcs callable from userspace and from eBPF programs */
void *(*map_lookup_elem)(struct bpf_map *map, void *key);
int (*map_update_elem)(struct bpf_map *map, void *key, void *value, u64 flags);
int (*map_delete_elem)(struct bpf_map *map, void *key);
};
© 2018 NETRONOME SYSTEMS, INC. 25
Program Offload
● Kernel verifier performs verification and some of common JIT steps for the host
architectures
● For offload these steps cause loss of context information and are incompatible
with the target
● Allow device translator to access the loaded program as-is:
○ IDs/offsets not translated:
■ structure field offsets
■ functions
■ map IDs
○ No prolog/epilogue injected
○ No optimizations made
For offloaded devices the verifier skips the extra host-centric rewrites.
© 2018 NETRONOME SYSTEMS, INC. 26
Program Offload Lifecycle
kernel/
bpf/
syscall.c
kernel/
bpf/
offload.c
BPF
syscall
kernel/
bpf/
verifier.c
bpf_prog_offload_init()
allocate data structures
for tracking offload
device association
NFP
driver
bpf_prog_offload_-
-verifier_prep()
netdevice ops :: ndo_bpf()
BPF_OFFLOAD_VERIFIER_PREP
allocate and construct driver-
-specific program data structures
per-instruction
verification
callback
nfp_verify_insn()
perform extra dev-specific
checks; gather context
information
kernel/
bpf/
core.c
bpf_prog_offload_-
-translate()
BPF_OFFLOAD_TRANSLATE
run optimizations and machine code
generation
bpf_prog_offload_-
-destroy()
BPF_OFFLOAD_DESTROY
free all data structures and
machine code image
netdevice ops :: ndo_bpf()
© 2018 NETRONOME SYSTEMS, INC. 27
Program Offload
● After program has been loaded into the kernel the subsystem specific handling
remains unchanged
● For network programs offloaded program can be attached to device ingress to
XDP (BPF_PROG_TYPE_XDP) or cls_bpf (BPF_PROG_TYPE_SCHED_CLS)
● Program can be attached to any of the ports of device for which it was loaded
● Actually loading program to device memory only happens when it’s being
attached
© 2018 NETRONOME SYSTEMS, INC. 28
BPF Offload - Summary
● BPF VM/sandbox is well suited for a heterogeneous processing engine
● BPF offload allows loading a BPF program onto a device instead of host CPU
● All user space tooling and ABIs remain unchanged
● No vendor-specific APIs or SDKs
● BPF offload is part of the upstream Linux kernel (recent kernel required)
● BPF programs loaded onto device can take advantage of HW accelerators such
as HW memory lookup engines
● Try it out today on standard NFP server cards! (academic pricing available on open-nfp.org )
● Reach out with BPF-related questions:
○ https://help.netronome.com/a/forums/
○ https://groups.google.com/forum/#!forum/open-nfp
○ xdp-newbies@vger.kernel.org
● Register for the next webinar in this series!

More Related Content

What's hot

Introduction to eBPF and XDP
Introduction to eBPF and XDPIntroduction to eBPF and XDP
Introduction to eBPF and XDP
lcplcp1
 
High-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringHigh-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uring
ScyllaDB
 
Intel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsIntel DPDK Step by Step instructions
Intel DPDK Step by Step instructions
Hisaki Ohara
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
Andriy Berestovskyy
 
Dpdk applications
Dpdk applicationsDpdk applications
Dpdk applications
Vipin Varghese
 
eBPF Basics
eBPF BasicseBPF Basics
eBPF Basics
Michael Kehoe
 
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
 
Intel dpdk Tutorial
Intel dpdk TutorialIntel dpdk Tutorial
Intel dpdk Tutorial
Saifuddin Kaijar
 
Debug dpdk process bottleneck & painpoints
Debug dpdk process bottleneck & painpointsDebug dpdk process bottleneck & painpoints
Debug dpdk process bottleneck & painpoints
Vipin Varghese
 
What are latest new features that DPDK brings into 2018?
What are latest new features that DPDK brings into 2018?What are latest new features that DPDK brings into 2018?
What are latest new features that DPDK brings into 2018?
Michelle Holley
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
Kernel TLV
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
Brendan Gregg
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDP
Daniel T. Lee
 
Linux IO
Linux IOLinux IO
Linux IO
Liran Ben Haim
 
Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)
Brendan Gregg
 
Linux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringLinux Performance Profiling and Monitoring
Linux Performance Profiling and Monitoring
Georg Schönberger
 
DMA Survival Guide
DMA Survival GuideDMA Survival Guide
DMA Survival Guide
Kernel TLV
 
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of Software
Brendan Gregg
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
Ray Jenkins
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
Brendan Gregg
 

What's hot (20)

Introduction to eBPF and XDP
Introduction to eBPF and XDPIntroduction to eBPF and XDP
Introduction to eBPF and XDP
 
High-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringHigh-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uring
 
Intel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsIntel DPDK Step by Step instructions
Intel DPDK Step by Step instructions
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
 
Dpdk applications
Dpdk applicationsDpdk applications
Dpdk applications
 
eBPF Basics
eBPF BasicseBPF Basics
eBPF Basics
 
Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCBuilding Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCC
 
Intel dpdk Tutorial
Intel dpdk TutorialIntel dpdk Tutorial
Intel dpdk Tutorial
 
Debug dpdk process bottleneck & painpoints
Debug dpdk process bottleneck & painpointsDebug dpdk process bottleneck & painpoints
Debug dpdk process bottleneck & painpoints
 
What are latest new features that DPDK brings into 2018?
What are latest new features that DPDK brings into 2018?What are latest new features that DPDK brings into 2018?
What are latest new features that DPDK brings into 2018?
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDP
 
Linux IO
Linux IOLinux IO
Linux IO
 
Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)
 
Linux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringLinux Performance Profiling and Monitoring
Linux Performance Profiling and Monitoring
 
DMA Survival Guide
DMA Survival GuideDMA Survival Guide
DMA Survival Guide
 
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of Software
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
 

Similar to BPF Hardware Offload Deep Dive

BKK16-103 OpenCSD - Open for Business!
BKK16-103 OpenCSD - Open for Business!BKK16-103 OpenCSD - Open for Business!
BKK16-103 OpenCSD - Open for Business!
Linaro
 
Comprehensive XDP Off‌load-handling the Edge Cases
Comprehensive XDP Off‌load-handling the Edge CasesComprehensive XDP Off‌load-handling the Edge Cases
Comprehensive XDP Off‌load-handling the Edge Cases
Netronome
 
Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7
Kynetics
 
Lcu14 101- coresight overview
Lcu14 101- coresight overviewLcu14 101- coresight overview
Lcu14 101- coresight overview
Linaro
 
AMP Kynetics - ELC 2018 Portland
AMP  Kynetics - ELC 2018 PortlandAMP  Kynetics - ELC 2018 Portland
AMP Kynetics - ELC 2018 Portland
Kynetics
 
Asymmetric Multiprocessing - Kynetics ELC 2018 portland
Asymmetric Multiprocessing - Kynetics ELC 2018 portlandAsymmetric Multiprocessing - Kynetics ELC 2018 portland
Asymmetric Multiprocessing - Kynetics ELC 2018 portland
Nicola La Gloria
 
An Enhanced FPGA Based Asynchronous Microprocessor Design Using VIVADO and ISIM
An Enhanced FPGA Based Asynchronous Microprocessor Design Using VIVADO and ISIMAn Enhanced FPGA Based Asynchronous Microprocessor Design Using VIVADO and ISIM
An Enhanced FPGA Based Asynchronous Microprocessor Design Using VIVADO and ISIM
journalBEEI
 
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral IntegrationA 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
Talal Khaliq
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP Workshop
Linaro
 
Gl embedded starterkit_ethernet
Gl embedded starterkit_ethernetGl embedded starterkit_ethernet
Gl embedded starterkit_ethernet
Roman Brovko
 
LAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
LAS16-300: Mini Conference 2 Cortex-M Software - Device ConfigurationLAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
LAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
Linaro
 
NWU and HPC
NWU and HPCNWU and HPC
NWU and HPC
Wilhelm van Belkum
 
ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!
Affan Syed
 
Stream Processing
Stream ProcessingStream Processing
Stream Processing
arnamoy10
 
Transparent eBPF Offload: Playing Nice with the Linux Kernel
Transparent eBPF Offload: Playing Nice with the Linux KernelTransparent eBPF Offload: Playing Nice with the Linux Kernel
Transparent eBPF Offload: Playing Nice with the Linux Kernel
Open-NFP
 
Investigation report on 64 bit support and some of new features in aosp master
Investigation report on 64 bit support and some of new features in aosp masterInvestigation report on 64 bit support and some of new features in aosp master
Investigation report on 64 bit support and some of new features in aosp master
hidenorly
 
eBPF in the view of a storage developer
eBPF in the view of a storage developereBPF in the view of a storage developer
eBPF in the view of a storage developer
Richárd Kovács
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
Linaro
 
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
BPF  & Cilium - Turning Linux into a Microservices-aware Operating SystemBPF  & Cilium - Turning Linux into a Microservices-aware Operating System
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
Thomas Graf
 
chapter2-part1-140329134839-phpapp02.pptx
chapter2-part1-140329134839-phpapp02.pptxchapter2-part1-140329134839-phpapp02.pptx
chapter2-part1-140329134839-phpapp02.pptx
SangeetaTripathi8
 

Similar to BPF Hardware Offload Deep Dive (20)

BKK16-103 OpenCSD - Open for Business!
BKK16-103 OpenCSD - Open for Business!BKK16-103 OpenCSD - Open for Business!
BKK16-103 OpenCSD - Open for Business!
 
Comprehensive XDP Off‌load-handling the Edge Cases
Comprehensive XDP Off‌load-handling the Edge CasesComprehensive XDP Off‌load-handling the Edge Cases
Comprehensive XDP Off‌load-handling the Edge Cases
 
Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7
 
Lcu14 101- coresight overview
Lcu14 101- coresight overviewLcu14 101- coresight overview
Lcu14 101- coresight overview
 
AMP Kynetics - ELC 2018 Portland
AMP  Kynetics - ELC 2018 PortlandAMP  Kynetics - ELC 2018 Portland
AMP Kynetics - ELC 2018 Portland
 
Asymmetric Multiprocessing - Kynetics ELC 2018 portland
Asymmetric Multiprocessing - Kynetics ELC 2018 portlandAsymmetric Multiprocessing - Kynetics ELC 2018 portland
Asymmetric Multiprocessing - Kynetics ELC 2018 portland
 
An Enhanced FPGA Based Asynchronous Microprocessor Design Using VIVADO and ISIM
An Enhanced FPGA Based Asynchronous Microprocessor Design Using VIVADO and ISIMAn Enhanced FPGA Based Asynchronous Microprocessor Design Using VIVADO and ISIM
An Enhanced FPGA Based Asynchronous Microprocessor Design Using VIVADO and ISIM
 
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral IntegrationA 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
A 32-Bit Parameterized Leon-3 Processor with Custom Peripheral Integration
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP Workshop
 
Gl embedded starterkit_ethernet
Gl embedded starterkit_ethernetGl embedded starterkit_ethernet
Gl embedded starterkit_ethernet
 
LAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
LAS16-300: Mini Conference 2 Cortex-M Software - Device ConfigurationLAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
LAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
 
NWU and HPC
NWU and HPCNWU and HPC
NWU and HPC
 
ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!
 
Stream Processing
Stream ProcessingStream Processing
Stream Processing
 
Transparent eBPF Offload: Playing Nice with the Linux Kernel
Transparent eBPF Offload: Playing Nice with the Linux KernelTransparent eBPF Offload: Playing Nice with the Linux Kernel
Transparent eBPF Offload: Playing Nice with the Linux Kernel
 
Investigation report on 64 bit support and some of new features in aosp master
Investigation report on 64 bit support and some of new features in aosp masterInvestigation report on 64 bit support and some of new features in aosp master
Investigation report on 64 bit support and some of new features in aosp master
 
eBPF in the view of a storage developer
eBPF in the view of a storage developereBPF in the view of a storage developer
eBPF in the view of a storage developer
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
 
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
BPF  & Cilium - Turning Linux into a Microservices-aware Operating SystemBPF  & Cilium - Turning Linux into a Microservices-aware Operating System
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
 
chapter2-part1-140329134839-phpapp02.pptx
chapter2-part1-140329134839-phpapp02.pptxchapter2-part1-140329134839-phpapp02.pptx
chapter2-part1-140329134839-phpapp02.pptx
 

More from Netronome

Disaggregation a Primer: Optimizing design for Edge Cloud & Bare Metal applic...
Disaggregation a Primer: Optimizing design for Edge Cloud & Bare Metal applic...Disaggregation a Primer: Optimizing design for Edge Cloud & Bare Metal applic...
Disaggregation a Primer: Optimizing design for Edge Cloud & Bare Metal applic...
Netronome
 
LFSMM AF XDP Queue I-DS
LFSMM AF XDP Queue I-DSLFSMM AF XDP Queue I-DS
LFSMM AF XDP Queue I-DS
Netronome
 
LFSMM Verifier Optimizations and 1 M Instructions
LFSMM Verifier Optimizations and 1 M InstructionsLFSMM Verifier Optimizations and 1 M Instructions
LFSMM Verifier Optimizations and 1 M Instructions
Netronome
 
Using Network Acceleration for an Optimized Edge Cloud Server Architecture
Using Network Acceleration for an Optimized Edge Cloud Server ArchitectureUsing Network Acceleration for an Optimized Edge Cloud Server Architecture
Using Network Acceleration for an Optimized Edge Cloud Server Architecture
Netronome
 
Offloading TC Rules on OVS Internal Ports
Offloading TC Rules on OVS Internal Ports Offloading TC Rules on OVS Internal Ports
Offloading TC Rules on OVS Internal Ports
Netronome
 
Quality of Service Ingress Rate Limiting and OVS Hardware Offloads
Quality of Service Ingress Rate Limiting and OVS Hardware OffloadsQuality of Service Ingress Rate Limiting and OVS Hardware Offloads
Quality of Service Ingress Rate Limiting and OVS Hardware Offloads
Netronome
 
ODSA Sub-Project Launch
 ODSA Sub-Project Launch ODSA Sub-Project Launch
ODSA Sub-Project Launch
Netronome
 
Flexible and Scalable Domain-Specific Architectures
Flexible and Scalable Domain-Specific ArchitecturesFlexible and Scalable Domain-Specific Architectures
Flexible and Scalable Domain-Specific Architectures
Netronome
 
Unifying Network Filtering Rules for the Linux Kernel with eBPF
Unifying Network Filtering Rules for the Linux Kernel with eBPFUnifying Network Filtering Rules for the Linux Kernel with eBPF
Unifying Network Filtering Rules for the Linux Kernel with eBPF
Netronome
 
Massively Parallel RISC-V Processing with Transactional Memory
Massively Parallel RISC-V Processing with Transactional MemoryMassively Parallel RISC-V Processing with Transactional Memory
Massively Parallel RISC-V Processing with Transactional Memory
Netronome
 
Offloading Linux LAG Devices Via Open vSwitch and TC
Offloading Linux LAG Devices Via Open vSwitch and TCOffloading Linux LAG Devices Via Open vSwitch and TC
Offloading Linux LAG Devices Via Open vSwitch and TC
Netronome
 
eBPF Debugging Infrastructure - Current Techniques
eBPF Debugging Infrastructure - Current TechniqueseBPF Debugging Infrastructure - Current Techniques
eBPF Debugging Infrastructure - Current Techniques
Netronome
 
Efficient JIT to 32-bit Arches
Efficient JIT to 32-bit ArchesEfficient JIT to 32-bit Arches
Efficient JIT to 32-bit Arches
Netronome
 
eBPF & Switch Abstractions
eBPF & Switch AbstractionseBPF & Switch Abstractions
eBPF & Switch Abstractions
Netronome
 
eBPF Tooling and Debugging Infrastructure
eBPF Tooling and Debugging InfrastructureeBPF Tooling and Debugging Infrastructure
eBPF Tooling and Debugging Infrastructure
Netronome
 
Demystify eBPF JIT Compiler
Demystify eBPF JIT CompilerDemystify eBPF JIT Compiler
Demystify eBPF JIT Compiler
Netronome
 
P4 Introduction
P4 Introduction P4 Introduction
P4 Introduction
Netronome
 
Host Data Plane Acceleration: SmartNIC Deployment Models
Host Data Plane Acceleration: SmartNIC Deployment ModelsHost Data Plane Acceleration: SmartNIC Deployment Models
Host Data Plane Acceleration: SmartNIC Deployment Models
Netronome
 
The Power of SmartNICs
The Power of SmartNICsThe Power of SmartNICs
The Power of SmartNICs
Netronome
 
DPDK Support for New HW Offloads
DPDK Support for New HW OffloadsDPDK Support for New HW Offloads
DPDK Support for New HW Offloads
Netronome
 

More from Netronome (20)

Disaggregation a Primer: Optimizing design for Edge Cloud & Bare Metal applic...
Disaggregation a Primer: Optimizing design for Edge Cloud & Bare Metal applic...Disaggregation a Primer: Optimizing design for Edge Cloud & Bare Metal applic...
Disaggregation a Primer: Optimizing design for Edge Cloud & Bare Metal applic...
 
LFSMM AF XDP Queue I-DS
LFSMM AF XDP Queue I-DSLFSMM AF XDP Queue I-DS
LFSMM AF XDP Queue I-DS
 
LFSMM Verifier Optimizations and 1 M Instructions
LFSMM Verifier Optimizations and 1 M InstructionsLFSMM Verifier Optimizations and 1 M Instructions
LFSMM Verifier Optimizations and 1 M Instructions
 
Using Network Acceleration for an Optimized Edge Cloud Server Architecture
Using Network Acceleration for an Optimized Edge Cloud Server ArchitectureUsing Network Acceleration for an Optimized Edge Cloud Server Architecture
Using Network Acceleration for an Optimized Edge Cloud Server Architecture
 
Offloading TC Rules on OVS Internal Ports
Offloading TC Rules on OVS Internal Ports Offloading TC Rules on OVS Internal Ports
Offloading TC Rules on OVS Internal Ports
 
Quality of Service Ingress Rate Limiting and OVS Hardware Offloads
Quality of Service Ingress Rate Limiting and OVS Hardware OffloadsQuality of Service Ingress Rate Limiting and OVS Hardware Offloads
Quality of Service Ingress Rate Limiting and OVS Hardware Offloads
 
ODSA Sub-Project Launch
 ODSA Sub-Project Launch ODSA Sub-Project Launch
ODSA Sub-Project Launch
 
Flexible and Scalable Domain-Specific Architectures
Flexible and Scalable Domain-Specific ArchitecturesFlexible and Scalable Domain-Specific Architectures
Flexible and Scalable Domain-Specific Architectures
 
Unifying Network Filtering Rules for the Linux Kernel with eBPF
Unifying Network Filtering Rules for the Linux Kernel with eBPFUnifying Network Filtering Rules for the Linux Kernel with eBPF
Unifying Network Filtering Rules for the Linux Kernel with eBPF
 
Massively Parallel RISC-V Processing with Transactional Memory
Massively Parallel RISC-V Processing with Transactional MemoryMassively Parallel RISC-V Processing with Transactional Memory
Massively Parallel RISC-V Processing with Transactional Memory
 
Offloading Linux LAG Devices Via Open vSwitch and TC
Offloading Linux LAG Devices Via Open vSwitch and TCOffloading Linux LAG Devices Via Open vSwitch and TC
Offloading Linux LAG Devices Via Open vSwitch and TC
 
eBPF Debugging Infrastructure - Current Techniques
eBPF Debugging Infrastructure - Current TechniqueseBPF Debugging Infrastructure - Current Techniques
eBPF Debugging Infrastructure - Current Techniques
 
Efficient JIT to 32-bit Arches
Efficient JIT to 32-bit ArchesEfficient JIT to 32-bit Arches
Efficient JIT to 32-bit Arches
 
eBPF & Switch Abstractions
eBPF & Switch AbstractionseBPF & Switch Abstractions
eBPF & Switch Abstractions
 
eBPF Tooling and Debugging Infrastructure
eBPF Tooling and Debugging InfrastructureeBPF Tooling and Debugging Infrastructure
eBPF Tooling and Debugging Infrastructure
 
Demystify eBPF JIT Compiler
Demystify eBPF JIT CompilerDemystify eBPF JIT Compiler
Demystify eBPF JIT Compiler
 
P4 Introduction
P4 Introduction P4 Introduction
P4 Introduction
 
Host Data Plane Acceleration: SmartNIC Deployment Models
Host Data Plane Acceleration: SmartNIC Deployment ModelsHost Data Plane Acceleration: SmartNIC Deployment Models
Host Data Plane Acceleration: SmartNIC Deployment Models
 
The Power of SmartNICs
The Power of SmartNICsThe Power of SmartNICs
The Power of SmartNICs
 
DPDK Support for New HW Offloads
DPDK Support for New HW OffloadsDPDK Support for New HW Offloads
DPDK Support for New HW Offloads
 

Recently uploaded

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 

Recently uploaded (20)

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

BPF Hardware Offload Deep Dive

  • 1. © 2018 NETRONOME SYSTEMS, INC. Jakub Kicinski BPF Hardware Offload Deep Dive
  • 2. © 2018 NETRONOME SYSTEMS, INC. 2 BPF Sandbox ○ As a goal of BPF IR JITing of BPF IR to most RISC cores should be very easy ○ BPF VM provides a simple and well understood execution environment ○ Designed by Linux kernel-minded architects making sure there are no implementation details leaking into the definition of the VM and ABIs ○ Unlike higher level languages BPF is a intermediate representation (IR) which provides binary compatibility, it is a mechanism ○ BPF is extensible through helpers and maps allowing us to make use of special HW features (when gain justifies the effort)
  • 3. © 2018 NETRONOME SYSTEMS, INC. 3 BPF Ecosystem ○ Kernel infrastructure improves, including verifier/analyzer, JIT compilers for all common host architectures and some common embedded architectures like ARM or x86 ○ Linux kernel community is very active in extending performance and improving BPF feature set, with AF_XDP being a most recent example ○ Android APF targets smaller processors in mobile handsets for filtering wake ups from remote processors (most likely network interfaces) to improve battery life
  • 4. © 2018 NETRONOME SYSTEMS, INC. 4 BPF Universe r0 = 0 r2 = *(u32 *)(r1 + 4) r1 = *(u32 *)(r1 + 0) r3 = r1 r3 += 14 if r3 > r2 goto 7 r0 = 1 r2 = *(u8 *)(r1 + 12) if r2 != 34 goto 4 r1 = *(u8 *)(r1 + 13) r0 = 2 if r1 == 34 goto 1 r0 = 1 ... array LPM helpers data storage maps hash device perf event socket anchor maps program user space
  • 5. © 2018 NETRONOME SYSTEMS, INC. 5 r0 = 0 r2 = *(u32 *)(r1 + 4) r1 = *(u32 *)(r1 + 0) r3 = r1 r3 += 14 if r3 > r2 goto 7 r0 = 1 r2 = *(u8 *)(r1 + 12) if r2 != 34 goto 4 r1 = *(u8 *)(r1 + 13) r0 = 2 if r1 == 34 goto 1 r0 = 1 ... array LPM helpers data storage maps hash device perf event socket anchor maps program User space BPF Universe ● Translate the program code into device’s native machine code ○ Use advanced instructions ○ Optimize instruction scheduling ○ Optimize I/O ● Provide device-specific implementation of the helpers ● Use hardware accelerators for maps ○ Use of richer memory architectures ○ Algorithmic lookup engines ○ TCAMs ● Filter packets directly in the NIC ● Handle advanced switching/routing ● Application-specific packet reception policies
  • 6. © 2018 NETRONOME SYSTEMS, INC. 6 • Optimized for standard server based cloud data centers • Based on the Netronome Network Flow Processor 4xxx line • Low profile, half length PCIe form factor for all versions • Memory: 2GB DRAM • <25W Power, typical 15-20W
  • 7. © 2018 NETRONOME SYSTEMS, INC. 7 SoC Architecture-Conceptual Components 4x PCIe Gen 3x8 Multi-threaded transactional memory engines and accelerators optimized for network processing Flow processing cores distributed into ‘islands’ of 12 (up to 7 islands) ASIC based packet processors, crypto engines, etc… 14Tbps distributed fabric-crucial foundation for many core architecturesUp to 100 Gbps
  • 8. © 2018 NETRONOME SYSTEMS, INC. 8 NFP SoC Architecture
  • 9. © 2018 NETRONOME SYSTEMS, INC. 9 NFP SoC Architecture BPF maps BPF programs
  • 10. © 2018 NETRONOME SYSTEMS, INC. 10 NFP SoC Packet Flow
  • 11. © 2018 NETRONOME SYSTEMS, INC. 11 NFP SoC Packet Flow
  • 12. © 2018 NETRONOME SYSTEMS, INC. 12 NFP SoC Packet Flow
  • 13. © 2018 NETRONOME SYSTEMS, INC. 13 NFP SoC Packet Flow
  • 14. © 2018 NETRONOME SYSTEMS, INC. 14 NFP SoC Packet Flow
  • 15. © 2018 NETRONOME SYSTEMS, INC. 15 Memory Architecture - Latencies NIC Chip Island (x6 per Chip) CTM (256 KB) IMEM (4 MB) DRAM (2+GB) CLS (64 KB) Thread (x4 per Core) 800Mhz Core LMEM (1 KB) GPRs x50 BPF workers LMEM - 1-3 cycles CLS - 20-50 cycles CTM - 50-100 cycles IMEM - 150-250 cycles GPRS/xfer regs - 1 cycle DRAM - 150-500 cycles
  • 16. © 2018 NETRONOME SYSTEMS, INC. 16 Memory Architecture Thread 0 Thread 1 Thread 2 Dispatcher Thread Thread CPP Read X and Yield Yield CPP Write Y Yield Push Value X Pull Value Y Return Value Y Yield Yield Flow Processing Core Cluster Target Memory Multithreaded Transactional Memory Architecture Hides Latency
  • 17. © 2018 NETRONOME SYSTEMS, INC. 17 Kernel Offload - BPF Offload Memory Mapping NIC Chip Island (x6 per Chip) CTM (256 KB) IMEM(4 MB) DRAM (2+GB) CLS (64 KB) Thread (x4 per Core) 800Mhz Core LMEM (1 KB) GPRs 10 Registers (64-bit, 32-bit subregisters) 512 byte stack Maps, varying sizes Driver x50 BPF workers
  • 18. © 2018 NETRONOME SYSTEMS, INC. 18 Programming Model ● Program is written in standard manner ● LLVM compiled as normal ● iproute/tc/libbpf loads the program requesting offload ● The nfp_bpf_jit.c converts the BPF bytecode to NFP machine code (and we mean the actual machine code :)) ● Translation reuses a significant amount of verifier infrastructure
  • 19. © 2018 NETRONOME SYSTEMS, INC. 19 BPF Object Creation (maps) 1. Get map file descriptors: a. For existing maps - get access to a file descriptor: i. from bpffs (pinned map) - open a pseudo file ii. by ID - use BPF_MAP_GET_FD_BY_ID bpf syscall command b. Create new maps - BPF_MAP_CREATE bpf syscall command: union bpf_attr { struct { /* anonymous struct used by BPF_MAP_CREATE command */ __u32 map_type; /* one of enum bpf_map_type */ __u32 key_size; /* size of key in bytes */ __u32 value_size; /* size of value in bytes */ __u32 max_entries; /* max number of entries in a map */ __u32 map_flags; /* BPF_MAP_CREATE related * flags defined above. */ __u32 inner_map_fd; /* fd pointing to the inner map */ __u32 numa_node; /* numa node (effective only if * BPF_F_NUMA_NODE is set). */ char map_name[BPF_OBJ_NAME_LEN]; __u32 map_ifindex; /* ifindex of netdev to create on */ __u32 btf_fd; /* fd pointing to a BTF type data */ __u32 btf_key_type_id; /* BTF type_id of the key */ __u32 btf_value_type_id; /* BTF type_id of the value */ };
  • 20. © 2018 NETRONOME SYSTEMS, INC. 20 BPF object creation (programs) 1. Get program instructions; 2. Perform relocations (replace map references with file descriptors IDs); 3. Use BPF_PROG_LOAD to load the program; union bpf_attr { struct { /* anonymous struct used by BPF_PROG_LOAD command */ __u32 prog_type; /* one of enum bpf_prog_type */ __u32 insn_cnt; __aligned_u64 insns; __aligned_u64 license; __u32 log_level; /* verbosity level of verifier */ __u32 log_size; /* size of user buffer */ __aligned_u64 log_buf; /* user supplied buffer */ __u32 kern_version; /* checked when prog_type=kprobe */ __u32 prog_flags; char prog_name[BPF_OBJ_NAME_LEN]; __u32 prog_ifindex; /* ifindex of netdev to prep for */ /* For some prog types expected attach type must be known at * load time to verify attach type specific parts of prog * (context accesses, allowed helpers, etc). */ __u32 expected_attach_type; };
  • 21. © 2018 NETRONOME SYSTEMS, INC. 21 BPF Object Creation (libbpf) ● With libbpf use the extended attributes to set the ifindex: struct bpf_prog_load_attr { const char *file; enum bpf_prog_type prog_type; enum bpf_attach_type expected_attach_type; int ifindex; }; int bpf_prog_load_xattr(const struct bpf_prog_load_attr *attr, struct bpf_object **pobj, int *prog_fd); Normal kernel BPF ABIs are used, opt-in for offload by setting ifindex.
  • 22. © 2018 NETRONOME SYSTEMS, INC. 22 Map Offload kernel/ bpf/ syscall.c kernel/ bpf/ offload.c drivers/ net/ ethernet/ netronome/ nfp/ bpf/ struct bpf_map_dev_ops BPF syscall is offloaded ? BPF_MAP_CREATE, BPF_MAP_LOOKUP_ELEM, BPF_MAP_UPDATE_ELEM, BPF_MAP_DELETE_ELEM, BPF_MAP_GET_NEXT_KEY, create, free lookup, update, delete, get_next_key netdevice ops (ndo_bpf) Linux network config lock Device Control message handler
  • 23. © 2018 NETRONOME SYSTEMS, INC. 23 Map Offload ● Maps reside entirely in device memory ● Programs running on the host do not have access to offloaded maps and vice versa (because host cannot efficiently access device memory) ● User space API remains unchanged Kernel NFP offloaded program offloaded maps XDP maps cls_bpf bpfilter PCIe Ethernet
  • 24. © 2018 NETRONOME SYSTEMS, INC. 24 Map Offload ● Each map in the kernel has set of ops associated: ● Each map type (array, hash, LRU, LPM, etc.) has its own set of ops which implement the map specific logic ● If map_ifindex is set the ops are pointed to an empty set of “offload ops” regardless of the type (bpf_offload_prog_ops) ● Only calls from user space will now be allowed /* map is generic key/value storage optionally accessible by eBPF programs */ struct bpf_map_ops { /* funcs callable from userspace (via syscall) */ int (*map_alloc_check)(union bpf_attr *attr); struct bpf_map *(*map_alloc)(union bpf_attr *attr); void (*map_release)(struct bpf_map *map, struct file *map_file); void (*map_free)(struct bpf_map *map); int (*map_get_next_key)(struct bpf_map *map, void *key, void *next_key); /* funcs callable from userspace and from eBPF programs */ void *(*map_lookup_elem)(struct bpf_map *map, void *key); int (*map_update_elem)(struct bpf_map *map, void *key, void *value, u64 flags); int (*map_delete_elem)(struct bpf_map *map, void *key); };
  • 25. © 2018 NETRONOME SYSTEMS, INC. 25 Program Offload ● Kernel verifier performs verification and some of common JIT steps for the host architectures ● For offload these steps cause loss of context information and are incompatible with the target ● Allow device translator to access the loaded program as-is: ○ IDs/offsets not translated: ■ structure field offsets ■ functions ■ map IDs ○ No prolog/epilogue injected ○ No optimizations made For offloaded devices the verifier skips the extra host-centric rewrites.
  • 26. © 2018 NETRONOME SYSTEMS, INC. 26 Program Offload Lifecycle kernel/ bpf/ syscall.c kernel/ bpf/ offload.c BPF syscall kernel/ bpf/ verifier.c bpf_prog_offload_init() allocate data structures for tracking offload device association NFP driver bpf_prog_offload_- -verifier_prep() netdevice ops :: ndo_bpf() BPF_OFFLOAD_VERIFIER_PREP allocate and construct driver- -specific program data structures per-instruction verification callback nfp_verify_insn() perform extra dev-specific checks; gather context information kernel/ bpf/ core.c bpf_prog_offload_- -translate() BPF_OFFLOAD_TRANSLATE run optimizations and machine code generation bpf_prog_offload_- -destroy() BPF_OFFLOAD_DESTROY free all data structures and machine code image netdevice ops :: ndo_bpf()
  • 27. © 2018 NETRONOME SYSTEMS, INC. 27 Program Offload ● After program has been loaded into the kernel the subsystem specific handling remains unchanged ● For network programs offloaded program can be attached to device ingress to XDP (BPF_PROG_TYPE_XDP) or cls_bpf (BPF_PROG_TYPE_SCHED_CLS) ● Program can be attached to any of the ports of device for which it was loaded ● Actually loading program to device memory only happens when it’s being attached
  • 28. © 2018 NETRONOME SYSTEMS, INC. 28 BPF Offload - Summary ● BPF VM/sandbox is well suited for a heterogeneous processing engine ● BPF offload allows loading a BPF program onto a device instead of host CPU ● All user space tooling and ABIs remain unchanged ● No vendor-specific APIs or SDKs ● BPF offload is part of the upstream Linux kernel (recent kernel required) ● BPF programs loaded onto device can take advantage of HW accelerators such as HW memory lookup engines ● Try it out today on standard NFP server cards! (academic pricing available on open-nfp.org ) ● Reach out with BPF-related questions: ○ https://help.netronome.com/a/forums/ ○ https://groups.google.com/forum/#!forum/open-nfp ○ xdp-newbies@vger.kernel.org ● Register for the next webinar in this series!