From: Jakub Kicinski <kuba@kernel.org>
To: Praveen Kaligineedi <pkaligineedi@google.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, willemb@google.com, jeroendb@google.com,
shailend@google.com, hramamurthy@google.com,
ziweixiao@google.com
Subject: Re: [PATCH net-next 2/2] gve: adopt page pool for DQ RDA mode
Date: Wed, 11 Sep 2024 17:51:53 -0700 [thread overview]
Message-ID: <20240911175153.1a84a28b@kernel.org> (raw)
In-Reply-To: <20240910175315.1334256-3-pkaligineedi@google.com>
On Tue, 10 Sep 2024 10:53:15 -0700 Praveen Kaligineedi wrote:
> +static int gve_alloc_from_page_pool(struct gve_rx_ring *rx, struct gve_rx_buf_state_dqo *buf_state)
> +{
> + struct gve_priv *priv = rx->gve;
> + struct page *page;
> +
> + buf_state->page_info.buf_size = priv->data_buffer_size_dqo;
> + page = page_pool_alloc(rx->dqo.page_pool, &buf_state->page_info.page_offset,
> + &buf_state->page_info.buf_size, GFP_ATOMIC);
> +
> + if (!page) {
> + priv->page_alloc_fail++;
Is this counter global to the device? No locking or atomicity needed?
> +struct page_pool *gve_rx_create_page_pool(struct gve_priv *priv, struct gve_rx_ring *rx)
> +{
> + struct page_pool_params pp = {
> + .flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV,
> + .order = 0,
> + .pool_size = GVE_PAGE_POOL_SIZE_MULTIPLIER * priv->rx_desc_cnt,
> + .dev = &priv->pdev->dev,
> + .netdev = priv->dev,
> + .max_len = PAGE_SIZE,
> + .dma_dir = DMA_FROM_DEVICE,
Can the allocation run from process context in parallel with the NAPI
that uses the pool? It's uncommon for drivers to do that. If not you
can set the NAPI pointer here and get lock-free recycling.
> + };
> +
> + return page_pool_create(&pp);
> +}
Could you make sure to wrap the new code at 80 chars?
./scripts/checkpatch.pl --strict --max-line-length=80
--
pw-bot: cr
prev parent reply other threads:[~2024-09-12 0:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-10 17:53 [PATCH net-next 0/2] gve: adopt page pool Praveen Kaligineedi
2024-09-10 17:53 ` [PATCH net-next 1/2] gve: move DQO rx buffer management related code to a new file Praveen Kaligineedi
2024-09-10 17:53 ` [PATCH net-next 2/2] gve: adopt page pool for DQ RDA mode Praveen Kaligineedi
2024-09-11 0:41 ` Nelson, Shannon
2024-09-12 0:51 ` Jakub Kicinski [this message]
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=20240911175153.1a84a28b@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hramamurthy@google.com \
--cc=jeroendb@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pkaligineedi@google.com \
--cc=shailend@google.com \
--cc=willemb@google.com \
--cc=ziweixiao@google.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).