lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <731d74c2-7cc6-4d60-a2a4-c451d399e442@huawei.com>
Date: Tue, 31 Dec 2024 19:37:12 +0800
From: Yunsheng Lin <linyunsheng@...wei.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: John Daley <johndale@...co.com>, <benve@...co.com>, <satishkh@...co.com>,
	<andrew+netdev@...n.ch>, <davem@...emloft.net>, <edumazet@...gle.com>,
	<pabeni@...hat.com>, <netdev@...r.kernel.org>, Nelson Escobar
	<neescoba@...co.com>
Subject: Re: [PATCH net-next v3 4/6] enic: Use the Page Pool API for RX when
 MTU is less than page size

On 2024/12/31 0:44, Jakub Kicinski wrote:
> On Mon, 30 Dec 2024 17:18:39 +0800 Yunsheng Lin wrote:
>> On 2024/12/28 8:10, John Daley wrote:
>>> +void enic_rq_free_page(struct vnic_rq *vrq, struct vnic_rq_buf *buf)
>>> +{
>>> +	struct enic *enic = vnic_dev_priv(vrq->vdev);
>>> +	struct enic_rq *rq = &enic->rq[vrq->index];
>>> +
>>> +	if (!buf->os_buf)
>>> +		return;
>>> +
>>> +	page_pool_put_page(rq->pool, (struct page *)buf->os_buf,
>>> +			   get_max_pkt_len(enic), true);  
>>
>> It seems the above has a similar problem of not using
>> page_pool_put_full_page() when page_pool_dev_alloc() API is used and
>> page_pool is created with PP_FLAG_DMA_SYNC_DEV flags.
>>
>> It seems like a common mistake that a WARN_ON might be needed to catch
>> this kind of problem.
> 
> Agreed. Maybe also add an alias to page_pool_put_full_page() called
> something like page_pool_dev_put_page() to correspond to the alloc
> call? I suspect people don't understand the internals and "releasing
> full page" feels wrong when they only allocated a portion..

Yes, I guess so too.
But as all the alloc APIs have the 'dev' version of API:
page_pool_dev_alloc
page_pool_dev_alloc_frag
page_pool_dev_alloc_pages
page_pool_dev_alloc_va

Only adding 'dev' does not seem to clear the confusion from API naming
perspective.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ