Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-09 Thread Md. Islam
Gotcha. I'm working on it. I've created a function that creates sk_buff from xdp_buff. But still getting an error while the sk_buff is being processed by tcp. I will send you the patch once I'm done. Thanks! On Thu, Apr 5, 2018 at 10:55 PM, David Ahern wrote: > On 4/3/18 9:15

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-05 Thread David Ahern
On 4/3/18 9:15 PM, Md. Islam wrote: >> Have you looked at what I would consider a more interesting use case of >> packets into a node and delivered to a namespace via veth? >> >>+--+--- >>| Host | container >>|

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-04 Thread Md. Islam
On Wed, Apr 4, 2018 at 2:16 AM, Jesper Dangaard Brouer wrote: > > On Sun, 1 Apr 2018 20:47:28 -0400 Md. Islam" wrote: > >> [...] More specifically, header parsing and fib >> lookup only takes around 82 ns. This shows that this could be used to >> implement

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-04 Thread Jesper Dangaard Brouer
On Sun, 1 Apr 2018 20:47:28 -0400 Md. Islam" wrote: > [...] More specifically, header parsing and fib > lookup only takes around 82 ns. This shows that this could be used to > implement linerate packet forwarding in kernel. I cannot resist correcting you... You didn't

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-03 Thread Md. Islam
On Tue, Apr 3, 2018 at 9:16 PM, David Ahern wrote: > On 4/1/18 6:47 PM, Md. Islam wrote: >> This patch implements IPv4 forwarding on xdp_buff. I added a new >> config option XDP_ROUTER. Kernel would forward packets through fast >> path when this option is enabled. But it would

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-03 Thread David Ahern
On 4/1/18 6:47 PM, Md. Islam wrote: > This patch implements IPv4 forwarding on xdp_buff. I added a new > config option XDP_ROUTER. Kernel would forward packets through fast > path when this option is enabled. But it would require driver support. > Currently it only works with veth. Here I have

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-03 Thread David Ahern
On 4/3/18 11:37 AM, Alexei Starovoitov wrote: > On Tue, Apr 03, 2018 at 11:14:00AM -0600, David Ahern wrote: >> On 4/3/18 11:06 AM, Alexei Starovoitov wrote: For 3 and 4 above I was referring to the route lookup part of it; sorry for not being clear. For example, eth1 is

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-03 Thread Jesper Dangaard Brouer
On Tue, 3 Apr 2018 11:00:20 -0600 David Ahern wrote: > On 4/3/18 10:41 AM, John Fastabend wrote: > > On 04/03/2018 08:07 AM, David Ahern wrote: > >> On 4/2/18 12:16 PM, Alexei Starovoitov wrote: > >>> On Mon, Apr 02, 2018 at 12:09:44PM -0600, David Ahern wrote: >

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-03 Thread Alexei Starovoitov
On Tue, Apr 03, 2018 at 11:14:00AM -0600, David Ahern wrote: > On 4/3/18 11:06 AM, Alexei Starovoitov wrote: > >> For 3 and 4 above I was referring to the route lookup part of it; sorry > >> for not being clear. > >> > >> For example, eth1 is enslaved to bond1 which is in VRF red. The lookup > >>

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-03 Thread David Ahern
On 4/3/18 11:06 AM, Alexei Starovoitov wrote: >> For 3 and 4 above I was referring to the route lookup part of it; sorry >> for not being clear. >> >> For example, eth1 is enslaved to bond1 which is in VRF red. The lookup >> needs to go to the table associated with the VRF. That is not known by >>

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-03 Thread Alexei Starovoitov
On Tue, Apr 03, 2018 at 11:00:20AM -0600, David Ahern wrote: > On 4/3/18 10:41 AM, John Fastabend wrote: > > On 04/03/2018 08:07 AM, David Ahern wrote: > >> On 4/2/18 12:16 PM, Alexei Starovoitov wrote: > >>> On Mon, Apr 02, 2018 at 12:09:44PM -0600, David Ahern wrote: > On 4/2/18 12:03 PM,

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-03 Thread David Ahern
On 4/3/18 10:41 AM, John Fastabend wrote: > On 04/03/2018 08:07 AM, David Ahern wrote: >> On 4/2/18 12:16 PM, Alexei Starovoitov wrote: >>> On Mon, Apr 02, 2018 at 12:09:44PM -0600, David Ahern wrote: On 4/2/18 12:03 PM, John Fastabend wrote: > > Can the above be a normal BPF helper

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-03 Thread David Miller
From: John Fastabend Date: Tue, 3 Apr 2018 09:41:08 -0700 > On 04/03/2018 08:07 AM, David Ahern wrote: >> 4. What about other stacked devices - bonds and bridges - will those >> just work with the bpf helper? VRF is already handled of course. ;-) > > So if we simply

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-03 Thread John Fastabend
On 04/03/2018 08:07 AM, David Ahern wrote: > On 4/2/18 12:16 PM, Alexei Starovoitov wrote: >> On Mon, Apr 02, 2018 at 12:09:44PM -0600, David Ahern wrote: >>> On 4/2/18 12:03 PM, John Fastabend wrote: Can the above be a normal BPF helper that returns an ifindex? Then something

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-03 Thread David Ahern
On 4/2/18 12:16 PM, Alexei Starovoitov wrote: > On Mon, Apr 02, 2018 at 12:09:44PM -0600, David Ahern wrote: >> On 4/2/18 12:03 PM, John Fastabend wrote: >>> >>> Can the above be a normal BPF helper that returns an >>> ifindex? Then something roughly like this patter would >>> work for all drivers

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-02 Thread Alexei Starovoitov
On Mon, Apr 02, 2018 at 12:09:44PM -0600, David Ahern wrote: > On 4/2/18 12:03 PM, John Fastabend wrote: > > > > Can the above be a normal BPF helper that returns an > > ifindex? Then something roughly like this patter would > > work for all drivers with redirect support, > > > > > >

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-02 Thread David Ahern
On 4/2/18 12:03 PM, John Fastabend wrote: > > Can the above be a normal BPF helper that returns an > ifindex? Then something roughly like this patter would > work for all drivers with redirect support, > > > route_ifindex = ip_route_lookup(__daddr, ) > if (!route_ifindex) >

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-02 Thread John Fastabend
On 04/01/2018 05:47 PM, Md. Islam wrote: > This patch implements IPv4 forwarding on xdp_buff. I added a new > config option XDP_ROUTER. Kernel would forward packets through fast > path when this option is enabled. But it would require driver support. > Currently it only works with veth. Here I

Re: [PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-02 Thread Stephen Hemminger
On Sun, 1 Apr 2018 20:47:28 -0400 "Md. Islam" wrote: > This patch implements IPv4 forwarding on xdp_buff. I added a new > config option XDP_ROUTER. Kernel would forward packets through fast > path when this option is enabled. But it would require driver support. > Currently it

[PATCH v15 ] net/veth/XDP: Line-rate packet forwarding in kernel

2018-04-01 Thread Md. Islam
This patch implements IPv4 forwarding on xdp_buff. I added a new config option XDP_ROUTER. Kernel would forward packets through fast path when this option is enabled. But it would require driver support. Currently it only works with veth. Here I have modified veth such that it outputs xdp_buff. I