Re: [net-next, PATCH 1/2, v3] net: socionext: different approach on DMA

2018-10-01 Thread Jesper Dangaard Brouer
On Mon, 1 Oct 2018 17:37:06 +0300 Ilias Apalodimas wrote: > On Mon, Oct 01, 2018 at 03:48:45PM +0200, Jesper Dangaard Brouer wrote: > > On Mon, 1 Oct 2018 14:20:21 +0300 > > Ilias Apalodimas wrote: > > > > > On Mon, Oct 01, 2018 at 01:03:13PM +0200, Jesper Dangaard Brouer wrote: > > > > On

Re: [net-next, PATCH 1/2, v3] net: socionext: different approach on DMA

2018-10-01 Thread Ilias Apalodimas
On Mon, Oct 01, 2018 at 03:48:45PM +0200, Jesper Dangaard Brouer wrote: > On Mon, 1 Oct 2018 14:20:21 +0300 > Ilias Apalodimas wrote: > > > On Mon, Oct 01, 2018 at 01:03:13PM +0200, Jesper Dangaard Brouer wrote: > > > On Mon, 1 Oct 2018 12:56:58 +0300 > > > Ilias Apalodimas wrote: > > > > >

Re: [net-next, PATCH 1/2, v3] net: socionext: different approach on DMA

2018-10-01 Thread Jesper Dangaard Brouer
On Mon, 1 Oct 2018 14:20:21 +0300 Ilias Apalodimas wrote: > On Mon, Oct 01, 2018 at 01:03:13PM +0200, Jesper Dangaard Brouer wrote: > > On Mon, 1 Oct 2018 12:56:58 +0300 > > Ilias Apalodimas wrote: > > > > > > > #2: You have allocations on the XDP fast-path. > > > > > > > > > > The REAL

Re: [net-next, PATCH 1/2, v3] net: socionext: different approach on DMA

2018-10-01 Thread Ilias Apalodimas
On Mon, Oct 01, 2018 at 01:03:13PM +0200, Jesper Dangaard Brouer wrote: > On Mon, 1 Oct 2018 12:56:58 +0300 > Ilias Apalodimas wrote: > > > > > #2: You have allocations on the XDP fast-path. > > > > > > > > The REAL secret behind the XDP performance is to avoid allocations on > > > > the

Re: [net-next, PATCH 1/2, v3] net: socionext: different approach on DMA

2018-10-01 Thread Jesper Dangaard Brouer
On Mon, 1 Oct 2018 12:56:58 +0300 Ilias Apalodimas wrote: > > > #2: You have allocations on the XDP fast-path. > > > > > > The REAL secret behind the XDP performance is to avoid allocations on > > > the fast-path. While I just told you to use the page-allocator and > > > order-0 pages, this

Re: [net-next, PATCH 1/2, v3] net: socionext: different approach on DMA

2018-10-01 Thread Ilias Apalodimas
> > #2: You have allocations on the XDP fast-path. > > > > The REAL secret behind the XDP performance is to avoid allocations on > > the fast-path. While I just told you to use the page-allocator and > > order-0 pages, this will actually kill performance. Thus, to make this > > fast, you need a

Re: [net-next, PATCH 1/2, v3] net: socionext: different approach on DMA

2018-10-01 Thread Ilias Apalodimas
On Mon, Oct 01, 2018 at 11:26:31AM +0200, Jesper Dangaard Brouer wrote: > > On Sat, 29 Sep 2018 14:28:01 +0300 Ilias Apalodimas > wrote: > > > +static void *netsec_alloc_rx_data(struct netsec_priv *priv, > > + dma_addr_t *dma_handle, u16 *desc_len) > > +{ > > +

Re: [net-next, PATCH 1/2, v3] net: socionext: different approach on DMA

2018-10-01 Thread Jesper Dangaard Brouer
On Sat, 29 Sep 2018 14:28:01 +0300 Ilias Apalodimas wrote: > +static void *netsec_alloc_rx_data(struct netsec_priv *priv, > + dma_addr_t *dma_handle, u16 *desc_len) > +{ > + size_t len = priv->ndev->mtu + ETH_HLEN + 2 * VLAN_HLEN + NET_SKB_PAD + > +

[net-next, PATCH 1/2, v3] net: socionext: different approach on DMA

2018-09-29 Thread Ilias Apalodimas
Current driver dynamically allocates an skb and maps it as DMA rx buffer. A following patch introduces XDP functionality, so we need a different allocation scheme. Buffers are allocated dynamically and mapped into hardware. During the Rx operation the driver uses build_skb() to produce the