From nobody Mon Feb 9 13:57:16 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 CAD8E230D0E; Thu, 24 Apr 2025 11:33:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745494382; cv=none; b=OatcCEf8skRGg4Vg3aogCKMwkWIYR4UF/1gEtBYHdCxtZBI4mIPYKCt46KoL0t4954LTI/xgCgCckFyUYedPcabOw0rs7MdJzguWGZOkAHXu8uK0T4ELCEg1OmjxXBMMccDgcWFz49IxHpGa+jwmvVxJyDm0EBrtxtT5/MzGatA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745494382; c=relaxed/simple; bh=jhjKykB23fCTps87HNyTFruH+TAg/hlq47KmVtyfNDQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=owZ7XW+BEV6hLkzJAHIzpCgXMkUC877/d8tZkzdZ6H9qHazTy8sqbg7/r1vwwCfSX/aUYJkNlnt5WqM+gk5G6qygQLBheZEwgkMnj7787k0x6/7Q+qrqdnxRMm8zPs2T2xnGLGSM0XhQEpBqPimtyNitkJPTsA+Cog9BU/pVWrU= 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=PoZQl2B6; arc=none smtp.client-ip=192.198.163.11 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="PoZQl2B6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1745494381; x=1777030381; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jhjKykB23fCTps87HNyTFruH+TAg/hlq47KmVtyfNDQ=; b=PoZQl2B6qT56WyuvQBh1mr5folNzbx0WohtGxiB9cjTxMMHk0UEgAGeR 66mj1+Y6Nn5+UHYU20aIKizTGwaYr6eU9RYcHlayzDm6/U3daiEHRSLzi M8WZQvVetHvq5datynEh6bEukkfl4loCCAywluOzyaKY3qvoyeWA2DJ9Z gc/6Dsh1gW7LDufreYJqZVN33GRoidGKAJ7R2XQZ2DdWcWw9+2M22zRuP AVSF1SAJpVjq3IegUZvGiJEjeL3dzCW2F/6l0a93hn3YzDqJSn2YtXB0W 0YP9DtgbVn13vKx7QqBQbxRuO/cgStmhB/SlJOXmx9cXcmEpI3ZBl5snw g==; X-CSE-ConnectionGUID: HB7uCYa/SZ+w5X7dnUUj1w== X-CSE-MsgGUID: XIvUWuQZSsChNzIxxwAHKQ== X-IronPort-AV: E=McAfee;i="6700,10204,11412"; a="57771196" X-IronPort-AV: E=Sophos;i="6.15,235,1739865600"; d="scan'208";a="57771196" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2025 04:33:00 -0700 X-CSE-ConnectionGUID: TjwPKtzHT4OsE1Cip+/epA== X-CSE-MsgGUID: DdcEiFvCQRaGNNM8OjfOOw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,235,1739865600"; d="scan'208";a="137389386" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by fmviesa005.fm.intel.com with ESMTP; 24 Apr 2025 04:32:54 -0700 Received: from mglak.igk.intel.com (mglak.igk.intel.com [10.237.112.146]) by irvmail002.ir.intel.com (Postfix) with ESMTP id 8A69133E9B; Thu, 24 Apr 2025 12:32:51 +0100 (IST) From: Larysa Zaremba To: intel-wired-lan@lists.osuosl.org, Tony Nguyen Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Jonathan Corbet , Przemek Kitszel , Jiri Pirko , Tatyana Nikolova , Andrew Lunn , Alexander Lobakin , Michael Ellerman , Maciej Fijalkowski , Lee Trager , Madhavan Srinivasan , Larysa Zaremba , Sridhar Samudrala , Jacob Keller , Michal Swiatkowski , Mateusz Polchlopek , Ahmed Zaki , netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, "Karlsson, Magnus" , Emil Tantilov , Madhu Chittim , Josh Hay , Milena Olech , pavan.kumar.linga@intel.com, "Singhai, Anjali" Subject: [PATCH iwl-next v2 04/14] libeth: allow to create fill queues without NAPI Date: Thu, 24 Apr 2025 13:32:27 +0200 Message-ID: <20250424113241.10061-5-larysa.zaremba@intel.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250424113241.10061-1-larysa.zaremba@intel.com> References: <20250424113241.10061-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 66d1d23b8ad2..916e8888959c 100644 --- a/drivers/net/ethernet/intel/libeth/rx.c +++ b/drivers/net/ethernet/intel/libeth/rx.c @@ -141,19 +141,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, .dma_dir =3D DMA_FROM_DEVICE, }; diff --git a/include/net/libeth/rx.h b/include/net/libeth/rx.h index ab05024be518..9b631299fa55 100644 --- a/include/net/libeth/rx.h +++ b/include/net/libeth/rx.h @@ -66,6 +66,7 @@ enum libeth_fqe_type { * @count: number of descriptors/buffers the queue has * @type: type of the buffers this queue has * @hsplit: flag whether header split 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 */ @@ -81,12 +82,13 @@ struct libeth_fq { /* Cold fields */ enum libeth_fqe_type type:2; bool hsplit: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