From mboxrd@z Thu Jan 1 00:00:00 1970 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 6C4543CE083; Mon, 8 Jun 2026 14:41:41 +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=1780929703; cv=none; b=YiLqeTgBCQ7yTvdDMhetdAKU3ZlcVzxQopV5ZMWau7/Jkwl22uybTjXeQfzAXwaHFK5QoXiPwRbxXVtZCR+/5dhdTzxI3Jv1KiwWhU9lSIZRC95UzIYO73HLle7gECnnuAk3uu3fHkpDN4c3bEC+7M4nQC9bdYHfeWJBVEgwXYE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780929703; c=relaxed/simple; bh=yPucZpqaQL3icgj+DeJTB7Y5X3ORJjmGfD/hiYtO+2c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SWdiXVFvlAsy2qKnxTAir85mKLKY9dOIYxtweKqO6H0YpIwMGAsF5oQnKvlqkS4KB8Vuhds7NLh2peihYQ3+ERGh27vXIleZ66w9jKVWfTTRPb/y6RougMEZW/C7SiV4fmvaB7lCOGCQaitMIsC/vfeeSERW8PjN2KDjzTE85U0= 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=kVny1tTq; 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="kVny1tTq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1780929702; x=1812465702; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yPucZpqaQL3icgj+DeJTB7Y5X3ORJjmGfD/hiYtO+2c=; b=kVny1tTqLckiwVUPq53MH6NCidqgMywXwwxvSiUieN6AIe4Cc+dZATUq KQZ5fRe0OP5ZAMe3pgOxJL1LLJdSsURBuPZ880igObUM3aVubWB1nGsLv XOwX/HDE5GrFxl7nl5vqiYVIGoWo+zdFFxAOX6YtKeEbMDqV5FGgF8gzh KqYIF9cpmopGTe0Hh9gwJW3rxsNB79HZpRGR2AI2VaKrtydkhRjjywcEn r8fxuCuNmTFzHLx6g6VumGkfspSnZHUNcvo5w4ypz8oh/ovCfju7FAPOV c+EurPLQi1jt2H7kGvkWRo+q5oC2iHoDFVZih1WoQZazTQNdus0OGxThm g==; X-CSE-ConnectionGUID: 86HVXsrPTuqowqlW9wy9tQ== X-CSE-MsgGUID: GjgZQTt9QsmvuwXzOHeMSg== X-IronPort-AV: E=McAfee;i="6800,10657,11811"; a="81641973" X-IronPort-AV: E=Sophos;i="6.24,194,1774335600"; d="scan'208";a="81641973" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2026 07:41:41 -0700 X-CSE-ConnectionGUID: T0X0PnqXQkqqVENytB8hPQ== X-CSE-MsgGUID: 7OELC2roSg+UvlPz6Mk2ZA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,194,1774335600"; d="scan'208";a="249489724" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by orviesa003.jf.intel.com with ESMTP; 08 Jun 2026 07:41:36 -0700 Received: from mglak.igk.intel.com (mglak.igk.intel.com [10.237.112.146]) by irvmail002.ir.intel.com (Postfix) with ESMTP id B4E4028795; Mon, 8 Jun 2026 15:41:33 +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 v8 03/15] libeth: allow to create fill queues without NAPI Date: Mon, 8 Jun 2026 16:41:08 +0200 Message-ID: <20260608144127.2751230-4-larysa.zaremba@intel.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20260608144127.2751230-1-larysa.zaremba@intel.com> References: <20260608144127.2751230-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 Tested-by: Bharath R Tested-by: Samuel Salin Signed-off-by: Larysa Zaremba --- 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