[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <addf5abe-1683-d432-bf4b-e011ceba134c@huawei.com>
Date: Thu, 21 Sep 2023 19:59:23 +0800
From: Yunsheng Lin <linyunsheng@...wei.com>
To: Dima Tisnek <dimaqq@...il.com>
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>, Liang Chen
<liangchen.linux@...il.com>, Alexander Lobakin
<aleksander.lobakin@...el.com>, Jesper Dangaard Brouer <hawk@...nel.org>,
Ilias Apalodimas <ilias.apalodimas@...aro.org>, Eric Dumazet
<edumazet@...gle.com>, Jonathan Corbet <corbet@....net>, Alexei Starovoitov
<ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>, John Fastabend
<john.fastabend@...il.com>, <linux-doc@...r.kernel.org>,
<bpf@...r.kernel.org>
Subject: Re: [PATCH net-next v9 5/6] page_pool: update document about frag API
On 2023/9/21 9:02, Dima Tisnek wrote:
> Minor comment on natural language:
>
> On Wed, Sep 20, 2023 at 9:04 PM Yunsheng Lin <linyunsheng@...wei.com> wrote:
>>
>> As more drivers begin to use the frag API, update the
>> document about how to decide which API to use for the
>> driver author.
>
> the fragment API
>
>> +/**
>> + * page_pool_dev_alloc_frag() - allocate a page frag.
>
> allocate a page fragment.
>
> the precedent is set in
> https://www.kernel.org/doc/html/v5.0/vm/page_frags.html
> foo_frag is used in C code, and foo fragment in English docs.
Sure.
It seems I need to respin anyway as the newly merged idpf driver
from intel is also using the frag API, and removing PP_FLAG_PAGE_FRAG
flag breaks it.
And idpf driver really should be using the new API instead of
selecting which API to use according to the buf_size as below
in drivers/net/ethernet/intel/idpf/idpf_txrx.h, as it seems to
be assuming PAGE_SIZE always being 4K, and we may be able to
enable page split for buf_size > 2048 and PAGE_SIZE > 4K if using
the new API.
static inline dma_addr_t idpf_alloc_page(struct page_pool *pool,
struct idpf_rx_buf *buf,
unsigned int buf_size)
{
if (buf_size == IDPF_RX_BUF_2048)
buf->page = page_pool_dev_alloc_frag(pool, &buf->page_offset,
buf_size);
else
buf->page = page_pool_dev_alloc_pages(pool);
if (!buf->page)
return DMA_MAPPING_ERROR;
buf->truesize = buf_size;
return page_pool_get_dma_addr(buf->page) + buf->page_offset +
pool->p.offset;
}
>
> .
>
Powered by blists - more mailing lists