Re: [PATCH net-next v6 2/2] page_pool: Track DMA-mapped pages and unmap them when destroying the pool

Toke Høiland-Jørgensen
2025-04-04T09:53:33Z

Jakub Kicinski <kuba@kernel.org> writes:

> On Tue, 01 Apr 2025 11:27:19 +0200 Toke Høiland-Jørgensen wrote:
>> + if (err) {
>> + WARN_ONCE(1, "couldn't track DMA mapping, please report to netdev@");
>> goto unmap_failed;
>
> FWIW I second Pavel's concern about the warning being too drastic.
> I have the feeling Meta's fleet will hit this.
> How about WARN_ONCE(err != -ENOMEM, ... ? I presume you care mostly
> about the array filling up so -EBUSY

Ah yes, that's a good solution, will do!

>> + }
>>
>> + if (page_pool_set_dma_addr_netmem(netmem, dma)) {
>> + WARN_ONCE(1, "unexpected DMA address, please report to netdev@");
>> + goto unmap_failed;
>> + }
>
> I think this is ever so slightly leaking the id, if it ever happens?

Good catch! Will swap the order of the operations.

-Toke