All of lore.kernel.org
 help / color / mirror / Atom feed
* Cannot load eBPF program as XDP
@ 2017-06-28  2:00 MD I. Islam
  2017-06-28  2:05 ` Y Song
  0 siblings, 1 reply; 10+ messages in thread
From: MD I. Islam @ 2017-06-28  2:00 UTC (permalink / raw)
  To: xdp-newbies

Hi

I'm using http://lingrok.org/xref/linux-net-next/samples/bpf/parse_simple.c.

I can load the program as tc_cls using following commands:

sudo tc qdisc add dev eno1 clsact
sudo tc filter add dev eno1  ingress bpf da obj parse_simple.o sec simple

But I get error when I load the same program in XDP:

sudo ip link set dev eno1 xdp obj parse_simple.o section simple

Prog section 'simple' rejected: Permission denied (13)!
 - Type:         6
 - Instructions: 23 (0 over limit)
 - License:      GPL

Verifier analysis:

0: (b7) r0 = 0
1: (61) r2 = *(u32 *)(r1 +80)
invalid bpf_context access off=80 size=4

Error fetching program/map!

I made sure that the parse_simple.o have necessary permission. Could
you please advise what is wrong here? I'm using Kernel 4.11+. Does XDP
need any specific kernel configuration enabled? clang and LLVM
versions are as following:

clang --version
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu

llc --version
LLVM (http://llvm.org/):
  LLVM version 3.8.0

  Optimized build.
  Built Jul  9 2016 (11:22:59).
  Default target: x86_64-pc-linux-gnu
  Host CPU: haswell

  Registered Targets:
    aarch64    - AArch64 (little endian)
    aarch64_be - AArch64 (big endian)
    amdgcn     - AMD GCN GPUs
    arm        - ARM
    arm64      - ARM64 (little endian)
    armeb      - ARM (big endian)
    bpf        - BPF (host endian)
    bpfeb      - BPF (big endian)
    bpfel      - BPF (little endian)
    cpp        - C++ backend
    hexagon    - Hexagon
    mips       - Mips
    mips64     - Mips64 [experimental]
    mips64el   - Mips64el [experimental]
    mipsel     - Mipsel
    msp430     - MSP430 [experimental]
    nvptx      - NVIDIA PTX 32-bit
    nvptx64    - NVIDIA PTX 64-bit
    ppc32      - PowerPC 32
    ppc64      - PowerPC 64
    ppc64le    - PowerPC 64 LE
    r600       - AMD GPUs HD2XXX-HD6XXX
    sparc      - Sparc
    sparcel    - Sparc LE
    sparcv9    - Sparc V9
    systemz    - SystemZ
    thumb      - Thumb
    thumbeb    - Thumb (big endian)
    x86        - 32-bit X86: Pentium-Pro and above
    x86-64     - 64-bit X86: EM64T and AMD64
    xcore      - XCore

Many thanks
Tamim

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-06-29 17:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-28  2:00 Cannot load eBPF program as XDP MD I. Islam
2017-06-28  2:05 ` Y Song
2017-06-28  2:32   ` MD I. Islam
2017-06-28  6:58     ` Y Song
2017-06-28  9:04     ` Daniel Borkmann
2017-06-28 22:40       ` MD I. Islam
2017-06-29  0:19         ` Daniel Borkmann
2017-06-29 17:42           ` Jesper Dangaard Brouer
2017-06-28 20:26     ` Jesper Dangaard Brouer
2017-06-29  0:09       ` MD I. Islam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.