All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@google.com>
To: Alexander Lobakin <aleksander.lobakin@intel.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	 Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: Kuniyuki Iwashima <kuniyu@google.com>,
	Kuniyuki Iwashima <kuni1840@gmail.com>,
	intel-wired-lan@lists.osuosl.org
Subject: [PATCH v1 iwl-next 4/5] libeth: Allow opting out of page_pool DMA mapping on Rx.
Date: Wed,  2 Dec 2026 15:57:22 +0900	[thread overview]
Message-ID: <20261202065737.207610-5-kuniyu@google.com> (raw)
In-Reply-To: <20261202065737.207610-1-kuniyu@google.com>

libeth_rx_fq_create() always configures PP_FLAG_DMA_MAP and
PP_FLAG_DMA_SYNC_DEV, so drivers cannot manage page_pool DMA
mappings themselves.

Let's add a no_dma_map flag to struct libeth_fq to omit
PP_FLAG_DMA_MAP and PP_FLAG_DMA_SYNC_DEV.

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
---
 drivers/net/ethernet/intel/libeth/rx.c | 3 ++-
 include/net/libeth/rx.h                | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/libeth/rx.c b/drivers/net/ethernet/intel/libeth/rx.c
index 0c1a565a1b3a..c9ab17b16fef 100644
--- a/drivers/net/ethernet/intel/libeth/rx.c
+++ b/drivers/net/ethernet/intel/libeth/rx.c
@@ -153,7 +153,8 @@ int libeth_rx_fq_create(struct libeth_fq *fq, void *napi_dev)
 {
 	struct napi_struct *napi = fq->no_napi ? NULL : napi_dev;
 	struct page_pool_params pp = {
-		.flags		= PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV,
+		.flags		= fq->no_dma_map ? 0 :
+				  (PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV),
 		.order		= LIBETH_RX_PAGE_ORDER,
 		.pool_size	= fq->count,
 		.nid		= fq->nid,
diff --git a/include/net/libeth/rx.h b/include/net/libeth/rx.h
index 1333850f421a..9e721cf2aac6 100644
--- a/include/net/libeth/rx.h
+++ b/include/net/libeth/rx.h
@@ -70,6 +70,7 @@ enum libeth_fqe_type {
  * @hsplit: flag whether header split is enabled
  * @xdp: flag indicating whether XDP is enabled
  * @no_napi: the queue is not a data queue and does not have NAPI
+ * @no_dma_map: opt out of page_pool DMA mapping
  * @buf_len: HW-writeable length per each buffer
  * @nid: ID of the closest NUMA node with memory
  */
@@ -87,6 +88,7 @@ struct libeth_fq {
 	bool			hsplit:1;
 	bool			xdp:1;
 	bool			no_napi:1;
+	bool			no_dma_map:1;
 
 	u32			buf_len;
 	int			nid;
-- 
2.56.1.911.g883d8bcb20-goog


  parent reply	other threads:[~2026-12-02  6:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  6:57 [PATCH v1 iwl-next 0/5] idpf: Avoid IOVA exhaustion under DMA-FQ IOMMU Kuniyuki Iwashima
2026-12-02  6:57 ` [PATCH v1 iwl-next 1/5] idpf: Reuse idpf_rx_update_bufq_desc() in idpf_rx_post_buf_desc() Kuniyuki Iwashima
2026-12-02  6:57 ` [PATCH v1 iwl-next 2/5] idpf: Use coherent DMA buffer for Rx header split without XDP Kuniyuki Iwashima
2026-12-02  6:57 ` [PATCH v1 iwl-next 3/5] page_pool: Set dma_sync_for_cpu only under PP_FLAG_DMA_MAP Kuniyuki Iwashima
2026-12-02  6:57 ` Kuniyuki Iwashima [this message]
2026-12-02  6:57 ` [PATCH v1 iwl-next 5/5] idpf: Unmap Rx payload pages under DMA-FQ IOMMU Kuniyuki Iwashima

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=20261202065737.207610-5-kuniyu@google.com \
    --to=kuniyu@google.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kuni1840@gmail.com \
    --cc=przemyslaw.kitszel@intel.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.