Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-18 Thread Alexei Starovoitov
On Mon, Jul 18, 2016 at 03:07:01PM +0200, Tom Herbert wrote: > On Mon, Jul 18, 2016 at 2:48 PM, Thomas Graf wrote: > > On 07/18/16 at 01:39pm, Tom Herbert wrote: > >> On Mon, Jul 18, 2016 at 11:10 AM, Thomas Graf wrote: > >> > I agree with that but I would like to keep the current per net_device

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-18 Thread Brenden Blanco
On Mon, Jul 18, 2016 at 01:39:02PM +0200, Tom Herbert wrote: > On Mon, Jul 18, 2016 at 11:10 AM, Thomas Graf wrote: > > On 07/15/16 at 10:49am, Tom Herbert wrote: [...] > >> To me, an XDP program is just another attribute of an RX queue, it's > >> really not special!. We already have a very good i

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-18 Thread Tom Herbert
On Mon, Jul 18, 2016 at 2:48 PM, Thomas Graf wrote: > On 07/18/16 at 01:39pm, Tom Herbert wrote: >> On Mon, Jul 18, 2016 at 11:10 AM, Thomas Graf wrote: >> > I agree with that but I would like to keep the current per net_device >> > atomic properties. >> >> I don't see that see that there is any

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-18 Thread Thomas Graf
On 07/18/16 at 01:39pm, Tom Herbert wrote: > On Mon, Jul 18, 2016 at 11:10 AM, Thomas Graf wrote: > > I agree with that but I would like to keep the current per net_device > > atomic properties. > > I don't see that see that there is any synchronization guarantees > using xchg. For instance, if t

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-18 Thread Tom Herbert
On Mon, Jul 18, 2016 at 11:10 AM, Thomas Graf wrote: > On 07/15/16 at 10:49am, Tom Herbert wrote: >> I'm really missing why having a program pointer per ring could be so >> complicated. This should just a matter of maintaining a pointer to the >> BPF program program in each RX queue. If we want to

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-18 Thread Thomas Graf
On 07/15/16 at 10:49am, Tom Herbert wrote: > I'm really missing why having a program pointer per ring could be so > complicated. This should just a matter of maintaining a pointer to the > BPF program program in each RX queue. If we want to latch together all > the rings to run the same program the

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-18 Thread Daniel Borkmann
On 07/18/2016 06:01 AM, Alexei Starovoitov wrote: On Fri, Jul 15, 2016 at 09:09:52PM +0200, Jesper Dangaard Brouer wrote: On Fri, 15 Jul 2016 09:47:46 -0700 Alexei Starovoitov wrote: On Fri, Jul 15, 2016 at 09:18:13AM -0700, Tom Herbert wrote: [..] We don't need extra comlexity of figuring

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-17 Thread Alexei Starovoitov
On Fri, Jul 15, 2016 at 09:09:52PM +0200, Jesper Dangaard Brouer wrote: > > On Fri, 15 Jul 2016 09:47:46 -0700 Alexei Starovoitov > wrote: > > On Fri, Jul 15, 2016 at 09:18:13AM -0700, Tom Herbert wrote: > [..] > > > > We don't need extra comlexity of figuring out number of rings and > > > > str

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-15 Thread Jesper Dangaard Brouer
On Fri, 15 Jul 2016 09:47:46 -0700 Alexei Starovoitov wrote: > On Fri, Jul 15, 2016 at 09:18:13AM -0700, Tom Herbert wrote: [..] > > > We don't need extra comlexity of figuring out number of rings and > > > struggling with lack of atomicity. > > > > We already have this problem with other per

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-15 Thread Jesper Dangaard Brouer
On Fri, 15 Jul 2016 11:08:06 -0700 Tom Herbert wrote: > On Thu, Jul 14, 2016 at 12:25 AM, Jesper Dangaard Brouer > wrote: > > > > I would really really like to see the XDP program associated with the > > RX ring queues, instead of a single XDP program covering the entire NIC. > > (Just move the

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-15 Thread Tom Herbert
On Thu, Jul 14, 2016 at 12:25 AM, Jesper Dangaard Brouer wrote: > > I would really really like to see the XDP program associated with the > RX ring queues, instead of a single XDP program covering the entire NIC. > (Just move the bpf_prog pointer to struct mlx4_en_rx_ring) > I think it would be he

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-15 Thread Tom Herbert
On Fri, Jul 15, 2016 at 9:47 AM, Alexei Starovoitov wrote: > On Fri, Jul 15, 2016 at 09:18:13AM -0700, Tom Herbert wrote: >> > attaching program to all rings at once is a fundamental part for correct >> > operation. As was pointed out in the past the bpf_prog pointer >> > in the ring design loses

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-15 Thread Alexei Starovoitov
On Fri, Jul 15, 2016 at 10:21:23AM +0200, Jesper Dangaard Brouer wrote: > > > > attaching program to all rings at once is a fundamental part for correct > > operation. As was pointed out in the past the bpf_prog pointer > > in the ring design loses atomicity of the update. While the new program is

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-15 Thread Alexei Starovoitov
On Fri, Jul 15, 2016 at 09:18:13AM -0700, Tom Herbert wrote: > > attaching program to all rings at once is a fundamental part for correct > > operation. As was pointed out in the past the bpf_prog pointer > > in the ring design loses atomicity of the update. While the new program is > > being attac

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-15 Thread Tom Herbert
On Thu, Jul 14, 2016 at 8:30 PM, Alexei Starovoitov wrote: > On Thu, Jul 14, 2016 at 09:25:43AM +0200, Jesper Dangaard Brouer wrote: >> >> I would really really like to see the XDP program associated with the >> RX ring queues, instead of a single XDP program covering the entire NIC. >> (Just move

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-15 Thread Jesper Dangaard Brouer
On Thu, 14 Jul 2016 20:30:59 -0700 Alexei Starovoitov wrote: > On Thu, Jul 14, 2016 at 09:25:43AM +0200, Jesper Dangaard Brouer wrote: > > > > I would really really like to see the XDP program associated with the > > RX ring queues, instead of a single XDP program covering the entire NIC. > > (J

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-14 Thread Alexei Starovoitov
On Thu, Jul 14, 2016 at 09:25:43AM +0200, Jesper Dangaard Brouer wrote: > > I would really really like to see the XDP program associated with the > RX ring queues, instead of a single XDP program covering the entire NIC. > (Just move the bpf_prog pointer to struct mlx4_en_rx_ring) > > So, why is

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-14 Thread Jesper Dangaard Brouer
I would really really like to see the XDP program associated with the RX ring queues, instead of a single XDP program covering the entire NIC. (Just move the bpf_prog pointer to struct mlx4_en_rx_ring) So, why is this so important? It is a fundamental architectural choice. With a single XDP prog

Re: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-13 Thread Brenden Blanco
On Wed, Jul 13, 2016 at 11:27:23AM +, David Laight wrote: > From: Brenden Blanco > > Sent: 12 July 2016 08:51 > > Add support for the BPF_PROG_TYPE_XDP hook in mlx4 driver. > > > > In tc/socket bpf programs, helpers linearize skb fragments as needed > > when the program touches the packet data

RE: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-13 Thread David Laight
From: Brenden Blanco > Sent: 12 July 2016 08:51 > Add support for the BPF_PROG_TYPE_XDP hook in mlx4 driver. > > In tc/socket bpf programs, helpers linearize skb fragments as needed > when the program touches the packet data. However, in the pursuit of > speed, XDP programs will not be allowed to

RE: [PATCH v8 04/11] net/mlx4_en: add support for fast rx drop bpf program

2016-07-12 Thread Tariq Toukan
>Add support for the BPF_PROG_TYPE_XDP hook in mlx4 driver. > >In tc/socket bpf programs, helpers linearize skb fragments as needed when the >program touches the packet data. However, in the pursuit of speed, XDP >programs will not be allowed to use these slower functions, especially if it >inv