Intel-Wired-Lan Archive on 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>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	 Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Brian Vazquez <brianvv@google.com>,
	David Decotigny <decot@google.com>, Li Li <boolli@google.com>,
	 Kuniyuki Iwashima <kuniyu@google.com>,
	Kuniyuki Iwashima <kuni1840@gmail.com>,
	intel-wired-lan@lists.osuosl.org
Subject: [PATCH v2 iwl-next 2/5] idpf: Use coherent DMA buffer for Rx header split without XDP.
Date: Sat,  5 Dec 2026 21:52:20 +0900	[thread overview]
Message-ID: <20261205125237.2290932-3-kuniyu@google.com> (raw)
In-Reply-To: <20261205125237.2290932-1-kuniyu@google.com>

With header split enabled under an IOMMU DMA domain, idpf uses
page_pool backed by 4K pages for Rx header buffers.

Since a single 4K page is sliced across multiple header buffers,
queued skbs in socket receive and out-of-order queues pin these
pages and retain their DMA mappings, exhausting the 32-bit IOVA
window and causing alloc_iova() contention and Rx drops.

Commit 90912f9f4f2d ("idpf: convert header split mode to libeth +
napi_build_skb()") removed coherent header allocation in favour
of page_pool.

Let's allocate a single coherent DMA buffer array per buffer
queue when header split is enabled on a DMA-coherent device under
an IOMMU DMA domain without XDP.

If dma_alloc_coherent_node() fails, the queue group falls back to
the existing page_pool path.

Rx headers are small and fixed-size, so copying headers into
napi_alloc_skb() from a pre-allocated coherent array eliminates all
per-packet IOMMU mapping churn and page_pool overhead for header
buffers.

On Rx, idpf_rx_splitq_clean_skb() copies headers from the coherent
array (or the full frame when pkt_len <= L1_CACHE_BYTES, or
ETH_HLEN otherwise on header buffer overflow) into napi_alloc_skb()
and attaches or coalesces payload fragments directly.

If an allocation or bounds check fails mid-frame, rxq->rx_drop
drops remaining descriptors of a multi-descriptor frame across
NAPI polls.

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
---
v2:
  * Coalesce contiguous payload frags in idpf_rx_splitq_clean_skb()
  * Bound NAPI loop by dropped EOP frames as well
---
 drivers/net/ethernet/intel/idpf/idpf_txrx.c | 270 ++++++++++++++++++--
 drivers/net/ethernet/intel/idpf/idpf_txrx.h |  22 +-
 2 files changed, 272 insertions(+), 20 deletions(-)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
index d6601272c9ba..fb6a2ea25dc5 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
@@ -1,12 +1,17 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /* Copyright (C) 2023 Intel Corporation */
 
+#include <linux/dma-mapping.h>
+#include <linux/iommu.h>
+
 #include "idpf.h"
 #include "idpf_ptp.h"
 #include "idpf_virtchnl.h"
 #include "xdp.h"
 #include "xsk.h"
 
+#define IDPF_RX_HDR_BUF_SIZE		ALIGN(LIBETH_MAX_HEAD, LIBETH_RX_BUF_STRIDE)
+
 #define idpf_tx_buf_next(buf)		(*(u32 *)&(buf)->priv)
 LIBETH_SQE_CHECK_PRIV(u32);
 
@@ -362,10 +367,25 @@ static void idpf_rx_page_rel(struct libeth_fqe *rx_buf)
  */
 static void idpf_rx_hdr_buf_rel_all(struct idpf_buf_queue *bufq)
 {
-	struct libeth_fq fq = {
-		.fqes	= bufq->hdr_buf,
-		.pp	= bufq->hdr_pp,
-	};
+	struct libeth_fq fq;
+
+	if (idpf_queue_has(HSPLIT_COHERENT, bufq)) {
+		if (!bufq->hdr_buf_va)
+			return;
+
+		dma_free_coherent(&bufq->q_vector->vport->adapter->pdev->dev,
+				  bufq->desc_count * IDPF_RX_HDR_BUF_SIZE,
+				  bufq->hdr_buf_va, bufq->hdr_buf_pa);
+		bufq->hdr_buf_va = NULL;
+		bufq->hdr_buf_pa = 0;
+		return;
+	}
+
+	if (!bufq->hdr_pp)
+		return;
+
+	fq.fqes = bufq->hdr_buf;
+	fq.pp = bufq->hdr_pp;
 
 	for (u32 i = 0; i < bufq->desc_count; i++)
 		idpf_rx_page_rel(&bufq->hdr_buf[i]);
@@ -386,6 +406,9 @@ static void idpf_rx_buf_rel_bufq(struct idpf_buf_queue *bufq)
 		.pp	= bufq->pp,
 	};
 
+	if (idpf_queue_has(HSPLIT_COHERENT, bufq))
+		idpf_rx_hdr_buf_rel_all(bufq);
+
 	/* queue already cleared, nothing to do */
 	if (!bufq->buf)
 		return;
@@ -443,8 +466,15 @@ static void idpf_rx_desc_rel(struct idpf_rx_queue *rxq, struct device *dev,
 	if (!rxq)
 		return;
 
-	if (!idpf_queue_has(XSK, rxq))
-		libeth_xdp_return_stash(&rxq->xdp);
+	if (!idpf_queue_has(XSK, rxq)) {
+		if (idpf_queue_has(HSPLIT_COHERENT, rxq)) {
+			dev_kfree_skb_any(rxq->skb);
+			rxq->skb = NULL;
+			rxq->rx_drop = false;
+		} else {
+			libeth_xdp_return_stash(&rxq->xdp);
+		}
+	}
 
 	if (!idpf_is_queue_model_split(model))
 		idpf_rx_buf_rel_all(rxq);
@@ -623,6 +653,12 @@ static int idpf_rx_update_bufq_desc(struct idpf_buf_queue *bufq, u32 buf_id,
 	buf_desc->pkt_addr = cpu_to_le64(addr);
 	buf_desc->qword0.buf_id = cpu_to_le16(buf_id);
 
+	if (idpf_queue_has(HSPLIT_COHERENT, bufq)) {
+		buf_desc->hdr_addr = cpu_to_le64(bufq->hdr_buf_pa +
+						 (dma_addr_t)buf_id * IDPF_RX_HDR_BUF_SIZE);
+		return 0;
+	}
+
 	if (!idpf_queue_has(HSPLIT_EN, bufq))
 		return 0;
 
@@ -747,7 +783,8 @@ static int idpf_rx_buf_alloc_all(struct idpf_buf_queue *rxbufq)
 {
 	int err = 0;
 
-	if (idpf_queue_has(HSPLIT_EN, rxbufq)) {
+	if (idpf_queue_has(HSPLIT_EN, rxbufq) &&
+	    !idpf_queue_has(HSPLIT_COHERENT, rxbufq)) {
 		err = idpf_rx_hdr_buf_alloc_all(rxbufq);
 		if (err)
 			goto rx_buf_alloc_all_out;
@@ -764,6 +801,46 @@ static int idpf_rx_buf_alloc_all(struct idpf_buf_queue *rxbufq)
 	return err;
 }
 
+static void idpf_rx_hdr_buf_alloc_coherent(struct idpf_rxq_group *rx_qgrp,
+					   u16 num_bufqs)
+{
+	struct idpf_buf_queue *bufq = &rx_qgrp->splitq.bufq_sets[0].bufq;
+	struct device *dev = &bufq->q_vector->vport->adapter->pdev->dev;
+
+	if (!idpf_queue_has(HSPLIT_COHERENT, bufq))
+		return;
+
+	for (unsigned int j = 0; j < num_bufqs; j++) {
+		dma_addr_t pa;
+		void *va;
+
+		bufq = &rx_qgrp->splitq.bufq_sets[j].bufq;
+		va = dma_alloc_coherent_node(dev,
+					     bufq->desc_count * IDPF_RX_HDR_BUF_SIZE,
+					     &pa, GFP_KERNEL | __GFP_NOWARN,
+					     idpf_q_vector_to_mem(bufq->q_vector));
+		if (!va)
+			goto fallback;
+
+		bufq->hdr_buf_va = va;
+		bufq->hdr_buf_pa = pa;
+		bufq->rx_hbuf_size = IDPF_RX_HDR_BUF_SIZE;
+	}
+
+	return;
+
+fallback:
+	for (unsigned int j = 0; j < num_bufqs; j++) {
+		bufq = &rx_qgrp->splitq.bufq_sets[j].bufq;
+		idpf_rx_hdr_buf_rel_all(bufq);
+		idpf_queue_clear(HSPLIT_COHERENT, bufq);
+	}
+
+	for (unsigned int j = 0; j < rx_qgrp->splitq.num_rxq_sets; j++)
+		idpf_queue_clear(HSPLIT_COHERENT,
+				 &rx_qgrp->splitq.rxq_sets[j]->rxq);
+}
+
 /**
  * idpf_rx_bufs_init - Initialize page pool, allocate rx bufs, and post to HW
  * @bufq: buffer queue to create page pool for
@@ -835,6 +912,9 @@ int idpf_rx_bufs_init_all(struct idpf_vport *vport,
 			continue;
 		}
 
+		idpf_rx_hdr_buf_alloc_coherent(rx_qgrp,
+					       rsrc->num_bufqs_per_qgrp);
+
 		/* Otherwise, allocate bufs for the buffer queues */
 		for (unsigned int j = 0; j < rsrc->num_bufqs_per_qgrp; j++) {
 			enum libeth_fqe_type type;
@@ -1861,8 +1941,10 @@ static int idpf_rxq_group_alloc(struct idpf_vport *vport,
 				u16 num_rxq)
 {
 	struct idpf_adapter *adapter = vport->adapter;
+	struct device *dev = &adapter->pdev->dev;
 	struct idpf_rxq_group *rxq_grps;
-	bool hs, rsc;
+	struct iommu_domain *domain;
+	bool hs, rsc, coherent_hdr;
 	int err;
 
 	rxq_grps = kzalloc_objs(struct idpf_rxq_group, rsrc->num_rxq_grp);
@@ -1872,6 +1954,11 @@ static int idpf_rxq_group_alloc(struct idpf_vport *vport,
 	hs = idpf_vport_get_hsplit(vport) == ETHTOOL_TCP_DATA_SPLIT_ENABLED;
 	rsc = idpf_is_feature_ena(vport, NETIF_F_GRO_HW);
 
+	domain = iommu_get_domain_for_dev(dev);
+	coherent_hdr = hs && !idpf_xdp_enabled(vport) &&
+		domain && iommu_is_dma_domain(domain) &&
+		!dma_dev_need_sync(dev);
+
 	for (unsigned int i = 0; i < rsrc->num_rxq_grp; i++) {
 		struct idpf_rxq_group *rx_qgrp = &rxq_grps[i];
 
@@ -1917,6 +2004,7 @@ static int idpf_rxq_group_alloc(struct idpf_vport *vport,
 			q->rx_buffer_low_watermark = IDPF_LOW_WATERMARK;
 
 			idpf_queue_assign(HSPLIT_EN, q, hs);
+			idpf_queue_assign(HSPLIT_COHERENT, q, coherent_hdr);
 			idpf_queue_assign(RSC_EN, q, rsc);
 
 			bufq_set->refillqs = kcalloc(num_rxq, swq_size,
@@ -1960,6 +2048,7 @@ static int idpf_rxq_group_alloc(struct idpf_vport *vport,
 				      &rx_qgrp->splitq.bufq_sets[1].refillqs[j];
 
 			idpf_queue_assign(HSPLIT_EN, q, hs);
+			idpf_queue_assign(HSPLIT_COHERENT, q, coherent_hdr);
 			idpf_queue_assign(RSC_EN, q, rsc);
 			q->rx_ptype_lkup = adapter->splitq_pt_lkup;
 
@@ -3649,13 +3738,139 @@ static bool idpf_rx_splitq_test_staterr(const u8 stat_err_field,
  * Return: %true if the buffer is an EOP buffer, %false otherwise, indicating
  * that this is in fact a non-EOP buffer.
  */
-static bool idpf_rx_splitq_is_eop(struct virtchnl2_rx_flex_desc_adv_nic_3 *rx_desc)
+static bool idpf_rx_splitq_is_eop(const struct virtchnl2_rx_flex_desc_adv_nic_3 *rx_desc)
 {
 	/* if we are the last buffer then there is nothing else to do */
 	return likely(idpf_rx_splitq_test_staterr(rx_desc->status_err0_qw1,
 						  IDPF_RXD_EOF_SPLITQ));
 }
 
+static void idpf_rx_splitq_clean_skb(struct idpf_rx_queue *rxq,
+				     const struct idpf_buf_queue *rx_bufq,
+				     const struct virtchnl2_rx_flex_desc_adv_nic_3 *rx_desc,
+				     struct libeth_fqe *rx_buf, u16 buf_id, u32 hdr_len,
+				     u32 pkt_len, struct sk_buff **skb_p,
+				     struct libeth_rq_napi_stats *rs, u32 *drops)
+{
+	bool eop = idpf_rx_splitq_is_eop(rx_desc);
+	struct sk_buff *skb = *skb_p;
+	bool sync;
+	u32 len;
+
+	if (unlikely(rxq->rx_drop)) {
+		libeth_rx_recycle_slow(rx_buf->netmem);
+		if (eop) {
+			rxq->rx_drop = false;
+			(*drops)++;
+		}
+		return;
+	}
+
+	sync = libeth_rx_sync_for_cpu(rx_buf, pkt_len);
+
+	if (!skb) {
+		const void *va;
+		u32 copy;
+
+		if (hdr_len) {
+			if (unlikely(hdr_len > IDPF_RX_HDR_BUF_SIZE))
+				goto drop_sync;
+
+			va = rx_bufq->hdr_buf_va +
+			     (size_t)buf_id * IDPF_RX_HDR_BUF_SIZE;
+			copy = hdr_len;
+
+			rs->hsplit++;
+		} else {
+			u64_stats_update_begin(&rxq->stats_sync);
+			u64_stats_inc(&rxq->q_stats.hsplit_buf_ovf);
+			u64_stats_update_end(&rxq->stats_sync);
+
+			if (!sync)
+				goto drop;
+
+			if (unlikely(netmem_is_net_iov(rx_buf->netmem)))
+				goto drop_sync;
+
+			copy = pkt_len <= L1_CACHE_BYTES ? pkt_len : ETH_HLEN;
+			va = page_address(__netmem_to_page(rx_buf->netmem)) +
+			     rx_buf->offset + rx_bufq->pp->p.offset;
+			rx_buf->offset += copy;
+			pkt_len -= copy;
+		}
+
+		skb = napi_alloc_skb(rxq->napi, copy);
+		if (unlikely(!skb))
+			goto drop_sync;
+
+		skb_put_data(skb, va, copy);
+		if (sync && !pkt_len) {
+			libeth_rx_recycle_slow(rx_buf->netmem);
+			sync = false;
+		}
+	}
+
+	if (sync) {
+		int nr_frags = skb_shinfo(skb)->nr_frags;
+		u32 off = rx_buf->offset + rx_bufq->pp->p.offset;
+
+		if (nr_frags) {
+			skb_frag_t *prev = &skb_shinfo(skb)->frags[nr_frags - 1];
+
+			if (rx_buf->netmem == skb_frag_netmem(prev) &&
+			    off == skb_frag_off(prev) + skb_frag_size(prev)) {
+				skb_coalesce_rx_frag(skb, nr_frags - 1,
+						     pkt_len, rx_buf->truesize);
+				libeth_rx_recycle_slow(rx_buf->netmem);
+				goto check_eop;
+			}
+		}
+
+		if (unlikely(nr_frags >= MAX_SKB_FRAGS)) {
+			dev_kfree_skb_any(skb);
+			*skb_p = NULL;
+			goto drop_sync;
+		}
+
+		skb_mark_for_recycle(skb);
+		skb_add_rx_frag_netmem(skb, nr_frags, rx_buf->netmem, off,
+				       pkt_len, rx_buf->truesize);
+	}
+
+check_eop:
+	if (!eop) {
+		*skb_p = skb;
+		return;
+	}
+
+	skb_record_rx_queue(skb, rxq->idx);
+	len = skb->len;
+	skb->protocol = eth_type_trans(skb, rxq->napi->dev);
+
+	if (unlikely(__idpf_rx_process_skb_fields(rxq, skb, rx_desc))) {
+		napi_consume_skb(skb, true);
+		*skb_p = NULL;
+		(*drops)++;
+		return;
+	}
+
+	rs->packets++;
+	rs->bytes += len;
+
+	napi_gro_receive(rxq->napi, skb);
+	*skb_p = NULL;
+	return;
+
+drop_sync:
+	if (sync)
+		libeth_rx_recycle_slow(rx_buf->netmem);
+drop:
+	if (!eop)
+		rxq->rx_drop = true;
+	else
+		(*drops)++;
+}
+
 /**
  * idpf_rx_splitq_clean - Clean completed descriptors from Rx queue
  * @rxq: Rx descriptor queue to retrieve receive buffer queue
@@ -3670,18 +3885,23 @@ static bool idpf_rx_splitq_is_eop(struct virtchnl2_rx_flex_desc_adv_nic_3 *rx_de
  */
 static int idpf_rx_splitq_clean(struct idpf_rx_queue *rxq, int budget)
 {
+	bool coherent_hdr = idpf_queue_has(HSPLIT_COHERENT, rxq);
+	struct sk_buff *skb = coherent_hdr ? rxq->skb : NULL;
 	struct idpf_buf_queue *rx_bufq = NULL;
 	struct libeth_rq_napi_stats rs = { };
 	u16 ntc = rxq->next_to_clean;
 	LIBETH_XDP_ONSTACK_BUFF(xdp);
 	LIBETH_XDP_ONSTACK_BULK(bq);
+	u32 drops = 0;
 
-	libeth_xdp_tx_init_bulk(&bq, rxq->xdp_prog, rxq->xdp_rxq.dev,
-				rxq->xdpsqs, rxq->num_xdp_txq);
-	libeth_xdp_init_buff(xdp, &rxq->xdp, &rxq->xdp_rxq);
+	if (!coherent_hdr) {
+		libeth_xdp_tx_init_bulk(&bq, rxq->xdp_prog, rxq->xdp_rxq.dev,
+					rxq->xdpsqs, rxq->num_xdp_txq);
+		libeth_xdp_init_buff(xdp, &rxq->xdp, &rxq->xdp_rxq);
+	}
 
 	/* Process Rx packets bounded by budget */
-	while (likely(rs.packets < budget)) {
+	while (likely(rs.packets + drops < budget)) {
 		struct virtchnl2_rx_flex_desc_adv_nic_3 *rx_desc;
 		struct libeth_fqe *hdr, *rx_buf = NULL;
 		struct idpf_sw_queue *refillq = NULL;
@@ -3729,7 +3949,7 @@ static int idpf_rx_splitq_clean(struct idpf_rx_queue *rxq, int budget)
 
 		rx_buf = &rx_bufq->buf[buf_id];
 
-		if (!rx_bufq->hdr_pp)
+		if (!coherent_hdr && !rx_bufq->hdr_pp)
 			goto payload;
 
 #define __HBO_BIT	VIRTCHNL2_RX_FLEX_DESC_ADV_STATUS0_HBO_M
@@ -3745,6 +3965,16 @@ static int idpf_rx_splitq_clean(struct idpf_rx_queue *rxq, int budget)
 #undef __HDR_LEN_MASK
 #undef __HBO_BIT
 
+		if (coherent_hdr) {
+			idpf_rx_splitq_clean_skb(rxq, rx_bufq, rx_desc, rx_buf,
+						 buf_id, hdr_len, pkt_len, &skb,
+						 &rs, &drops);
+			rx_buf->netmem = 0;
+			idpf_post_buf_refill(refillq, buf_id);
+			IDPF_RX_BUMP_NTC(rxq, ntc);
+			continue;
+		}
+
 		hdr = &rx_bufq->hdr_buf[buf_id];
 
 		if (unlikely(!hdr_len && !xdp->data)) {
@@ -3776,10 +4006,14 @@ static int idpf_rx_splitq_clean(struct idpf_rx_queue *rxq, int budget)
 		idpf_xdp_run_pass(xdp, &bq, rxq->napi, &rs, rx_desc);
 	}
 
-	idpf_xdp_finalize_rx(&bq);
+	if (coherent_hdr) {
+		rxq->skb = skb;
+	} else {
+		idpf_xdp_finalize_rx(&bq);
+		libeth_xdp_save_buff(&rxq->xdp, xdp);
+	}
 
 	rxq->next_to_clean = ntc;
-	libeth_xdp_save_buff(&rxq->xdp, xdp);
 
 	u64_stats_update_begin(&rxq->stats_sync);
 	u64_stats_add(&rxq->q_stats.packets, rs.packets);
@@ -3787,7 +4021,7 @@ static int idpf_rx_splitq_clean(struct idpf_rx_queue *rxq, int budget)
 	u64_stats_add(&rxq->q_stats.hsplit_pkts, rs.hsplit);
 	u64_stats_update_end(&rxq->stats_sync);
 
-	return rs.packets;
+	return min_t(int, rs.packets + drops, budget);
 }
 
 /**
@@ -3869,7 +4103,7 @@ static void idpf_rx_clean_refillq_all(struct idpf_buf_queue *bufq, int nid)
 	int i;
 
 	page_pool_nid_changed(bufq->pp, nid);
-	if (bufq->hdr_pp)
+	if (!idpf_queue_has(HSPLIT_COHERENT, bufq) && bufq->hdr_pp)
 		page_pool_nid_changed(bufq->hdr_pp, nid);
 
 	bufq_set = container_of(bufq, struct idpf_bufq_set, bufq);
diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.h b/drivers/net/ethernet/intel/idpf/idpf_txrx.h
index 0f16f9a376f4..3fad569d27b8 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_txrx.h
+++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.h
@@ -288,6 +288,7 @@ struct idpf_ptype_state {
  * @__IDPF_Q_CRC_EN: enable CRC offload in singleq mode
  * @__IDPF_Q_RSC_EN: enable Receive Side Coalescing on Rx (splitq)
  * @__IDPF_Q_HSPLIT_EN: enable header split on Rx (splitq)
+ * @__IDPF_Q_HSPLIT_COHERENT: use coherent DMA buffer for Rx header split
  * @__IDPF_Q_PTP: indicates whether the Rx timestamping is enabled for the
  *		  queue
  * @__IDPF_Q_NOIRQ: queue is polling-driven and has no interrupt
@@ -303,6 +304,7 @@ enum idpf_queue_flags_t {
 	__IDPF_Q_CRC_EN,
 	__IDPF_Q_RSC_EN,
 	__IDPF_Q_HSPLIT_EN,
+	__IDPF_Q_HSPLIT_COHERENT,
 	__IDPF_Q_PTP,
 	__IDPF_Q_NOIRQ,
 	__IDPF_Q_XDP,
@@ -491,6 +493,8 @@ struct idpf_tx_queue_stats {
  * @xdp: XDP buffer with the current frame
  * @xsk: current XDP buffer in XSk mode
  * @pool: XSk pool if installed
+ * @skb: partially built skb in coherent header split mode
+ * @rx_drop: drop remaining descriptors of the current Rx packet
  * @cached_phc_time: Cached PHC time for the Rx queue
  * @stats_sync: See struct u64_stats_sync
  * @q_stats: See union idpf_rx_queue_stats
@@ -552,6 +556,10 @@ struct idpf_rx_queue {
 			struct libeth_xdp_buff *xsk;
 			struct xsk_buff_pool *pool;
 		};
+		struct {
+			struct sk_buff *skb;
+			bool rx_drop;
+		};
 	};
 	u64 cached_phc_time;
 
@@ -731,6 +739,8 @@ libeth_cacheline_set_assert(struct idpf_tx_queue, 64,
  * @pool: &xsk_buff_pool on XSk queues
  * @hdr_buf: &libeth_fqe for header buffers
  * @hdr_pp: &page_pool for header buffers
+ * @hdr_buf_va: virtual address of coherent header buffer array
+ * @hdr_buf_pa: DMA address of coherent header buffer array
  * @tail: Tail offset
  * @flags: See enum idpf_queue_flags_t
  * @desc_count: Number of descriptors
@@ -762,8 +772,16 @@ struct idpf_buf_queue {
 			struct xsk_buff_pool *pool;
 		};
 	};
-	struct libeth_fqe *hdr_buf;
-	struct page_pool *hdr_pp;
+	union {
+		struct {
+			struct libeth_fqe *hdr_buf;
+			struct page_pool *hdr_pp;
+		};
+		struct {
+			void *hdr_buf_va;
+			dma_addr_t hdr_buf_pa;
+		};
+	};
 	void __iomem *tail;
 
 	DECLARE_BITMAP(flags, __IDPF_Q_FLAGS_NBITS);
-- 
2.56.1.915.g69d5ec7298-goog


  parent reply	other threads:[~2026-12-05 12:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05 12:52 [PATCH v2 iwl-next 0/5] idpf: Avoid IOVA exhaustion under DMA-FQ IOMMU Kuniyuki Iwashima
2026-12-05 12:52 ` [PATCH v2 iwl-next 1/5] idpf: Reuse idpf_rx_update_bufq_desc() in idpf_rx_post_buf_desc() Kuniyuki Iwashima
2026-12-05 12:52 ` Kuniyuki Iwashima [this message]
2026-12-05 12:52 ` [PATCH v2 iwl-next 3/5] netmem: Annotate data-races around pp_magic Kuniyuki Iwashima
2026-12-05 12:52 ` [PATCH v2 iwl-next 4/5] page_pool: Allow drivers to unmap DMA before returning pages Kuniyuki Iwashima
2026-12-05 13:15   ` sashiko-bot
2026-12-05 12:52 ` [PATCH v2 iwl-next 5/5] idpf: Unmap Rx payload pages above mapped threshold under DMA-FQ IOMMU Kuniyuki Iwashima
2026-12-05 13:16   ` sashiko-bot

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=20261205125237.2290932-3-kuniyu@google.com \
    --to=kuniyu@google.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=boolli@google.com \
    --cc=brianvv@google.com \
    --cc=decot@google.com \
    --cc=hawk@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox