All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Mina Almasry <almasrymina@google.com>
Cc: netdev@vger.kernel.org, Pavel Begunkov <asml.silence@gmail.com>,
	Kaiyuan Zhang <kaiyuanz@google.com>,
	Willem de Bruijn <willemb@google.com>,
	Samiullah Khawaja <skhawaja@google.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>
Subject: Re: [PATCH net-next v3 4/5] page_pool: disable sync for cpu for dmabuf memory provider
Date: Tue, 10 Dec 2024 19:47:45 -0800	[thread overview]
Message-ID: <20241210194745.7a0a319e@kernel.org> (raw)
In-Reply-To: <20241209172308.1212819-5-almasrymina@google.com>

On Mon,  9 Dec 2024 17:23:07 +0000 Mina Almasry wrote:
> -static inline void page_pool_dma_sync_for_cpu(const struct page_pool *pool,
> -					      const struct page *page,
> -					      u32 offset, u32 dma_sync_size)
> +static inline void
> +page_pool_dma_sync_netmem_for_cpu(const struct page_pool *pool,
> +				  const netmem_ref netmem, u32 offset,
> +				  u32 dma_sync_size)
>  {
> +	if (pool->mp_priv)

Let's add a dedicated bit to skip sync. The io-uring support feels
quite close. Let's not force those guys to have to rejig this.

> +		return;
> +
>  	dma_sync_single_range_for_cpu(pool->p.dev,
> -				      page_pool_get_dma_addr(page),
> +				      page_pool_get_dma_addr_netmem(netmem),
>  				      offset + pool->p.offset, dma_sync_size,
>  				      page_pool_get_dma_dir(pool));
>  }
>  
> +static inline void page_pool_dma_sync_for_cpu(const struct page_pool *pool,
> +					      struct page *page, u32 offset,
> +					      u32 dma_sync_size)
> +{
> +	page_pool_dma_sync_netmem_for_cpu(pool, page_to_netmem(page), offset,
> +					  dma_sync_size);

I have the feeling Olek won't thank us for this extra condition and
bit clearing. If driver calls page_pool_dma_sync_for_cpu() we don't
have to check the new bit / mp_priv. Let's copy & paste the
dma_sync_single_range_for_cpu() call directly here.

  reply	other threads:[~2024-12-11  3:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-09 17:23 [PATCH net-next v3 0/5] devmem TCP fixes Mina Almasry
2024-12-09 17:23 ` [PATCH net-next v3 1/5] net: page_pool: rename page_pool_alloc_netmem to *_netmems Mina Almasry
2024-12-09 17:23 ` [PATCH net-next v3 2/5] net: page_pool: create page_pool_alloc_netmem Mina Almasry
2024-12-09 17:23 ` [PATCH net-next v3 3/5] page_pool: Set `dma_sync` to false for devmem memory provider Mina Almasry
2024-12-11  3:44   ` Jakub Kicinski
2024-12-09 17:23 ` [PATCH net-next v3 4/5] page_pool: disable sync for cpu for dmabuf " Mina Almasry
2024-12-11  3:47   ` Jakub Kicinski [this message]
2024-12-11 19:40     ` Mina Almasry
2024-12-09 17:23 ` [PATCH net-next v3 5/5] net: Document memory provider driver support Mina Almasry
2024-12-09 17:43   ` Randy Dunlap
2024-12-11  3:55   ` Jakub Kicinski
2024-12-11 17:53     ` Mina Almasry
2024-12-12  2:28       ` Jakub Kicinski
2024-12-13 17:50         ` Mina Almasry
2024-12-14  1:55           ` Jakub Kicinski

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=20241210194745.7a0a319e@kernel.org \
    --to=kuba@kernel.org \
    --cc=almasrymina@google.com \
    --cc=asml.silence@gmail.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=kaiyuanz@google.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=skhawaja@google.com \
    --cc=willemb@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.