Re: [net RFC] net/mlx4_en: Use frag stride in crossing page boundary condition
From: Saeed Mahameed <hidden>
Date: 2018-06-19 18:05:30
On Thu, 2018-06-14 at 16:49 -0700, Eric Dumazet wrote:
On 06/14/2018 02:04 PM, Saeed Mahameed wrote:quoted
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 i guess i didn't quite understand your PowerPC concern.. can you elaborate ?So your maths with PAGE_SIZE=65536 and MTU 9000 frag_stride is about 9344 So if the last chunk of the page has 9100 bytes, we wont be able to use it, while really we should be able to use it.
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 = PAGE_SIZE; currently the condition is: release = frags->page_offset + frag_info->frag_size > PAGE_SIZE; so my solution and yours have the same problem you described above. the problem is not with the initial values or with stride/farg size math, it just that in XDP we shouldn't reuse at ALL. I agree with you that we need to optimize and maybe for PAGE_SIZE > 8k we need to allow XDP setup to reuses. but for now there is a data corruption to handle.