Re: [net RFC] net/mlx4_en: Use frag stride in crossing page boundary condition

2018-06-20 Thread Eric Dumazet
On 06/20/2018 04:41 PM, Saeed Mahameed wrote: > > I see, I wanted to use _stride_ as grantee for how much a page frag can > grow, for example in mlx5 we need the whole stride to build_skb around > the frag, since we always need the trailer, but it is different in here > and we can avoid resour

Re: [net RFC] net/mlx4_en: Use frag stride in crossing page boundary condition

2018-06-20 Thread Saeed Mahameed
On Tue, 2018-06-19 at 17:25 -0700, Eric Dumazet wrote: > > On 06/19/2018 11:05 AM, Saeed Mahameed wrote: > > > this is only true for XDP setup, for non XDP max stride_size can > > only > > be around ~3k and only for mtu > ~6k > > > > For XDP setup you suggested: > > - priv->frag_in

Re: [net RFC] net/mlx4_en: Use frag stride in crossing page boundary condition

2018-06-19 Thread Eric Dumazet
On 06/19/2018 11:05 AM, Saeed Mahameed wrote: > this is only true for XDP setup, for non XDP max stride_size can only > be around ~3k and only for mtu > ~6k > > For XDP setup you suggested: > - priv->frag_info[0].frag_size = eff_mtu; > + priv->frag_info[0].frag_size

Re: [net RFC] net/mlx4_en: Use frag stride in crossing page boundary condition

2018-06-19 Thread Saeed Mahameed
On Thu, 2018-06-14 at 16:49 -0700, Eric Dumazet wrote: > > On 06/14/2018 02:04 PM, Saeed Mahameed wrote: > > > I was looking at the code without my fix :) > > > > with my fix: > > release = frags->page_offset + frag_info->frag_stride > PAGE_SIZE; > > > > for XDP: frag_info->frag_stride is PAGE_

Re: [net RFC] net/mlx4_en: Use frag stride in crossing page boundary condition

2018-06-14 Thread Eric Dumazet
On 06/14/2018 02:04 PM, Saeed Mahameed wrote: > I was looking at the code without my fix :) > > with my fix: > release = frags->page_offset + frag_info->frag_stride > PAGE_SIZE; > > for XDP: frag_info->frag_stride is PAGE_SIZE, so release will always be > true regardless of PAGE_SIZE. > > So

Re: [net RFC] net/mlx4_en: Use frag stride in crossing page boundary condition

2018-06-14 Thread Saeed Mahameed
On Thu, 2018-06-14 at 20:53 +, Saeed Mahameed wrote: > On Thu, 2018-06-14 at 13:47 -0700, sae...@mellanox.com wrote: > > On Thu, 2018-06-14 at 12:12 -0700, Eric Dumazet wrote: > > > > > > On 06/14/2018 11:56 AM, Saeed Mahameed wrote: > > > > > > > Interestingly for this exact frag_stride we d

Re: [net RFC] net/mlx4_en: Use frag stride in crossing page boundary condition

2018-06-14 Thread Saeed Mahameed
On Thu, 2018-06-14 at 13:47 -0700, sae...@mellanox.com wrote: > On Thu, 2018-06-14 at 12:12 -0700, Eric Dumazet wrote: > > > > On 06/14/2018 11:56 AM, Saeed Mahameed wrote: > > > > > Interestingly for this exact frag_stride we don't have an issue > > > :) > > > since it goes through a different c

Re: [net RFC] net/mlx4_en: Use frag stride in crossing page boundary condition

2018-06-14 Thread Saeed Mahameed
On Thu, 2018-06-14 at 12:12 -0700, Eric Dumazet wrote: > > On 06/14/2018 11:56 AM, Saeed Mahameed wrote: > > > Interestingly for this exact frag_stride we don't have an issue :) > > since it goes through a different condition branch > > (the page flipping thing): > > > > if (frag_info->frag_stri

Re: [net RFC] net/mlx4_en: Use frag stride in crossing page boundary condition

2018-06-14 Thread Eric Dumazet
On 06/14/2018 11:56 AM, Saeed Mahameed wrote: > Interestingly for this exact frag_stride we don't have an issue :) > since it goes through a different condition branch > (the page flipping thing): > > if (frag_info->frag_stride == PAGE_SIZE / 2) { > frags->page_offset ^= PAGE_SIZE / 2; >

Re: [net RFC] net/mlx4_en: Use frag stride in crossing page boundary condition

2018-06-14 Thread Saeed Mahameed
On Wed, 2018-06-13 at 19:30 -0700, Eric Dumazet wrote: > > On 06/13/2018 05:53 PM, Saeed Mahameed wrote: > > When a new rx packet arrives, the rx path will decide whether to > > reuse > > the same page or not according to the current rx frag page offset > > and > > frag size, i.e: > > release = fr

Re: [net RFC] net/mlx4_en: Use frag stride in crossing page boundary condition

2018-06-13 Thread Eric Dumazet
On 06/13/2018 05:53 PM, Saeed Mahameed wrote: > When a new rx packet arrives, the rx path will decide whether to reuse > the same page or not according to the current rx frag page offset and > frag size, i.e: > release = frags->page_offset + frag_info->frag_size > PAGE_SIZE; > > Martin debugged

[net RFC] net/mlx4_en: Use frag stride in crossing page boundary condition

2018-06-13 Thread Saeed Mahameed
When a new rx packet arrives, the rx path will decide whether to reuse the same page or not according to the current rx frag page offset and frag size, i.e: release = frags->page_offset + frag_info->frag_size > PAGE_SIZE; Martin debugged this and he showed that this can cause mlx4 XDP to reuse buf