From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (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 5FCBB3D47A0; Tue, 28 Apr 2026 08:27:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777364829; cv=none; b=HCUTmA9rr0OL3UL1YjAnxIn5a8CmCJyWvLufeB0+hnUteHHKT5Ovw/DfLafwMFQX3kTbhM3Ep60cFUUWZL1CWGLLszPjrrmpdI100NJ8oZlc6F1aVMqyR0kuzrWG9IbWm7GJEJcMoGIBxFxLyvrwglhPM7DDSQoJDxdulob66JE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777364829; c=relaxed/simple; bh=f89MZan3iUCMImpwFJMAPlV8Oa0551rEAwn3TXkL7pI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OKKx0f3hxR86mXvDLBohpJvnvCp+lDSPgVZvJ/iew8T1bf9n0xw0EHvllLq51TqZtQ6fevQWhjlHoGM9LvGEm6xlFYIfEgf4k0WV5SDhjSMo1r0mHjEeBfmKDKP4AXW7c7dtOZk76vIWAsmpomVAzu3AQG0ZE2Gmq4ZVjGUeSEU= 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=k/cY8RaL; arc=none smtp.client-ip=192.198.163.15 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="k/cY8RaL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1777364828; x=1808900828; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=f89MZan3iUCMImpwFJMAPlV8Oa0551rEAwn3TXkL7pI=; b=k/cY8RaL5YUjLIlwI7Q5BZLQEgJZNfqkvcKlAbu3xbWnQvjg86S8m4zG 4baOTiQWkVCNfYkEy0A9U+Ks+KmiBVhH1i8pST5TdcKk4WWK8IBnhfC79 EGH7CyjX++l3pb2xKHuNtGDvyJ2gvXDQynLAQ0hgnw4xjZAKlEu/fxwFE wYfekYF1bc4Crti3fPFFhgSeFBDIDXfDNNyeLseHV5U0NizHCotcECucJ oySSiaFb/oJYzj02lsBUvQxapQpKyG7hEnOj2KMoD3LzQ7JDIOhCutkqf ohGfv3/b9Vaf4XEA4Gik9xyqeU7xFGtDrglXxwdmGu8QSOCXbbDukBFhX w==; X-CSE-ConnectionGUID: 5k10XNXRT8CgdmMdReo7Zg== X-CSE-MsgGUID: qyZv+Ks/QEqhyrhszbNyQQ== X-IronPort-AV: E=McAfee;i="6800,10657,11769"; a="78376862" X-IronPort-AV: E=Sophos;i="6.23,203,1770624000"; d="scan'208";a="78376862" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2026 01:27:08 -0700 X-CSE-ConnectionGUID: GEXapSElRTS2FJuvNYkANg== X-CSE-MsgGUID: Flc4Mq5DSoOBcD0MJMfM2A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,203,1770624000"; d="scan'208";a="232881477" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by orviesa006.jf.intel.com with ESMTP; 28 Apr 2026 01:27:03 -0700 Received: from mglak.igk.intel.com (mglak.igk.intel.com [10.237.112.146]) by irvmail002.ir.intel.com (Postfix) with ESMTP id 869F427BA7; Tue, 28 Apr 2026 09:27:00 +0100 (IST) From: Larysa Zaremba To: intel-wired-lan@lists.osuosl.org, Tony Nguyen Cc: aleksander.lobakin@intel.com, sridhar.samudrala@intel.com, Michal Swiatkowski , Larysa Zaremba , "Fijalkowski, Maciej" , Emil Tantilov , Madhu Chittim , Josh Hay , "Keller, Jacob E" , jayaprakash.shanmugam@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, Bharath R , Samuel Salin Subject: [PATCH iwl-next v7 03/14] libeth: allow to create fill queues without NAPI Date: Tue, 28 Apr 2026 10:26:37 +0200 Message-ID: <20260428082654.44364-4-larysa.zaremba@intel.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20260428082654.44364-1-larysa.zaremba@intel.com> References: <20260428082654.44364-1-larysa.zaremba@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Tested-by: Bharath R Tested-by: Samuel Salin Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/libeth/rx.c | 12 ++++++++---- include/net/libeth/rx.h | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/intel/libeth/rx.c b/drivers/net/ethernet/intel/libeth/rx.c index 62521a1f4ec9..0c1a565a1b3a 100644 --- a/drivers/net/ethernet/intel/libeth/rx.c +++ b/drivers/net/ethernet/intel/libeth/rx.c @@ -145,25 +145,29 @@ static bool libeth_rx_page_pool_params_zc(struct libeth_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 = fq->no_napi ? NULL : napi_dev; struct page_pool_params pp = { .flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV, .order = LIBETH_RX_PAGE_ORDER, .pool_size = fq->count, .nid = fq->nid, - .dev = napi->dev->dev.parent, - .netdev = napi->dev, + .dev = napi ? napi->dev->dev.parent : napi_dev, + .netdev = napi ? napi->dev : NULL, .napi = napi, }; struct libeth_fqe *fqes; struct page_pool *pool; int ret; + if (!pp.netdev && fq->type == LIBETH_FQE_MTU) + return -EINVAL; + pp.dma_dir = fq->xdp ? DMA_BIDIRECTIONAL : DMA_FROM_DEVICE; if (!fq->hsplit) 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; u32 buf_len; int nid; }; -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); /** -- 2.47.0