From: Jakub Kicinski <kuba@kernel.org>
To: Yunsheng Lin <linyunsheng@huawei.com>
Cc: John Daley <johndale@cisco.com>, <benve@cisco.com>,
<satishkh@cisco.com>, <andrew+netdev@lunn.ch>,
<davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>,
<netdev@vger.kernel.org>, Nelson Escobar <neescoba@cisco.com>
Subject: Re: [PATCH net-next v3 4/6] enic: Use the Page Pool API for RX when MTU is less than page size
Date: Mon, 30 Dec 2024 08:44:49 -0800 [thread overview]
Message-ID: <20241230084449.545b746f@kernel.org> (raw)
In-Reply-To: <ef5266a0-6d7a-4327-be7c-11f46f8d1074@huawei.com>
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..
next prev parent reply other threads:[~2024-12-30 16:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-28 0:10 [PATCH net-next v3 0/6] enic: Use Page Pool API for receiving packets John Daley
2024-12-28 0:10 ` [PATCH net-next v3 1/6] enic: Refactor RX path common code into helper functions John Daley
2024-12-28 0:10 ` [PATCH net-next v3 2/6] enic: Remove an unnecessary parameter from function enic_queue_rq_desc John Daley
2024-12-28 0:10 ` [PATCH net-next v3 3/6] enic: Use function pointers for buf alloc, free and RQ service John Daley
2024-12-28 0:10 ` [PATCH net-next v3 4/6] enic: Use the Page Pool API for RX when MTU is less than page size John Daley
2024-12-30 9:18 ` Yunsheng Lin
2024-12-30 16:44 ` Jakub Kicinski [this message]
2024-12-31 11:37 ` Yunsheng Lin
2025-01-01 0:42 ` Jakub Kicinski
2025-01-03 18:40 ` John Daley
2024-12-28 0:10 ` [PATCH net-next v3 5/6] enic: Move RX coalescing set function John Daley
2024-12-28 0:10 ` [PATCH net-next v3 6/6] enic: Obtain the Link speed only after the link comes up John Daley
2024-12-28 0:36 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241230084449.545b746f@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=benve@cisco.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=johndale@cisco.com \
--cc=linyunsheng@huawei.com \
--cc=neescoba@cisco.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=satishkh@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).