[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a9d63917-27c2-b16f-ace5-ab26686a64b7@huawei.com>
Date: Sat, 27 May 2023 16:18:26 +0800
From: Yunsheng Lin <linyunsheng@...wei.com>
To: Ilias Apalodimas <ilias.apalodimas@...aro.org>
CC: <davem@...emloft.net>, <kuba@...nel.org>, <pabeni@...hat.com>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>, Lorenzo Bianconi
<lorenzo@...nel.org>, Alexander Duyck <alexander.duyck@...il.com>, Jesper
Dangaard Brouer <hawk@...nel.org>, Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH net-next 1/2] page_pool: unify frag page and non-frag page
handling
On 2023/5/26 23:38, Ilias Apalodimas wrote:
>>
>>> If that's the case isn't it a better idea to unify the functions entirely?
>>
>> As about, page_pool_alloc_frag() does seems to be a superset of
>> page_pool_alloc_pages() after this patchset as my understanding.
>> If the page_pool_alloc_frag() API turns out to be a good API for
>> the driver, maybe we can phase out *page_pool_alloc_pages() as
>> time goes by?
>
> Looking at patch 2/2 it seems a bit wasteful. At the moment only hns3 uses
> fragments and the length of the allocation seems static. But if someone
> else chooses to allocate a > 2048 packet why should it allocate a page?
It is based on the fact that if user requests a > 2048 frag, then it will
most likely requests > 2048 frag again, for example, when mtu is changed
or xdp is enabled/disabble, at least for veth case, the frag size is likely
changed.
Allocating a page for the above case avoid the frag count draining overhead,
and unify the interface for the driver so that driver don't need to choose
which API to use.
>
> I just think it's a bit confusing since we have a flag on the pool for page
> fragments, but then we violate it when it suits us.
Yes, we can remove it as mentioned in the cover letter:
"PP_FLAG_PAGE_FRAG may be removed after this patchset, and the
extra benefit is that driver does not need to handle the case
for arch with PAGE_POOL_DMA_USE_PP_FRAG_COUNT when using
page_pool_alloc_frag() API."
>
> Thanks
> /Ilias
> .
>
Powered by blists - more mailing lists