[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e76f0903-b85f-4a22-a5c6-b42c04b5fb95@davidwei.uk>
Date: Tue, 10 Dec 2024 08:31:48 -0800
From: David Wei <dw@...idwei.uk>
To: Jakub Kicinski <kuba@...nel.org>
Cc: io-uring@...r.kernel.org, netdev@...r.kernel.org,
Jens Axboe <axboe@...nel.dk>, Pavel Begunkov <asml.silence@...il.com>,
Paolo Abeni <pabeni@...hat.com>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jesper Dangaard Brouer
<hawk@...nel.org>, David Ahern <dsahern@...nel.org>,
Mina Almasry <almasrymina@...gle.com>,
Stanislav Fomichev <stfomichev@...il.com>, Joe Damato <jdamato@...tly.com>,
Pedro Tammela <pctammela@...atatu.com>
Subject: Re: [PATCH net-next v8 03/17] net: page_pool: create hooks for custom
page providers
On 2024-12-09 19:02, Jakub Kicinski wrote:
> On Wed, 4 Dec 2024 09:21:42 -0800 David Wei wrote:
>> diff --git a/net/core/page_pool.c b/net/core/page_pool.c
>> index f89cf93f6eb4..36f61a1e4ffe 100644
>> --- a/net/core/page_pool.c
>> +++ b/net/core/page_pool.c
>> @@ -284,10 +284,11 @@ static int page_pool_init(struct page_pool *pool,
>> rxq = __netif_get_rx_queue(pool->slow.netdev,
>> pool->slow.queue_idx);
>> pool->mp_priv = rxq->mp_params.mp_priv;
>> + pool->mp_ops = rxq->mp_params.mp_ops;
>> }
>>
>> - if (pool->mp_priv) {
>> - err = mp_dmabuf_devmem_init(pool);
>> + if (pool->mp_ops) {
>
> Can we throw in a:
>
> if (WARN_ON(!is_kernel_rodata((unsigned long)pool->mp_ops)))
> goto free_ptr_ring;
>
> here, to avoid any abuse?
Sounds good, I'll add it.
>
>> + err = pool->mp_ops->init(pool);
>> if (err) {
>> pr_warn("%s() mem-provider init failed %d\n", __func__,
>> err);
Powered by blists - more mailing lists