DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] BUG: eBPF missing BPF_ABS
@ 2020-02-04 14:52 Stephen Hemminger
  2020-02-05 21:16 ` Ananyev, Konstantin
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2020-02-04 14:52 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev

As I mentioned in my FOSDEM talk the current DPDK eBPF handling is
not usable for packet filters. I have ported the classic BPF to eBPF code
and the generated code is not usable by DPDK.

The problem is that DPDK eBPF does not implement all the opcodes.
BPF_ABS is not implemented and must be. It is in the Linux kernel.

PCAP filter string: ip dst fosdem.org
cBPF program (6 insns):
 L0:	28 00 00 00 0c 00 00 00 ldh [12]
 L1:	15 00 00 03 00 08 00 00 jeq #0x800, L2, L5
 L2:	20 00 00 00 1e 00 00 00 ld [30]
 L3:	15 00 00 01 8c 16 16 1f jeq #0x1f16168c, L4, L5
 L4:	06 00 00 00 ff ff ff ff ret #0xffffffff
 L5:	06 00 00 00 00 00 00 00 ret #0x0
eBPF program (11 insns):
 L0:	af 00 00 00 00 00 00 00 xor r0, r0
 L1:	af 77 00 00 00 00 00 00 xor r7, r7
 L2:	bf 16 00 00 00 00 00 00 mov r6, r1
 L3:	28 70 00 00 0c 00 00 00 ldh r0, [12]
 L4:	55 00 04 00 00 08 00 00 jne r0, #0x800, L9
 L5:	20 70 00 00 1e 00 00 00 ldw r0, [30]
 L6:	55 00 02 00 8c 16 16 1f jne r0, #0x1f16168c, L9
 L7:	b4 00 00 00 01 00 00 00 mov32 r0, #0x1
 L8:	95 00 00 00 00 00 00 00 exit
 L9:	b4 00 00 00 02 00 00 00 mov32 r0, #0x2
 L10:	95 00 00 00 00 00 00 00 exit
validate: invalid opcode at pc: 3
validate: invalid opcode at pc: 5
rte_bpf_load failed: Invalid argument

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

end of thread, other threads:[~2020-02-06 10:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 14:52 [dpdk-dev] BUG: eBPF missing BPF_ABS Stephen Hemminger
2020-02-05 21:16 ` Ananyev, Konstantin
2020-02-06  4:22   ` Jerin Jacob
2020-02-06  8:54   ` Morten Brørup
2020-02-06  9:11     ` Stephen Hemminger
2020-02-06 10:16       ` Ananyev, Konstantin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).