Skip to contentSkip to conversation

ice: add support for devmem/io_uring Rx and Tx

PATCH Superseded Alexander Lobakin 4 participants 18 messages Dec 4, 2025 – Feb 6

Subsystems (4)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Alexander Lobakin

author maintainer
#0 lore raw

v2 cover ice: add support for devmem/io_uring Rx and Tx

Now that ice uses libeth for managing Rx buffers and supports configurable header split, it's ready to get support for sending and receiving packets with unreadable (to the kernel) frags.

Extend libeth just a little bit to allow creating PPs with custom memory providers and make sure ice works correctly with the netdev ops locking. Then add the full set of queue_mgmt_ops and don't unmap unreadable frags on Tx completion.
No perf regressions for the regular flows and no code duplication implied.

Credits to the fbnic developers, which's code helped me understand the memory providers and queue_mgmt_ops logics and served as a reference.

Alexander Lobakin (5):
libeth: pass Rx queue index to PP when creating a fill queue
libeth: handle creating pools with unreadable buffers
ice: migrate to netdev ops lock
ice: implement Rx queue management ops
ice: add support for transmitting unreadable frags

 drivers/net/ethernet/intel/ice/ice_lib.h    |  11 +-
 drivers/net/ethernet/intel/ice/ice_txrx.h   |   2 +
 drivers/net/ethernet/intel/idpf/idpf_txrx.h |   2 +
 include/net/libeth/rx.h                     |   2 +
 include/net/libeth/tx.h                     |   2 +-
 drivers/net/ethernet/intel/iavf/iavf_txrx.c |   1 +
 drivers/net/ethernet/intel/ice/ice_base.c   | 194 ++++++++++++++------
 drivers/net/ethernet/intel/ice/ice_lib.c    |  56 +++++-
 drivers/net/ethernet/intel/ice/ice_main.c   |  50 ++---
 drivers/net/ethernet/intel/ice/ice_sf_eth.c |   2 +
 drivers/net/ethernet/intel/ice/ice_txrx.c   |  43 +++--
 drivers/net/ethernet/intel/ice/ice_xsk.c    |   4 +-
 drivers/net/ethernet/intel/idpf/idpf_txrx.c |  13 ++
 drivers/net/ethernet/intel/libeth/rx.c      |  46 +++++
 14 files changed, 325 insertions(+), 103 deletions(-)

---
From v1[0]:
* rebase on top of the latest next-queue;
* fix a typo 'rxq_ixd' -> 'rxq_idx' (Tony).

Testing hints:
* regular Rx and Tx for regressions;
* <kernel root>/tools/testing/selftests/drivers/net/hw/ contains scripts for testing netmem Rx and Tx, namely devmem.py and iou-zcrx.py (read the documentation first).

[0] https://lore.kernel.org/intel-wired-lan/[email protected]

Signature · 1 line
2.52.0
author maintainer
#1 lore raw

PATCH v2 1/5 libeth: pass Rx queue index to PP when creating a fill queue

Since recently, page_pool_create() accepts optional stack index of the Rx queue which the pool will be created for. It can then be used on control path for stuff like memory providers. Add the same field to libeth_fq and pass the index from all the drivers using libeth for managing Rx to simplify implementing MP support later.
idpf has one libeth_fq per buffer/fill queue and each Rx queue has two fill queues, but since fill queues can never be shared, we can store the corresponding Rx queue index there during the initialization to pass it to libeth.

---
 drivers/net/ethernet/intel/idpf/idpf_txrx.h |  2 ++
 include/net/libeth/rx.h                     |  2 ++
 drivers/net/ethernet/intel/iavf/iavf_txrx.c |  1 +
 drivers/net/ethernet/intel/ice/ice_base.c   |  2 ++
 drivers/net/ethernet/intel/idpf/idpf_txrx.c | 13 +++++++++++++
 drivers/net/ethernet/intel/libeth/rx.c      |  1 +
 6 files changed, 21 insertions(+)
drivers/net/ethernet/intel/idpf/idpf_txrx.h +2 -0
index 6796f010e382..0eaebac8ceae 100644
@@ -748,6 +748,7 @@ libeth_cacheline_set_assert(struct idpf_tx_queue, 64,
  * @size: Length of descriptor ring in bytes
  * @dma: Physical address of ring
  * @q_vector: Backreference to associated vector
+ * @rxq_idx: stack index of the corresponding Rx queue
  * @rx_buffer_low_watermark: RX buffer low watermark
  * @rx_hbuf_size: Header buffer size
  * @rx_buf_size: Buffer size
@@ -791,6 +792,7 @@ struct idpf_buf_queue {
 	dma_addr_t dma;
 
 	struct idpf_q_vector *q_vector;
+	u16 rxq_idx;
 
 	u16 rx_buffer_low_watermark;
 	u16 rx_hbuf_size;
include/net/libeth/rx.h +2 -0
index 0e736846c5e8..db838ef7f9bb 100644
@@ -72,6 +72,7 @@ enum libeth_fqe_type {
  * @no_napi: the queue is not a data queue and does not have NAPI
  * @buf_len: HW-writeable length per each buffer
  * @nid: ID of the closest NUMA node with memory
+ * @idx: stack index of the corresponding Rx queue
  */
 struct libeth_fq {
 	struct_group_tagged(libeth_fq_fp, fp,
@@ -90,6 +91,7 @@ struct libeth_fq {
 
 	u32			buf_len;
 	int			nid;
+	u32			idx;
 };
 
 int libeth_rx_fq_create(struct libeth_fq *fq, void *napi_dev);
drivers/net/ethernet/intel/iavf/iavf_txrx.c +1 -0
index 275b11dd0c60..3d938d7ab2cc 100644
@@ -771,6 +771,7 @@ int iavf_setup_rx_descriptors(struct iavf_ring *rx_ring)
 		.count		= rx_ring->count,
 		.buf_len	= LIBIE_MAX_RX_BUF_LEN,
 		.nid		= NUMA_NO_NODE,
+		.idx		= rx_ring->queue_index,
 	};
 	int ret;
 
drivers/net/ethernet/intel/ice/ice_base.c +2 -0
index 6fb7051aa463..7097324c38f3 100644
@@ -607,6 +607,7 @@ static int ice_rxq_pp_create(struct ice_rx_ring *rq)
 	struct libeth_fq fq = {
 		.count		= rq->count,
 		.nid		= NUMA_NO_NODE,
+		.idx		= rq->q_index,
 		.hsplit		= rq->vsi->hsplit,
 		.xdp		= ice_is_xdp_ena_vsi(rq->vsi),
 		.buf_len	= LIBIE_MAX_RX_BUF_LEN,
@@ -629,6 +630,7 @@ static int ice_rxq_pp_create(struct ice_rx_ring *rq)
 		.count		= rq->count,
 		.type		= LIBETH_FQE_HDR,
 		.nid		= NUMA_NO_NODE,
+		.idx		= rq->q_index,
 		.xdp		= ice_is_xdp_ena_vsi(rq->vsi),
 	};
 
drivers/net/ethernet/intel/idpf/idpf_txrx.c +13 -0
index 72215612b460..5dc41b7ba609 100644
@@ -561,6 +561,7 @@ static int idpf_rx_hdr_buf_alloc_all(struct idpf_buf_queue *bufq)
 		.type	= LIBETH_FQE_HDR,
 		.xdp	= idpf_xdp_enabled(bufq->q_vector->vport),
 		.nid	= idpf_q_vector_to_mem(bufq->q_vector),
+		.idx	= bufq->rxq_idx,
 	};
 	int ret;
 
@@ -703,6 +704,7 @@ static int idpf_rx_bufs_init_singleq(struct idpf_rx_queue *rxq)
 		.type		= LIBETH_FQE_MTU,
 		.buf_len	= IDPF_RX_MAX_BUF_SZ,
 		.nid		= idpf_q_vector_to_mem(rxq->q_vector),
+		.idx		= rxq->idx,
 	};
 	int ret;
 
@@ -763,6 +765,7 @@ static int idpf_rx_bufs_init(struct idpf_buf_queue *bufq,
 		.hsplit		= idpf_queue_has(HSPLIT_EN, bufq),
 		.xdp		= idpf_xdp_enabled(bufq->q_vector->vport),
 		.nid		= idpf_q_vector_to_mem(bufq->q_vector),
+		.idx		= bufq->rxq_idx,
 	};
 	int ret;
 
@@ -1922,6 +1925,16 @@ static int idpf_rxq_group_alloc(struct idpf_vport *vport,
 							LIBETH_RX_LL_LEN;
 			idpf_rxq_set_descids(rsrc, q);
 		}
+
+		if (!idpf_is_queue_model_split(rsrc->rxq_model))
+			continue;
+
+		for (u32 j = 0; j < rsrc->num_bufqs_per_qgrp; j++) {
+			struct idpf_buf_queue *bufq;
+
+			bufq = &rx_qgrp->splitq.bufq_sets[j].bufq;
+			bufq->rxq_idx = rx_qgrp->splitq.rxq_sets[0]->rxq.idx;
+		}
 	}
 
 err_alloc:
drivers/net/ethernet/intel/libeth/rx.c +1 -0
index 1d8248a31037..9ac3a1448b2f 100644
@@ -157,6 +157,7 @@ int libeth_rx_fq_create(struct libeth_fq *fq, void *napi_dev)
 		.order		= LIBETH_RX_PAGE_ORDER,
 		.pool_size	= fq->count,
 		.nid		= fq->nid,
+		.queue_idx	= fq->idx,
 		.dev		= napi ? napi->dev->dev.parent : napi_dev,
 		.netdev		= napi ? napi->dev : NULL,
 		.napi		= napi,
Signature · 1 line
2.52.0
Tested-by on v2 1/5
#2 lore raw

RE: [Intel-wired-lan] [PATCH iwl-next v2 1/5] libeth: pass Rx queue index to PP when creating a fill queue

Quoted 17 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Alexander Lobakin
Sent: Thursday, December 4, 2025 7:51 AM
To: [email protected]
Cc: Lobakin, Aleksander <[email protected]>; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Simon Horman <[email protected]>; Keller, Jacob E <[email protected]>; Loktionov, Aleksandr <[email protected]>; NXNE CNSE OSDT ITP Upstreaming <[email protected]>; [email protected]; linux- [email protected]
Subject: [Intel-wired-lan] [PATCH iwl-next v2 1/5] libeth: pass Rx queue index to PP when creating a fill queue

Since recently, page_pool_create() accepts optional stack index of the Rx queue which the pool will be created for. It can then be used on control path for stuff like memory providers.
Add the same field to libeth_fq and pass the index from all the drivers using libeth for managing Rx to simplify implementing MP support later.
idpf has one libeth_fq per buffer/fill queue and each Rx queue has two fill queues, but since fill queues can never be shared, we can store the corresponding Rx queue index there during the initialization to pass > it to libeth.

Quoted 8 lines
---
 drivers/net/ethernet/intel/idpf/idpf_txrx.h |  2 ++
 include/net/libeth/rx.h                     |  2 ++
 drivers/net/ethernet/intel/iavf/iavf_txrx.c |  1 +
 drivers/net/ethernet/intel/ice/ice_base.c   |  2 ++
 drivers/net/ethernet/intel/idpf/idpf_txrx.c | 13 +++++++++++++
 drivers/net/ethernet/intel/libeth/rx.c      |  1 +
 6 files changed, 21 insertions(+)
author maintainer
#3 lore raw

PATCH v2 2/5 libeth: handle creating pools with unreadable buffers

In reply to Alexander Lobakin

libeth uses netmems for quite some time already, so in order to support unreadable frags / memory providers, it only needs to set PP_FLAG_ALLOW_UNREADABLE_NETMEM when needed.
Also add a couple sanity checks to make sure the driver didn't mess up the configuration options and, in case when an MP is installed, return the truesize always equal to PAGE_SIZE, so that libeth_rx_alloc() will never try to allocate frags. Memory providers manage buffers on their own and expect 1:1 buffer / HW Rx descriptor association.

Bonus: mention in the libeth_sqe_type description that LIBETH_SQE_EMPTY should also be used for netmem Tx SQEs -- they don't need DMA unmapping.

---
 include/net/libeth/tx.h                |  2 +-
 drivers/net/ethernet/intel/libeth/rx.c | 45 ++++++++++++++++++++++++++
 2 files changed, 46 insertions(+), 1 deletion(-)
include/net/libeth/tx.h +1 -1
index c3db5c6f1641..a66fc2b3a114 100644
@@ -12,7 +12,7 @@
 
 /**
  * enum libeth_sqe_type - type of &libeth_sqe to act on Tx completion
- * @LIBETH_SQE_EMPTY: unused/empty OR XDP_TX/XSk frame, no action required
+ * @LIBETH_SQE_EMPTY: empty OR netmem/XDP_TX/XSk frame, no action required
  * @LIBETH_SQE_CTX: context descriptor with empty SQE, no action required
  * @LIBETH_SQE_SLAB: kmalloc-allocated buffer, unmap and kfree()
  * @LIBETH_SQE_FRAG: mapped skb frag, only unmap DMA
drivers/net/ethernet/intel/libeth/rx.c +45 -0

66 lines not on this page · raw message

Signature · 1 line
2.52.0
Tested-by on v2 2/5
#4 lore raw

RE: [Intel-wired-lan] [PATCH iwl-next v2 2/5] libeth: handle creating pools with unreadable buffers

Quoted 16 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Alexander Lobakin
Sent: Thursday, December 4, 2025 7:52 AM
To: [email protected]
Cc: Lobakin, Aleksander <[email protected]>; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Simon Horman <[email protected]>; Keller, Jacob E <[email protected]>; Loktionov, Aleksandr <[email protected]>; NXNE CNSE OSDT ITP Upstreaming <[email protected]>; [email protected]; linux- [email protected]
Subject: [Intel-wired-lan] [PATCH iwl-next v2 2/5] libeth: handle creating pools with unreadable buffers

libeth uses netmems for quite some time already, so in order to support unreadable frags / memory providers, it only needs to set PP_FLAG_ALLOW_UNREADABLE_NETMEM when needed. Also add a couple sanity checks to make sure the driver didn't mess up the configuration options and, in case when an MP is installed, return the truesize always equal to PAGE_SIZE, so that libeth_rx_alloc() will never try to allocate frags. Memory providers manage buffers on their own and expect 1:1 buffer / HW Rx descriptor association.

Bonus: mention in the libeth_sqe_type description that LIBETH_SQE_EMPTY should also be used for netmem Tx SQEs -- they don't need DMA unmapping.

Quoted 7 lines
---
 include/net/libeth/tx.h                |  2 +-
 drivers/net/ethernet/intel/libeth/rx.c | 45 ++++++++++++++++++++++++++
 2 files changed, 46 insertions(+), 1 deletion(-)
author maintainer
#5 lore raw

PATCH v2 3/5 ice: migrate to netdev ops lock

In reply to Alexander Lobakin

Queue management ops unconditionally enable netdev locking. The same lock is taken by default by several NAPI configuration functions, such as napi_enable() and netif_napi_set_irq().
Request ops locking in advance and make sure we use the _locked counterparts of those functions to avoid deadlocks, taking the lock manually where needed (suspend/resume, queue rebuild and resets).

---
 drivers/net/ethernet/intel/ice/ice_lib.h    |  6 ++-
 drivers/net/ethernet/intel/ice/ice_lib.c    | 56 +++++++++++++++++----
 drivers/net/ethernet/intel/ice/ice_main.c   | 49 ++++++++++--------
 drivers/net/ethernet/intel/ice/ice_sf_eth.c |  1 +
 drivers/net/ethernet/intel/ice/ice_xsk.c    |  4 +-
 5 files changed, 82 insertions(+), 34 deletions(-)
drivers/net/ethernet/intel/ice/ice_lib.h +4 -2
index 49454d98dcfe..347b63e497e7 100644
@@ -53,9 +53,11 @@ struct ice_vsi *
 ice_vsi_setup(struct ice_pf *pf, struct ice_vsi_cfg_params *params);
 
 void ice_vsi_set_napi_queues(struct ice_vsi *vsi);
-void ice_napi_add(struct ice_vsi *vsi);
-
+void ice_vsi_set_napi_queues_locked(struct ice_vsi *vsi);
 void ice_vsi_clear_napi_queues(struct ice_vsi *vsi);
+void ice_vsi_clear_napi_queues_locked(struct ice_vsi *vsi);
+
+void ice_napi_add(struct ice_vsi *vsi);
 
 int ice_vsi_release(struct ice_vsi *vsi);
 
drivers/net/ethernet/intel/ice/ice_lib.c +47 -9

108 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_main.c +28 -21

98 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_sf_eth.c +1 -0
index 1a2c94375ca7..2c3db1b03055 100644
@@ -58,6 +58,7 @@ static int ice_sf_cfg_netdev(struct ice_dynamic_port *dyn_port,
 	eth_hw_addr_set(netdev, dyn_port->hw_addr);
 	ether_addr_copy(netdev->perm_addr, dyn_port->hw_addr);
 	netdev->netdev_ops = &ice_sf_netdev_ops;
+	netdev->request_ops_lock = true;
 	SET_NETDEV_DEVLINK_PORT(netdev, devlink_port);
 
 	err = register_netdev(netdev);
drivers/net/ethernet/intel/ice/ice_xsk.c +2 -2
index 953e68ed0f9a..6d08a11a86a8 100644
@@ -33,9 +33,9 @@ ice_qvec_toggle_napi(struct ice_vsi *vsi, struct ice_q_vector *q_vector,
 		return;
 
 	if (enable)
-		napi_enable(&q_vector->napi);
+		napi_enable_locked(&q_vector->napi);
 	else
-		napi_disable(&q_vector->napi);
+		napi_disable_locked(&q_vector->napi);
 }
 
 /**
Signature · 1 line
2.52.0
author maintainer
#6 lore raw

Re: [Intel-wired-lan] [PATCH iwl-next v2 3/5] ice: migrate to netdev ops lock

From: Alexander Lobakin <[email protected]>
Date: Thu, 4 Dec 2025 16:51:31 +0100

Quoted 10 lines

Queue management ops unconditionally enable netdev locking. The same lock is taken by default by several NAPI configuration functions, such as napi_enable() and netif_napi_set_irq().
Request ops locking in advance and make sure we use the _locked counterparts of those functions to avoid deadlocks, taking the lock manually where needed (suspend/resume, queue rebuild and resets).

Note: Larysa found that this commit breaks ethtool -L -- the system hangs. Seems like some of the functions called during the queue reconfiguration still take the netdev lock and a deadlock happens (I definitely tested ethtool -G, but might've forgotten to test -L...).

I'll try to fix this ASAP and send a fixup patch. Since nobody (?) reported this earlier, maybe it's not worth dropping the series from the next-queue in the meantime...

Thanks,
Olek

author maintainer
#7 lore raw

PATCH 1/1 ice: fix system hang on `ethtool -L`

ice_set_channels() calls ice_vsi_rebuild() under the netdev lock taken, but ice_vsi_rebuild() calls netif_napi_{add,del}() which take the same lock.
Add ice_vsi_rebuild_locked() which uses the _locked counterparts of these functions and use it in ice_set_channels().

---
Hey Tony, please amend to the patch I replied to.

---
 drivers/net/ethernet/intel/ice/ice_base.h |  2 +
 drivers/net/ethernet/intel/ice/ice_lib.h  |  1 +
 drivers/net/ethernet/intel/ice/ice_base.c | 63 ++++++++++++---
 drivers/net/ethernet/intel/ice/ice_lib.c  | 94 ++++++++++++++++++++---
 drivers/net/ethernet/intel/ice/ice_main.c |  5 +-
 5 files changed, 143 insertions(+), 22 deletions(-)
drivers/net/ethernet/intel/ice/ice_base.h +2 -0
index d28294247599..99b2c7232829 100644
@@ -12,8 +12,10 @@ int __ice_vsi_get_qs(struct ice_qs_cfg *qs_cfg);
 int
 ice_vsi_ctrl_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx, bool wait);
 int ice_vsi_wait_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx);
+int ice_vsi_alloc_q_vectors_locked(struct ice_vsi *vsi);
 int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi);
 void ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi);
+void ice_vsi_free_q_vectors_locked(struct ice_vsi *vsi);
 void ice_vsi_free_q_vectors(struct ice_vsi *vsi);
 int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings,
 			   u16 q_idx);
drivers/net/ethernet/intel/ice/ice_lib.h +1 -0
index 347b63e497e7..e55b72db72c4 100644
@@ -68,6 +68,7 @@ int ice_ena_vsi(struct ice_vsi *vsi, bool locked);
 void ice_vsi_decfg(struct ice_vsi *vsi);
 void ice_dis_vsi(struct ice_vsi *vsi, bool locked);
 
+int ice_vsi_rebuild_locked(struct ice_vsi *vsi, u32 vsi_flags);
 int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags);
 int ice_vsi_cfg(struct ice_vsi *vsi);
 struct ice_vsi *ice_vsi_alloc(struct ice_pf *pf);
drivers/net/ethernet/intel/ice/ice_base.c +54 -9

104 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_lib.c +83 -11

166 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_main.c +3 -2
index 7a1c6859d708..b9d726797919 100644
@@ -4130,6 +4130,7 @@ bool ice_is_wol_supported(struct ice_hw *hw)
  * @locked: is adev device_lock held
  *
  * Only change the number of queues if new_tx, or new_rx is non-0.
+ * Note that it should be called only with the netdev lock taken.
  *
  * Returns 0 on success.
  */
@@ -4155,7 +4156,7 @@ int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx, bool locked)
 
 	/* set for the next time the netdev is started */
 	if (!netif_running(vsi->netdev)) {
-		err = ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT);
+		err = ice_vsi_rebuild_locked(vsi, ICE_VSI_FLAG_NO_INIT);
 		if (err)
 			goto rebuild_err;
 		dev_dbg(ice_pf_to_dev(pf), "Link is down, queue count change happens when link is brought up\n");
@@ -4163,7 +4164,7 @@ int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx, bool locked)
 	}
 
 	ice_vsi_close(vsi);
-	err = ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT);
+	err = ice_vsi_rebuild_locked(vsi, ICE_VSI_FLAG_NO_INIT);
 	if (err)
 		goto rebuild_err;
 
Signature · 1 line
2.52.0
Reviewed-by on v1 1/1
#8 lore raw

RE: [PATCH iwl-next] ice: fix system hang on `ethtool -L`

Quoted 71 lines

-----Original Message-----
From: Lobakin, Aleksander <[email protected]>
Sent: Tuesday, January 20, 2026 6:34 PM
To: Nguyen, Anthony L <[email protected]>; intel-wired- [email protected]
Cc: Lobakin, Aleksander <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Simon Horman <[email protected]>; Keller, Jacob E <[email protected]>; Loktionov, Aleksandr <[email protected]>; NXNE CNSE OSDT ITP Upstreaming <[email protected]>; [email protected]; [email protected]
Subject: [PATCH iwl-next] ice: fix system hang on ethtool -L

ice_set_channels() calls ice_vsi_rebuild() under the netdev lock taken, but ice_vsi_rebuild() calls netif_napi_{add,del}() which take the same lock.
Add ice_vsi_rebuild_locked() which uses the _locked counterparts of these functions and use it in ice_set_channels().

---
Hey Tony, please amend to the patch I replied to.

---
 drivers/net/ethernet/intel/ice/ice_base.h |  2 +
drivers/net/ethernet/intel/ice/ice_lib.h  |  1 +
drivers/net/ethernet/intel/ice/ice_base.c | 63 ++++++++++++---
drivers/net/ethernet/intel/ice/ice_lib.c  | 94 ++++++++++++++++++++---
drivers/net/ethernet/intel/ice/ice_main.c |  5 +-
 5 files changed, 143 insertions(+), 22 deletions(-)
drivers/net/ethernet/intel/ice/ice_base.h +0 -0
index d28294247599..99b2c7232829 100644
@@ -12,8 +12,10 @@ int __ice_vsi_get_qs(struct ice_qs_cfg *qs_cfg);

int ice_vsi_ctrl_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx, bool wait); int ice_vsi_wait_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx);
+int ice_vsi_alloc_q_vectors_locked(struct ice_vsi *vsi);
int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi); void
ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi); +void ice_vsi_free_q_vectors_locked(struct ice_vsi *vsi);
void ice_vsi_free_q_vectors(struct ice_vsi *vsi); int
ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings,

drivers/net/ethernet/intel/ice/ice_base.h +0 -0
 			   u16 q_idx);
drivers/net/ethernet/intel/ice/ice_lib.h +0 -0
index 347b63e497e7..e55b72db72c4 100644
@@ -68,6 +68,7 @@ int ice_ena_vsi(struct ice_vsi *vsi, bool locked);

void ice_vsi_decfg(struct ice_vsi *vsi); void ice_dis_vsi(struct ice_vsi *vsi, bool locked);

+int ice_vsi_rebuild_locked(struct ice_vsi *vsi, u32 vsi_flags);
int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags); int
ice_vsi_cfg(struct ice_vsi *vsi); struct ice_vsi *ice_vsi_alloc(struct ice_pf *pf); diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c
index 7097324c38f3..65e19815bec5 100644

drivers/net/ethernet/intel/ice/ice_base.c static int ice_vsi_alloc_q_vector(struct ice_vsi · line 159

Quoted 9 lines
drivers/net/ethernet/intel/ice/ice_base.c +2 -2
@@ -153,8 +153,8 @@ static int ice_vsi_alloc_q_vector(struct ice_vsi
 *vsi, u16 v_idx)
 	 * handler here (i.e. resume, reset/rebuild, etc.)
 	 */
 	if (vsi->netdev)
-		netif_napi_add_config(vsi->netdev, &q_vector->napi,
-				      ice_napi_poll, v_idx);
+		netif_napi_add_config_locked(vsi->netdev, &q_vector-
 >napi,
+					     ice_napi_poll, v_idx);

If you converted ice_vsi_alloc_q_vector() into _locked, should it be lockdep_assert_held(&vsi->netdev->lock); then?

Everything else looks fine.

...

Quoted 2 lines

--
2.52.0

author maintainer
#9 lore raw

Re: [PATCH iwl-next] ice: fix system hang on `ethtool -L`

From: Loktionov, Aleksandr <[email protected]>
Date: Wed, 21 Jan 2026 08:18:47 +0100

Quoted 78 lines
Quoted 78 lines

-----Original Message-----
From: Lobakin, Aleksander <[email protected]>
Sent: Tuesday, January 20, 2026 6:34 PM
To: Nguyen, Anthony L <[email protected]>; intel-wired- [email protected]
Cc: Lobakin, Aleksander <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Simon Horman <[email protected]>; Keller, Jacob E <[email protected]>; Loktionov, Aleksandr <[email protected]>; NXNE CNSE OSDT ITP Upstreaming <[email protected]>; [email protected]; [email protected]
Subject: [PATCH iwl-next] ice: fix system hang on ethtool -L

ice_set_channels() calls ice_vsi_rebuild() under the netdev lock taken, but ice_vsi_rebuild() calls netif_napi_{add,del}() which take the same lock.
Add ice_vsi_rebuild_locked() which uses the _locked counterparts of these functions and use it in ice_set_channels().

---
Hey Tony, please amend to the patch I replied to.

---
 drivers/net/ethernet/intel/ice/ice_base.h |  2 +
drivers/net/ethernet/intel/ice/ice_lib.h  |  1 +
drivers/net/ethernet/intel/ice/ice_base.c | 63 ++++++++++++---
drivers/net/ethernet/intel/ice/ice_lib.c  | 94 ++++++++++++++++++++---
drivers/net/ethernet/intel/ice/ice_main.c |  5 +-
 5 files changed, 143 insertions(+), 22 deletions(-)
drivers/net/ethernet/intel/ice/ice_base.h +0 -0
index d28294247599..99b2c7232829 100644
@@ -12,8 +12,10 @@ int __ice_vsi_get_qs(struct ice_qs_cfg *qs_cfg);

int ice_vsi_ctrl_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx, bool wait); int ice_vsi_wait_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx);
+int ice_vsi_alloc_q_vectors_locked(struct ice_vsi *vsi);
int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi); void
ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi); +void ice_vsi_free_q_vectors_locked(struct ice_vsi *vsi);
void ice_vsi_free_q_vectors(struct ice_vsi *vsi); int
ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings,

drivers/net/ethernet/intel/ice/ice_base.h +0 -0
 			   u16 q_idx);
drivers/net/ethernet/intel/ice/ice_lib.h +0 -0
index 347b63e497e7..e55b72db72c4 100644
@@ -68,6 +68,7 @@ int ice_ena_vsi(struct ice_vsi *vsi, bool locked);

void ice_vsi_decfg(struct ice_vsi *vsi); void ice_dis_vsi(struct ice_vsi *vsi, bool locked);

+int ice_vsi_rebuild_locked(struct ice_vsi *vsi, u32 vsi_flags);
int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags); int
ice_vsi_cfg(struct ice_vsi *vsi); struct ice_vsi *ice_vsi_alloc(struct ice_pf *pf); diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c
index 7097324c38f3..65e19815bec5 100644

drivers/net/ethernet/intel/ice/ice_base.c +1 -2
@@ -153,8 +153,8 @@ static int ice_vsi_alloc_q_vector(struct ice_vsi
 *vsi, u16 v_idx)
 	 * handler here (i.e. resume, reset/rebuild, etc.)
 	 */
 	if (vsi->netdev)
-		netif_napi_add_config(vsi->netdev, &q_vector->napi,
-				      ice_napi_poll, v_idx);
+		netif_napi_add_config_locked(vsi->netdev, &q_vector-
Quoted 3 lines

drivers/net/ethernet/intel/ice/ice_base.c static int ice_vsi_alloc_q_vector(struct ice_vsi · line 159

Quoted 2 lines
drivers/net/ethernet/intel/ice/ice_base.c +1 -0
 > napi,
+					     ice_napi_poll, v_idx);

If you converted ice_vsi_alloc_q_vector() into _locked, should it be lockdep_assert_held(&vsi->netdev->lock); then?

IIRC the core kernel functions check for this and warn already.

Quoted 3 lines

Everything else looks fine.

Thanks,
Olek

Tested-by on v2 3/5
#10 lore raw

RE: [Intel-wired-lan] [PATCH iwl-next v2 3/5] ice: migrate to netdev ops lock

In reply to Alexander Lobakin
Quoted 16 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Alexander Lobakin
Sent: Thursday, December 4, 2025 7:52 AM
To: [email protected]
Cc: Lobakin, Aleksander <[email protected]>; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Simon Horman <[email protected]>; Keller, Jacob E <[email protected]>; Loktionov, Aleksandr <[email protected]>; NXNE CNSE OSDT ITP Upstreaming <[email protected]>; [email protected]; linux- [email protected]
Subject: [Intel-wired-lan] [PATCH iwl-next v2 3/5] ice: migrate to netdev ops lock

Queue management ops unconditionally enable netdev locking. The same lock is taken by default by several NAPI configuration functions, such as napi_enable() and netif_napi_set_irq(). Request ops locking in advance and make sure we use the _locked counterparts of those functions to avoid deadlocks, taking the lock manually where needed (suspend/resume, queue rebuild and resets).

Quoted 7 lines
---
 drivers/net/ethernet/intel/ice/ice_lib.h    |  6 ++-
 drivers/net/ethernet/intel/ice/ice_lib.c    | 56 +++++++++++++++++----
 drivers/net/ethernet/intel/ice/ice_main.c   | 49 ++++++++++--------
 drivers/net/ethernet/intel/ice/ice_sf_eth.c |  1 +
 drivers/net/ethernet/intel/ice/ice_xsk.c    |  4 +-
 5 files changed, 82 insertions(+), 34 deletions(-)
author maintainer
#11 lore raw

PATCH v2 4/5 ice: implement Rx queue management ops

In reply to Alexander Lobakin

Now ice is ready to get queue_mgmt_ops support. It already has API to disable/reconfig/enable one particular queue (for XSk). Reuse as much of its code as possible to implement Rx queue management callbacks and vice versa -- ice_queue_mem_{alloc,free}() can be reused during ifup/ifdown to elide code duplication. With this, ice passes the io_uring zcrx selftests, meaning the Rx part of netmem/MP support is done.

---
 drivers/net/ethernet/intel/ice/ice_lib.h    |   5 +
 drivers/net/ethernet/intel/ice/ice_txrx.h   |   2 +
 drivers/net/ethernet/intel/ice/ice_base.c   | 192 ++++++++++++++------
 drivers/net/ethernet/intel/ice/ice_main.c   |   2 +-
 drivers/net/ethernet/intel/ice/ice_sf_eth.c |   2 +-
 drivers/net/ethernet/intel/ice/ice_txrx.c   |  26 ++-
 6 files changed, 163 insertions(+), 66 deletions(-)
drivers/net/ethernet/intel/ice/ice_lib.h +5 -0
index 347b63e497e7..2d3168458891 100644
@@ -4,6 +4,8 @@
 #ifndef _ICE_LIB_H_
 #define _ICE_LIB_H_
 
+#include <net/netdev_queues.h>
+
 #include "ice.h"
 #include "ice_vlan.h"
 
@@ -132,4 +134,7 @@ void ice_clear_feature_support(struct ice_pf *pf, enum ice_feature f);
 void ice_init_feature_support(struct ice_pf *pf);
 bool ice_vsi_is_rx_queue_active(struct ice_vsi *vsi);
 void ice_vsi_update_l2tsel(struct ice_vsi *vsi, enum ice_l2tsel l2tsel);
+
+extern const struct netdev_queue_mgmt_ops ice_queue_mgmt_ops;
+
 #endif /* !_ICE_LIB_H_ */
drivers/net/ethernet/intel/ice/ice_txrx.h +2 -0
index c51b1e60f717..e3c682723107 100644
@@ -440,6 +440,8 @@ u16
 ice_select_queue(struct net_device *dev, struct sk_buff *skb,
 		 struct net_device *sb_dev);
 void ice_clean_tx_ring(struct ice_tx_ring *tx_ring);
+void ice_queue_mem_free(struct net_device *dev, void *per_queue_mem);
+void ice_zero_rx_ring(struct ice_rx_ring *rx_ring);
 void ice_clean_rx_ring(struct ice_rx_ring *rx_ring);
 int ice_setup_tx_ring(struct ice_tx_ring *tx_ring);
 int ice_setup_rx_ring(struct ice_rx_ring *rx_ring);
drivers/net/ethernet/intel/ice/ice_base.c +136 -56

267 lines not on this page · raw message

drivers/net/ethernet/intel/ice/ice_main.c +1 -1
index 881b41d37821..25e9091ca309 100644
@@ -3523,7 +3523,7 @@ static void ice_set_ops(struct ice_vsi *vsi)
 	}
 
 	netdev->netdev_ops = &ice_netdev_ops;
-	netdev->request_ops_lock = true;
+	netdev->queue_mgmt_ops = &ice_queue_mgmt_ops;
 	netdev->udp_tunnel_nic_info = &pf->hw.udp_tunnel_nic;
 	netdev->xdp_metadata_ops = &ice_xdp_md_ops;
 	ice_set_ethtool_ops(netdev);
drivers/net/ethernet/intel/ice/ice_sf_eth.c +1 -1
index 2c3db1b03055..41e1606a8222 100644
@@ -58,7 +58,7 @@ static int ice_sf_cfg_netdev(struct ice_dynamic_port *dyn_port,
 	eth_hw_addr_set(netdev, dyn_port->hw_addr);
 	ether_addr_copy(netdev->perm_addr, dyn_port->hw_addr);
 	netdev->netdev_ops = &ice_sf_netdev_ops;
-	netdev->request_ops_lock = true;
+	netdev->queue_mgmt_ops = &ice_queue_mgmt_ops;
 	SET_NETDEV_DEVLINK_PORT(netdev, devlink_port);
 
 	err = register_netdev(netdev);
drivers/net/ethernet/intel/ice/ice_txrx.c +18 -8
index 47d44796635a..b6f56cb81f93 100644
@@ -530,17 +530,13 @@ void ice_rxq_pp_destroy(struct ice_rx_ring *rq)
 	rq->hdr_pp = NULL;
 }
 
-/**
- * ice_clean_rx_ring - Free Rx buffers
- * @rx_ring: ring to be cleaned
- */
-void ice_clean_rx_ring(struct ice_rx_ring *rx_ring)
+void ice_queue_mem_free(struct net_device *dev, void *per_queue_mem)
 {
-	u32 size;
+	struct ice_rx_ring *rx_ring = per_queue_mem;
 
 	if (rx_ring->xsk_pool) {
 		ice_xsk_clean_rx_ring(rx_ring);
-		goto rx_skip_free;
+		return;
 	}
 
 	/* ring already cleared, nothing to do */
@@ -567,8 +563,12 @@ void ice_clean_rx_ring(struct ice_rx_ring *rx_ring)
 	}
 
 	ice_rxq_pp_destroy(rx_ring);
+}
+
+void ice_zero_rx_ring(struct ice_rx_ring *rx_ring)
+{
+	size_t size;
 
-rx_skip_free:
 	/* Zero out the descriptor ring */
 	size = ALIGN(rx_ring->count * sizeof(union ice_32byte_rx_desc),
 		     PAGE_SIZE);
@@ -579,6 +579,16 @@ void ice_clean_rx_ring(struct ice_rx_ring *rx_ring)
 	rx_ring->next_to_use = 0;
 }
 
+/**
+ * ice_clean_rx_ring - Free Rx buffers
+ * @rx_ring: ring to be cleaned
+ */
+void ice_clean_rx_ring(struct ice_rx_ring *rx_ring)
+{
+	ice_queue_mem_free(rx_ring->netdev, rx_ring);
+	ice_zero_rx_ring(rx_ring);
+}
+
 /**
  * ice_free_rx_ring - Free Rx resources
  * @rx_ring: ring to clean the resources from
Signature · 1 line
2.52.0
Tested-by on v2 4/5
#12 lore raw

RE: [Intel-wired-lan] [PATCH iwl-next v2 4/5] ice: implement Rx queue management ops

Quoted 17 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Alexander Lobakin
Sent: Thursday, December 4, 2025 7:52 AM
To: [email protected]
Cc: Lobakin, Aleksander <[email protected]>; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Simon Horman <[email protected]>; Keller, Jacob E <[email protected]>; Loktionov, Aleksandr <[email protected]>; NXNE CNSE OSDT ITP Upstreaming <[email protected]>; [email protected]; linux- [email protected]
Subject: [Intel-wired-lan] [PATCH iwl-next v2 4/5] ice: implement Rx queue management ops

Now ice is ready to get queue_mgmt_ops support. It already has API to disable/reconfig/enable one particular queue (for XSk). Reuse as much of its code as possible to implement Rx queue management callbacks and vice versa -- ice_queue_mem_{alloc,free}() can be reused during ifup/ifdown to elide code duplication.
With this, ice passes the io_uring zcrx selftests, meaning the Rx part of netmem/MP support is done.

Quoted 8 lines
---
 drivers/net/ethernet/intel/ice/ice_lib.h    |   5 +
 drivers/net/ethernet/intel/ice/ice_txrx.h   |   2 +
 drivers/net/ethernet/intel/ice/ice_base.c   | 192 ++++++++++++++------
 drivers/net/ethernet/intel/ice/ice_main.c   |   2 +-
 drivers/net/ethernet/intel/ice/ice_sf_eth.c |   2 +-
 drivers/net/ethernet/intel/ice/ice_txrx.c   |  26 ++-
 6 files changed, 163 insertions(+), 66 deletions(-)
author maintainer
#13 lore raw

PATCH v2 5/5 ice: add support for transmitting unreadable frags

In reply to Alexander Lobakin

Advertise netmem Tx support in ice. The only change needed is to set ICE_TX_BUF_FRAG conditionally, only when skb_frag_is_net_iov() is false. Otherwise, the Tx buffer type will be ICE_TX_BUF_EMPTY and the driver will skip the DMA unmapping operation.

---
 drivers/net/ethernet/intel/ice/ice_main.c   |  1 +
 drivers/net/ethernet/intel/ice/ice_sf_eth.c |  1 +
 drivers/net/ethernet/intel/ice/ice_txrx.c   | 17 +++++++++++++----
 3 files changed, 15 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/ice/ice_main.c +1 -0
index 25e9091ca309..66601b1b7fec 100644
@@ -3524,6 +3524,7 @@ static void ice_set_ops(struct ice_vsi *vsi)
 
 	netdev->netdev_ops = &ice_netdev_ops;
 	netdev->queue_mgmt_ops = &ice_queue_mgmt_ops;
+	netdev->netmem_tx = true;
 	netdev->udp_tunnel_nic_info = &pf->hw.udp_tunnel_nic;
 	netdev->xdp_metadata_ops = &ice_xdp_md_ops;
 	ice_set_ethtool_ops(netdev);
drivers/net/ethernet/intel/ice/ice_sf_eth.c +1 -0
index 41e1606a8222..51ad13c9d7f9 100644
@@ -59,6 +59,7 @@ static int ice_sf_cfg_netdev(struct ice_dynamic_port *dyn_port,
 	ether_addr_copy(netdev->perm_addr, dyn_port->hw_addr);
 	netdev->netdev_ops = &ice_sf_netdev_ops;
 	netdev->queue_mgmt_ops = &ice_queue_mgmt_ops;
+	netdev->netmem_tx = true;
 	SET_NETDEV_DEVLINK_PORT(netdev, devlink_port);
 
 	err = register_netdev(netdev);
drivers/net/ethernet/intel/ice/ice_txrx.c +13 -4
index b6f56cb81f93..e8e1acbd5a7d 100644
@@ -113,11 +113,17 @@ ice_prgm_fdir_fltr(struct ice_vsi *vsi, struct ice_fltr_desc *fdir_desc,
 static void
 ice_unmap_and_free_tx_buf(struct ice_tx_ring *ring, struct ice_tx_buf *tx_buf)
 {
-	if (tx_buf->type != ICE_TX_BUF_XDP_TX && dma_unmap_len(tx_buf, len))
+	switch (tx_buf->type) {
+	case ICE_TX_BUF_DUMMY:
+	case ICE_TX_BUF_FRAG:
+	case ICE_TX_BUF_SKB:
+	case ICE_TX_BUF_XDP_XMIT:
 		dma_unmap_page(ring->dev,
 			       dma_unmap_addr(tx_buf, dma),
 			       dma_unmap_len(tx_buf, len),
 			       DMA_TO_DEVICE);
+		break;
+	}
 
 	switch (tx_buf->type) {
 	case ICE_TX_BUF_DUMMY:
@@ -337,12 +343,14 @@ static bool ice_clean_tx_irq(struct ice_tx_ring *tx_ring, int napi_budget)
 			}
 
 			/* unmap any remaining paged data */
-			if (dma_unmap_len(tx_buf, len)) {
+			if (tx_buf->type != ICE_TX_BUF_EMPTY) {
 				dma_unmap_page(tx_ring->dev,
 					       dma_unmap_addr(tx_buf, dma),
 					       dma_unmap_len(tx_buf, len),
 					       DMA_TO_DEVICE);
+
 				dma_unmap_len_set(tx_buf, len, 0);
+				tx_buf->type = ICE_TX_BUF_EMPTY;
 			}
 		}
 		ice_trace(clean_tx_irq_unmap_eop, tx_ring, tx_desc, tx_buf);
@@ -1493,7 +1501,8 @@ ice_tx_map(struct ice_tx_ring *tx_ring, struct ice_tx_buf *first,
 				       DMA_TO_DEVICE);
 
 		tx_buf = &tx_ring->tx_buf[i];
-		tx_buf->type = ICE_TX_BUF_FRAG;
+		if (!skb_frag_is_net_iov(frag))
+			tx_buf->type = ICE_TX_BUF_FRAG;
 	}
 
 	/* record SW timestamp if HW timestamp is not available */
@@ -2368,7 +2377,7 @@ void ice_clean_ctrl_tx_irq(struct ice_tx_ring *tx_ring)
 		}
 
 		/* unmap the data header */
-		if (dma_unmap_len(tx_buf, len))
+		if (tx_buf->type != ICE_TX_BUF_EMPTY)
 			dma_unmap_single(tx_ring->dev,
 					 dma_unmap_addr(tx_buf, dma),
 					 dma_unmap_len(tx_buf, len),
Signature · 1 line
2.52.0
Tested-by on v2 5/5
#14 lore raw

RE: [Intel-wired-lan] [PATCH iwl-next v2 5/5] ice: add support for transmitting unreadable frags

Quoted 12 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Alexander Lobakin
Sent: Thursday, December 4, 2025 7:52 AM
To: [email protected]
Cc: Lobakin, Aleksander <[email protected]>; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Simon Horman <[email protected]>; Keller, Jacob E <[email protected]>; Loktionov, Aleksandr <[email protected]>; NXNE CNSE OSDT ITP Upstreaming <[email protected]>; [email protected]; linux- [email protected]
Subject: [Intel-wired-lan] [PATCH iwl-next v2 5/5] ice: add support for transmitting unreadable frags

Advertise netmem Tx support in ice. The only change needed is to set ICE_TX_BUF_FRAG conditionally, only when skb_frag_is_net_iov() is false. Otherwise, the Tx buffer type will be ICE_TX_BUF_EMPTY and the > driver will skip the DMA unmapping operation.

Quoted 8 lines
---
 drivers/net/ethernet/intel/ice/ice_main.c   |  1 +
 drivers/net/ethernet/intel/ice/ice_sf_eth.c |  1 +
 drivers/net/ethernet/intel/ice/ice_txrx.c   | 17 +++++++++++++----
 3 files changed, 15 insertions(+), 4 deletions(-)
author maintainer
#15 lore raw
In reply to Alexander Lobakin

From: Alexander Lobakin <[email protected]>
Date: Thu, 4 Dec 2025 16:51:28 +0100

Quoted 43 lines

Now that ice uses libeth for managing Rx buffers and supports configurable header split, it's ready to get support for sending and receiving packets with unreadable (to the kernel) frags.

Extend libeth just a little bit to allow creating PPs with custom memory providers and make sure ice works correctly with the netdev ops locking. Then add the full set of queue_mgmt_ops and don't unmap unreadable frags on Tx completion.
No perf regressions for the regular flows and no code duplication implied.

Credits to the fbnic developers, which's code helped me understand the memory providers and queue_mgmt_ops logics and served as a reference.

Alexander Lobakin (5):
libeth: pass Rx queue index to PP when creating a fill queue
libeth: handle creating pools with unreadable buffers
ice: migrate to netdev ops lock
ice: implement Rx queue management ops
ice: add support for transmitting unreadable frags

 drivers/net/ethernet/intel/ice/ice_lib.h    |  11 +-
 drivers/net/ethernet/intel/ice/ice_txrx.h   |   2 +
 drivers/net/ethernet/intel/idpf/idpf_txrx.h |   2 +
 include/net/libeth/rx.h                     |   2 +
 include/net/libeth/tx.h                     |   2 +-
 drivers/net/ethernet/intel/iavf/iavf_txrx.c |   1 +
 drivers/net/ethernet/intel/ice/ice_base.c   | 194 ++++++++++++++------
 drivers/net/ethernet/intel/ice/ice_lib.c    |  56 +++++-
 drivers/net/ethernet/intel/ice/ice_main.c   |  50 ++---
 drivers/net/ethernet/intel/ice/ice_sf_eth.c |   2 +
 drivers/net/ethernet/intel/ice/ice_txrx.c   |  43 +++--
 drivers/net/ethernet/intel/ice/ice_xsk.c    |   4 +-
 drivers/net/ethernet/intel/idpf/idpf_txrx.c |  13 ++
 drivers/net/ethernet/intel/libeth/rx.c      |  46 +++++
 14 files changed, 325 insertions(+), 103 deletions(-)

---
From v1[0]:
* rebase on top of the latest next-queue;
* fix a typo 'rxq_ixd' -> 'rxq_idx' (Tony).

Quoted 7 lines

Testing hints:
* regular Rx and Tx for regressions;
* <kernel root>/tools/testing/selftests/drivers/net/hw/ contains scripts for testing netmem Rx and Tx, namely devmem.py and iou-zcrx.py (read the documentation first).

[0] https://lore.kernel.org/intel-wired-lan/[email protected]

Current status from the validation:

* io_uring tests pass, except for tests which try to setup RSS Rx contexts -- after recent changes in the kernel, seems like at least some of our drivers return -EOPNOTSUPP when trying to configure RSS.

Tony, did you have any related reports or planned fixes?

* devmem -- only the Tx test fails, may be related to our complicated .ndo_start_xmit() logic in ice, I'll investigate this as soon as I get some details from the val.

Thanks,
Olek

maintainer
#16 lore raw

On 1/29/2026 3:03 AM, Alexander Lobakin wrote:

...

Quoted 5 lines

* io_uring tests pass, except for tests which try to setup RSS Rx contexts -- after recent changes in the kernel, seems like at least some of our drivers return -EOPNOTSUPP when trying to configure RSS.

Tony, did you have any related reports or planned fixes?

The only thing I'm aware of for ice RSS issues is for E830

ice: fix setting RSS VSI hash for E830
https://lore.kernel.org/intel-wired-lan/[email protected]/

Thanks,
Tony

Quoted 6 lines

* devmem -- only the Tx test fails, may be related to our complicated .ndo_start_xmit() logic in ice, I'll investigate this as soon as I get some details from the val.

Thanks,
Olek

author maintainer
#17 lore raw
In reply to Alexander Lobakin

From: Alexander Lobakin <[email protected]>
Date: Thu, 29 Jan 2026 12:03:28 +0100

Quoted 52 lines

From: Alexander Lobakin <[email protected]>
Date: Thu, 4 Dec 2025 16:51:28 +0100

Quoted 49 lines

Now that ice uses libeth for managing Rx buffers and supports configurable header split, it's ready to get support for sending and receiving packets with unreadable (to the kernel) frags.

Extend libeth just a little bit to allow creating PPs with custom memory providers and make sure ice works correctly with the netdev ops locking. Then add the full set of queue_mgmt_ops and don't unmap unreadable frags on Tx completion.
No perf regressions for the regular flows and no code duplication implied.

Credits to the fbnic developers, which's code helped me understand the memory providers and queue_mgmt_ops logics and served as a reference.

Alexander Lobakin (5):
libeth: pass Rx queue index to PP when creating a fill queue
libeth: handle creating pools with unreadable buffers
ice: migrate to netdev ops lock
ice: implement Rx queue management ops
ice: add support for transmitting unreadable frags

 drivers/net/ethernet/intel/ice/ice_lib.h    |  11 +-
 drivers/net/ethernet/intel/ice/ice_txrx.h   |   2 +
 drivers/net/ethernet/intel/idpf/idpf_txrx.h |   2 +
 include/net/libeth/rx.h                     |   2 +
 include/net/libeth/tx.h                     |   2 +-
 drivers/net/ethernet/intel/iavf/iavf_txrx.c |   1 +
 drivers/net/ethernet/intel/ice/ice_base.c   | 194 ++++++++++++++------
 drivers/net/ethernet/intel/ice/ice_lib.c    |  56 +++++-
 drivers/net/ethernet/intel/ice/ice_main.c   |  50 ++---
 drivers/net/ethernet/intel/ice/ice_sf_eth.c |   2 +
 drivers/net/ethernet/intel/ice/ice_txrx.c   |  43 +++--
 drivers/net/ethernet/intel/ice/ice_xsk.c    |   4 +-
 drivers/net/ethernet/intel/idpf/idpf_txrx.c |  13 ++
 drivers/net/ethernet/intel/libeth/rx.c      |  46 +++++
 14 files changed, 325 insertions(+), 103 deletions(-)

---
From v1[0]:
* rebase on top of the latest next-queue;
* fix a typo 'rxq_ixd' -> 'rxq_idx' (Tony).

Testing hints:
* regular Rx and Tx for regressions;
* <kernel root>/tools/testing/selftests/drivers/net/hw/ contains scripts for testing netmem Rx and Tx, namely devmem.py and iou-zcrx.py (read the documentation first).

Quoted 7 lines
Quoted 1 line

[0] https://lore.kernel.org/intel-wired-lan/[email protected]

Current status from the validation:

* io_uring tests pass, except for tests which try to setup RSS Rx contexts -- after recent changes in the kernel, seems like at least some of our drivers return -EOPNOTSUPP when trying to configure RSS.

Ok this might be due to that those scripts try to create new RSS contexts. In fact zcrx works.

Quoted 6 lines

Tony, did you have any related reports or planned fixes?

* devmem -- only the Tx test fails, may be related to our complicated .ndo_start_xmit() logic in ice, I'll investigate this as soon as I get some details from the val.

In fact it works, it's just that by default without isolating TCP Rx flows the completion packet may finish on any queue, not only the ones bound to devmem. So ncdevmem reports "Ok" when the completion actually hit the devmem Rx queue. Actual devmem Tx always works -- the output is visible on the receiver side even when ncdevmem says "missing Tx completion".

With that said, the only issue is that the bugfix was sent today for. I'll merge it into the series and respin it once the window opens.

Thanks,
Olek