[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <77a87572d82deef1e035ec3b36027e8f6e0c1ea2.camel@mellanox.com>
Date: Thu, 14 Jun 2018 21:04:33 +0000
From: Saeed Mahameed <saeedm@...lanox.com>
To: "eric.dumazet@...il.com" <eric.dumazet@...il.com>,
"kafai@...com" <kafai@...com>, Tariq Toukan <tariqt@...lanox.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"edumazet@...gle.com" <edumazet@...gle.com>
Subject: Re: [net RFC] net/mlx4_en: Use frag stride in crossing page boundary
condition
On Thu, 2018-06-14 at 20:53 +0000, Saeed Mahameed wrote:
> On Thu, 2018-06-14 at 13:47 -0700, saeedm@...lanox.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 condition branch
> > > > (the page flipping thing):
> > > >
> > > > if (frag_info->frag_stride == PAGE_SIZE / 2) {
> > > > frags->page_offset ^= PAGE_SIZE / 2;
> > > > release = page_count(page) != 1 ||
> > > > page_is_pfmemalloc(page) ||
> > > > page_to_nid(page) != numa_mem_id();
> > > >
> > >
> > > I guess you forgot to test on PowerPC where PAGE_SIZE=65536 ?
> > >
> > > On PowerPC, the first branch is never taken.
> > >
>
> Oh, sorry i see where you are going with this, you mean for xdp in
> the
> other branch we need to take care of PAGE_SIZE > 4k ..
>
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 ?
> You are totally right, good catch! I will have to figure this out :)
> ..
>
> >
> > This code is already in the driver, i guess as optimization for
> > when
> > a
> > page can be reused only twice (PAGE_SIZE=4K, strides_size = 2k).
> > frag_stride is never more than 2k.
> >
> > for power PC we should always take the other branch which will
> > reuse
> > as
> > much 2k strides as possible in a page regardless of PAGE_SIZE.
> >
> > so are we good with my change ?
> >
Powered by blists - more mailing lists