On Thu, Dec 28, 2017 at 11:34 PM, David Ahern <dsahern@xxxxxxxxx> wrote: > On 12/28/17 9:37 PM, MD I. Islam wrote: >> Hi >> >> Is XDP designed for implementing packet forwarding? Is there an >> example of ipv4 forwarding the kernel? I don't find any example in >> samples/bpf/ directory. > > samples/bpf/xdp_router_ipv4_*.c > > I have a POC on using new helpers that allow BPF programs to leverage > kernel FIB and neighbor tables: > https://github.com/dsahern/linux/commits/bpf/xdp-fwding-wip > > It shows a 400% increase in forwarding. A lot of issues need to be > addressed, but it shows the intent. Thanks David! I see the intent. I understand the benefit of XDP compared to sk_buff. Could anyone explain why we need eBPF (in case I don't need to inject a program from userspace)? Why we don't implement XDP forwarding logic completely inside kernel? CETH [1] seems to be doing something like that but the code is not open source right now. Is there any other example like that? I'm planning to use XDP on a multi/many core CPU. I would like to implement the forwarding logic in as kernel thread. Then each CPU core (except one) would execute the kernel thread independently (as DPDK). That's why, I was wondering if forwarding logic can be implemented as a work_struct->func so that it can be executed through work_queue. Looking forward to your suggestions. 1. https://www.slideshare.net/IOVisor/ceth-for-xdp-linux-meetup-santa-clara-july-2016