From nobody Tue Dec 2 02:59:31 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 80128334C2A; Mon, 17 Nov 2025 13:49:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763387369; cv=none; b=ZQBQhMql2muoYiWVxcBXCEy1wrMvrfXE0QgNcSZ81hTwPwKRHGVXchcbY7DEhNRoI0MVizFm3leHR0aj01Jsl6WvM5Cl7QApPcfjXWt7eO45LdJr5+Ii2/Yx3eCo2HnsWKIn3iLpyqzdo2L8FF17qGfLHAMuUspiOKEG/Q2T2yw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763387369; c=relaxed/simple; bh=sr3X5V/RLfy4H2zf8sVFkC7I1lqZf8rvvoj7P55ePT4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=vEm/+GPK8JZgpzVtqKakDg1Osnv++qv0DjsbjgR4usNz8QcEyesHFfVcvXfPVWhZBOfadWzXBh7l9Yl6Gs3A7HXQtd+FPX/8bG2rlCOPUpYt50+DwCafdW7CnJqEJ70N9PhMZvaDi/yiTCm/FcWujpIyANFPbsItKlV58mXI+ig= 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=htR4t9bl; arc=none smtp.client-ip=198.175.65.19 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="htR4t9bl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1763387368; x=1794923368; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sr3X5V/RLfy4H2zf8sVFkC7I1lqZf8rvvoj7P55ePT4=; b=htR4t9blBmRn9iM4rIIcxWgd64YHuiwz1XNTUP75CPcUMHj0REr3OEx5 44LNiCGjE7oydGyWi9gkT6vaV2lCxCAnBv0qdoAgTA/zjsx+YzRmzjzqP OpI01PmqFP5NI9ACF7cNcR2WK0jU7IViSJJ/MWaNXi8mA72YTYPROG0li YGH2zrZVWre2YLaMMzQShBkrRPfqCJN6eLYMgenPpcHR1cAHqMrwLYVBd b9BNyjk6B/QIi1QVkuurkMBbFM0zRGvIP7tBPv/gJNVCMZEC0hDjtFXWT HyQV1+0pMEhHWO7l4PQnG38e07psv9p6ORGXT8tWe9qQWLDbTt7p0mAiA Q==; X-CSE-ConnectionGUID: N0lUgD7tQAqTmV29M0xvUg== X-CSE-MsgGUID: DTXpqn2QQtCNv5zx4jkhPw== X-IronPort-AV: E=McAfee;i="6800,10657,11616"; a="65266970" X-IronPort-AV: E=Sophos;i="6.19,311,1754982000"; d="scan'208";a="65266970" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2025 05:49:27 -0800 X-CSE-ConnectionGUID: k3T+6rpiS32o8mwvJ3TIRA== X-CSE-MsgGUID: /mnZXlZxQXCMdorhtXUA6g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,311,1754982000"; d="scan'208";a="190684008" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by fmviesa008.fm.intel.com with ESMTP; 17 Nov 2025 05:49:22 -0800 Received: from mglak.igk.intel.com (mglak.igk.intel.com [10.237.112.146]) by irvmail002.ir.intel.com (Postfix) with ESMTP id 13B4E37E3C; Mon, 17 Nov 2025 13:49:20 +0000 (GMT) From: Larysa Zaremba To: intel-wired-lan@lists.osuosl.org, Tony Nguyen Cc: aleksander.lobakin@intel.com, sridhar.samudrala@intel.com, "Singhai, Anjali" , Michal Swiatkowski , Larysa Zaremba , "Fijalkowski, Maciej" , Emil Tantilov , Madhu Chittim , Josh Hay , "Keller, Jacob E" , jayaprakash.shanmugam@intel.com, natalia.wochtman@intel.com, Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Jonathan Corbet , Richard Cochran , Przemek Kitszel , Andrew Lunn , netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH iwl-next v5 04/15] libeth: allow to create fill queues without NAPI Date: Mon, 17 Nov 2025 14:48:44 +0100 Message-ID: <20251117134912.18566-5-larysa.zaremba@intel.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20251117134912.18566-1-larysa.zaremba@intel.com> References: <20251117134912.18566-1-larysa.zaremba@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" From: Pavan Kumar Linga Control queues can utilize libeth_rx fill queues, despite working outside of NAPI context. The only problem is standard fill queues requiring NAPI that provides them with the device pointer. Introduce a way to provide the device directly without using NAPI. Suggested-by: Alexander Lobakin Reviewed-by: Maciej Fijalkowski Signed-off-by: Pavan Kumar Linga Signed-off-by: Larysa Zaremba --- drivers/net/ethernet/intel/libeth/rx.c | 9 +++++---- include/net/libeth/rx.h | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/intel/libeth/rx.c b/drivers/net/ethernet/= intel/libeth/rx.c index 62521a1f4ec9..1d8248a31037 100644 --- a/drivers/net/ethernet/intel/libeth/rx.c +++ b/drivers/net/ethernet/intel/libeth/rx.c @@ -145,19 +145,20 @@ static bool libeth_rx_page_pool_params_zc(struct libe= th_fq *fq, /** * libeth_rx_fq_create - create a PP with the default libeth settings * @fq: buffer queue struct to fill - * @napi: &napi_struct covering this PP (no usage outside its poll loops) + * @napi_dev: &napi_struct for NAPI (data) queues, &device for others * * Return: %0 on success, -%errno on failure. */ -int libeth_rx_fq_create(struct libeth_fq *fq, struct napi_struct *napi) +int libeth_rx_fq_create(struct libeth_fq *fq, void *napi_dev) { + struct napi_struct *napi =3D fq->no_napi ? NULL : napi_dev; struct page_pool_params pp =3D { .flags =3D PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV, .order =3D LIBETH_RX_PAGE_ORDER, .pool_size =3D fq->count, .nid =3D fq->nid, - .dev =3D napi->dev->dev.parent, - .netdev =3D napi->dev, + .dev =3D napi ? napi->dev->dev.parent : napi_dev, + .netdev =3D napi ? napi->dev : NULL, .napi =3D napi, }; struct libeth_fqe *fqes; diff --git a/include/net/libeth/rx.h b/include/net/libeth/rx.h index 5d991404845e..0e736846c5e8 100644 --- a/include/net/libeth/rx.h +++ b/include/net/libeth/rx.h @@ -69,6 +69,7 @@ enum libeth_fqe_type { * @type: type of the buffers this queue has * @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 * @buf_len: HW-writeable length per each buffer * @nid: ID of the closest NUMA node with memory */ @@ -85,12 +86,13 @@ struct libeth_fq { enum libeth_fqe_type type:2; bool hsplit:1; bool xdp:1; + bool no_napi:1; =20 u32 buf_len; int nid; }; =20 -int libeth_rx_fq_create(struct libeth_fq *fq, struct napi_struct *napi); +int libeth_rx_fq_create(struct libeth_fq *fq, void *napi_dev); void libeth_rx_fq_destroy(struct libeth_fq *fq); =20 /** --=20 2.47.0