eBPF Offload to Hardware: cls_bpf and XDP Motivation - Avoiding - - PowerPoint PPT Presentation

ebpf offload to hardware cls bpf and xdp motivation
SMART_READER_LITE
LIVE PREVIEW

eBPF Offload to Hardware: cls_bpf and XDP Motivation - Avoiding - - PowerPoint PPT Presentation

eBPF Offload to Hardware: cls_bpf and XDP Motivation - Avoiding Whack-a-mole Motivation - Why eBPF? Target architecture (NFP based NIC) RX Path Flow of eBPF Packet The Flow Processing Core (Fully Programmable) Mapping eBPF -> NFP


slide-1
SLIDE 1

eBPF Offload to Hardware: cls_bpf and XDP

slide-2
SLIDE 2

Motivation - Avoiding Whack-a-mole

slide-3
SLIDE 3

Motivation - Why eBPF?

slide-4
SLIDE 4

Target architecture (NFP based NIC)

RX Path

slide-5
SLIDE 5

Flow of eBPF Packet

slide-6
SLIDE 6

The Flow Processing Core (Fully Programmable)

slide-7
SLIDE 7

Mapping eBPF -> NFP

slide-8
SLIDE 8

Programming Model

slide-9
SLIDE 9

Kernel basics (before)

user space kernel space

BPF syscall

  • program
  • type (sk filter, kprobe, cls, xdp)
  • license
  • ...

verifier

fd host JIT

tc TC

cls_bpf modification

XDP ctrl

fd verification fd driver

RX TX XDP BPF prog

slide-10
SLIDE 10

Kernel basics (flow no offload)

user space kernel space

BPF syscall

  • program
  • type (sk filter, kprobe, cls, xdp)
  • license
  • ...

verifier

fd host JIT

tc TC

cls_bpf modification

XDP ctrl

fd fd driver

RX TX XDP BPF prog s k b

verification

slide-11
SLIDE 11

Kernel basics (after)

user space kernel space

BPF syscall

  • program
  • type (sk filter, kprobe, cls, xdp)
  • license
  • ...

verifier

fd host JIT

tc TC

cls_bpf modification

XDP ctrl

  • ffload
  • bject

fd, skip_* flags verification fd, skip_* flags driver

RX TX XDP

ndo setup tc

HW JIT / translator

stats & maps

BPF prog

slide-12
SLIDE 12

Kernel basics (after)

user space kernel space

BPF syscall

  • program
  • type (sk filter, kprobe, cls, xdp)
  • license
  • ...

verifier

fd host JIT

tc TC

cls_bpf modification

XDP ctrl

  • ffload
  • bject

fd, skip_* flags fd, skip_* flags driver

RX TX XDP

ndo setup tc

HW JIT / translator

stats & maps

BPF prog

verification

slide-13
SLIDE 13

Kernel basics (flow with offload)

user space kernel space

BPF syscall

  • program
  • type (sk filter, kprobe, cls, xdp)
  • license
  • ...

verifier

fd host JIT

tc TC

cls_bpf modification

XDP ctrl

  • ffload
  • bject

fd, skip_* flags fd, skip_* flags driver

RX TX XDP

ndo setup tc

HW JIT / translator

stats & maps

BPF prog

fallback

stats metadata

verification

slide-14
SLIDE 14

Translation and loading

user space kernel space

BPF syscall

  • program
  • type (sk filter, kprobe, cls, xdp)
  • license
  • ...

verifier

fd host JIT

tc TC

cls_bpf modification

XDP ctrl

  • ffload
  • bject

fd, skip_* flags fd, skip_* flags driver

RX TX XDP

ndo setup tc

HW JIT / translator

stats & maps

BPF prog (1) Check HW capabilities and image parameters

verification

slide-15
SLIDE 15

Translation and loading

user space kernel space

BPF syscall

  • program
  • type (sk filter, kprobe, cls, xdp)
  • license
  • ...

verifier

fd host JIT

tc TC

cls_bpf modification

XDP ctrl

  • ffload
  • bject

fd, skip_* flags fd, skip_* flags driver

RX TX XDP

ndo setup tc

HW JIT / translator

stats & maps

BPF prog (1) Check HW capabilities and image parameters (2) Re-run the verifier

verification

slide-16
SLIDE 16

Translation and loading

user space kernel space

BPF syscall

  • program
  • type (sk filter, kprobe, cls, xdp)
  • license
  • ...

verifier

fd host JIT

tc TC

cls_bpf modification

XDP ctrl

  • ffload
  • bject

fd, skip_* flags fd, skip_* flags driver

RX TX XDP

ndo setup tc

HW JIT / translator

stats & maps

BPF prog (1) Check HW capabilities and image parameters (2) Re-run the verifier (3) Collect state/analyze

verification

slide-17
SLIDE 17

Translation and loading

user space kernel space

BPF syscall

  • program
  • type (sk filter, kprobe, cls, xdp)
  • license
  • ...

verifier

fd host JIT

tc TC

cls_bpf modification

XDP ctrl

  • ffload
  • bject

fd, skip_* flags fd, skip_* flags driver

RX TX XDP

ndo setup tc

HW JIT / translator

stats & maps

BPF prog (1) Check HW capabilities and image parameters (2) Re-run the verifier (3) Collect state/analyze (4) Optimize (5) JIT/generate image (6) Load image

verification

slide-18
SLIDE 18

Quick peek at the device path

device driver

RX TX XDP

ndo setup tc

HW JIT / translator

stats & maps kernel space

core core core core core core core Memory stats maps Data path core

packet data m descriptor ring bits in descriptors metadata in prepend

MAC0 MAC1 MAC2 MAC3

slide-19
SLIDE 19

Operations and actions (done or near/mid term)

device driver

RX TX XDP

ndo setup tc

HW JIT / translator

stats & maps kernel space

core core core core core core core Memory stats maps core

packet data m descriptor ring bits in descriptors metadata in prepend

MAC0 MAC1 MAC2 MAC3 Data Path

slide-20
SLIDE 20

Map plans and ideas

Use of map by offloaded program Map location Mechanism needed Read only Host + device copy update interception Read/write Device only update/read interception lock out map in kernel space Read + statistics gather update/read interception

  • use verifier to check access types;
  • add hooks in map code;
  • add netdevice for binding the map to the device;
  • read + statistics require further investigation;
  • nly allow read/write offload for skip-sw programs.
slide-21
SLIDE 21

Optimizations and verifier future work

slide-22
SLIDE 22

Demo Links to eBPF Webinar Start of Webinar: https://www.youtube.com/watch?v=apU5sg0Ui5U Start of Demo: https://youtu.be/apU5sg0Ui5U?t=2003 Also Check out: http://open-nfp.org/the-classroom/

slide-23
SLIDE 23

Summary

slide-24
SLIDE 24

Kernel basics (after)

user space kernel space

BPF syscall

  • program
  • type (sk filter, kprobe, cls, xdp)
  • license
  • ...

verifier

fd host JIT

tc TC

cls_bpf

driver

modification

RX path TX path XDP XDP ctrl

ndo setup tc

  • ffload
  • bject

fd, skip_* flags

HW JIT / translator

translation verification fd, skip_* flags

BPF prog