From nobody Tue Dec 2 00:44:56 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3C9632A3CC; Tue, 25 Nov 2025 17:36:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764092213; cv=none; b=abuz8zdC7PlzaiVYUQD4olmoH1h2paoxgbvNp1L3as1n/Sp9VjIvoDZ2uuD6EYefOTSGsAk29StHs/X1knhPMdUk9iYr7mCVxYV+BNA/ZrmiyI7n9bX7p1SqKUGpQTpHU9rTfE5XFpnJO5x/kPPIwXz6//k3OqPM48z6/H2y2/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764092213; c=relaxed/simple; bh=DckpuTLHr+h44ictMmml2fKM41YlxFMkmDarCT3LOPM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HeNFeN80RhzBMo1CdtJKWz9dxrQeAKHkn7NQ7RsbNlUAut1oBh4T2AeXY5K5m0RRwPL4O7aDhsA1nKsvAPcPfsvC5lA/JzktgYdLJ1s8TddOHXhMbAtE8gA3eVIFRGgePx2bzCjoK4higFMh8tXKqs2WJ4lRndbooQ/cTkgEVgY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=UYFRyfiS; arc=none smtp.client-ip=192.198.163.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UYFRyfiS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1764092212; x=1795628212; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DckpuTLHr+h44ictMmml2fKM41YlxFMkmDarCT3LOPM=; b=UYFRyfiSrG3sL8SaTOLP2Pvyxu45HJ4jsQDdLzwQjYVaDnWUfPFRC+iF yZ5Mi0is86ubFgLXrd2AdPl9hxRmOEZZOIZISIaasV6NkytKKOq5emNu3 dboDNRVa44xo5byfICKp5WcLsQGU7CQwCz+CGzBr9HweMsAIPCH2a6T6T EJ88rUVC+68ACps/WSvyPANkYhV61SD+FaD0PZ86/D7Pqo1zs4ZT9OxNT pLuLaON/fwZZvJ5FzDIikOg6p9uxCo4FMp0UCYsi/Ca1B/t3hLU7R+G++ GSqlVeD2KeQ2i/AKb/7dYKLdSX2TrerC+R6oFP0gh/dkKXrS3IAwKp0yu w==; X-CSE-ConnectionGUID: D7v+CpU8T76A12ByLok0yw== X-CSE-MsgGUID: Y59BkbnmS7O4p086+iTKWw== X-IronPort-AV: E=McAfee;i="6800,10657,11624"; a="69979927" X-IronPort-AV: E=Sophos;i="6.20,226,1758610800"; d="scan'208";a="69979927" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Nov 2025 09:36:52 -0800 X-CSE-ConnectionGUID: DoZsEv1SRKOmu96wqKZmSQ== X-CSE-MsgGUID: 9b02swwvT4uoQHfnAYAfBw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.20,226,1758610800"; d="scan'208";a="216040434" Received: from newjersey.igk.intel.com ([10.102.20.203]) by fmviesa002.fm.intel.com with ESMTP; 25 Nov 2025 09:36:48 -0800 From: Alexander Lobakin To: intel-wired-lan@lists.osuosl.org Cc: Alexander Lobakin , Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Jacob Keller , Aleksandr Loktionov , nxne.cnse.osdt.itp.upstreaming@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH iwl-next 5/5] ice: add support for transmitting unreadable frags Date: Tue, 25 Nov 2025 18:36:03 +0100 Message-ID: <20251125173603.3834486-6-aleksander.lobakin@intel.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251125173603.3834486-1-aleksander.lobakin@intel.com> References: <20251125173603.3834486-1-aleksander.lobakin@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. Reviewed-by: Jacob Keller Reviewed-by: Aleksandr Loktionov Signed-off-by: Alexander Lobakin --- 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(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethern= et/intel/ice/ice_main.c index 9eb27a0d984b..0ac28b45e0fa 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -3524,6 +3524,7 @@ static void ice_set_ops(struct ice_vsi *vsi) =20 netdev->netdev_ops =3D &ice_netdev_ops; netdev->queue_mgmt_ops =3D &ice_queue_mgmt_ops; + netdev->netmem_tx =3D true; netdev->udp_tunnel_nic_info =3D &pf->hw.udp_tunnel_nic; netdev->xdp_metadata_ops =3D &ice_xdp_md_ops; ice_set_ethtool_ops(netdev); diff --git a/drivers/net/ethernet/intel/ice/ice_sf_eth.c b/drivers/net/ethe= rnet/intel/ice/ice_sf_eth.c index 41e1606a8222..51ad13c9d7f9 100644 --- a/drivers/net/ethernet/intel/ice/ice_sf_eth.c +++ b/drivers/net/ethernet/intel/ice/ice_sf_eth.c @@ -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 =3D &ice_sf_netdev_ops; netdev->queue_mgmt_ops =3D &ice_queue_mgmt_ops; + netdev->netmem_tx =3D true; SET_NETDEV_DEVLINK_PORT(netdev, devlink_port); =20 err =3D register_netdev(netdev); diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethern= et/intel/ice/ice_txrx.c index b00fa436472d..494bcfed75af 100644 --- a/drivers/net/ethernet/intel/ice/ice_txrx.c +++ b/drivers/net/ethernet/intel/ice/ice_txrx.c @@ -113,11 +113,17 @@ ice_prgm_fdir_fltr(struct ice_vsi *vsi, struct ice_fl= tr_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 !=3D 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; + } =20 switch (tx_buf->type) { case ICE_TX_BUF_DUMMY: @@ -337,12 +343,14 @@ static bool ice_clean_tx_irq(struct ice_tx_ring *tx_r= ing, int napi_budget) } =20 /* unmap any remaining paged data */ - if (dma_unmap_len(tx_buf, len)) { + if (tx_buf->type !=3D 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 =3D ICE_TX_BUF_EMPTY; } } ice_trace(clean_tx_irq_unmap_eop, tx_ring, tx_desc, tx_buf); @@ -1492,7 +1500,8 @@ ice_tx_map(struct ice_tx_ring *tx_ring, struct ice_tx= _buf *first, DMA_TO_DEVICE); =20 tx_buf =3D &tx_ring->tx_buf[i]; - tx_buf->type =3D ICE_TX_BUF_FRAG; + if (!skb_frag_is_net_iov(frag)) + tx_buf->type =3D ICE_TX_BUF_FRAG; } =20 /* record SW timestamp if HW timestamp is not available */ @@ -2367,7 +2376,7 @@ void ice_clean_ctrl_tx_irq(struct ice_tx_ring *tx_rin= g) } =20 /* unmap the data header */ - if (dma_unmap_len(tx_buf, len)) + if (tx_buf->type !=3D ICE_TX_BUF_EMPTY) dma_unmap_single(tx_ring->dev, dma_unmap_addr(tx_buf, dma), dma_unmap_len(tx_buf, len), --=20 2.51.1