From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 4719F3B0ACB; Fri, 10 Jul 2026 21:53:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783720405; cv=none; b=C0cljFw71GyXReQ+uEn2cvBHqxBni3sO1PLZYMh6v+IwXNRMMT3r/jST3t1G0VHLuSn8aWOWemTwUVjWVOcdGP3bbDlIJXqWEcZFC7xC/TBjX+WoWnNhB3r2XpGWqLDEJZEGVjy661fVz+wKHvPic6XGN6AazFkgvsxmL6DoycE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783720405; c=relaxed/simple; bh=zeFNlg+Jqu/extEAPQx7wr3dHGwsr/NGMEnESda69fY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HHPqq6Sn2dAfZ9ZG08cVRe9p7v9k/XW638cazW4igECGMS4WGPDiiJ11FN+uA8MrmeVqkwr/58GLueY18g6wIajU29AWUi2Li/nnTMViczRuCavtlMNHatLJzgyQ7Egmdd2mnQjgoBF+AiSNyv8XL2vIt+PFdtWzOHQSiMkt55E= 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=YbGJPY2p; arc=none smtp.client-ip=198.175.65.9 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="YbGJPY2p" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1783720404; x=1815256404; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zeFNlg+Jqu/extEAPQx7wr3dHGwsr/NGMEnESda69fY=; b=YbGJPY2pV833xEEVoOZWMCv6g8WLDtLZShusZiJItSbIcr9ciVfn35Tw g7CihQEbIqkQnYWgo4xdrUjNvyXGqfWCYg1mZzZj4WXSifNWNOMOaBbCx PdokQAzF8bQHQlmyyVZKcFzmrERZg7DpFnMdVHxJpYRncc0ZYivYZH5Sp amXvzK749Re0EnWtKMhqPNwLlVcfU17VjjI7QJ6H3p9ipqv7NtAyYC75b BjviK8IjoblDnf3IxxdvW1JdOFzkHxEdazunFU2V6MuP//LcSNx0dLMtk UdG7cz2AGunkO/sWYqC9tL5ilPS3llhDO+Hfa2lr6C04ttJsCiw023g29 w==; X-CSE-ConnectionGUID: IrkDAuz/QQyBoadbzgK6hw== X-CSE-MsgGUID: gRY0EIheRtyzUhpV02eGBw== X-IronPort-AV: E=McAfee;i="6800,10657,11841"; a="107220722" X-IronPort-AV: E=Sophos;i="6.25,154,1779174000"; d="scan'208";a="107220722" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2026 14:53:21 -0700 X-CSE-ConnectionGUID: C8ApE2joQTCI/fgb7hHqwQ== X-CSE-MsgGUID: oZ+GMw4VTDipv1Xk4EdOFw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,154,1779174000"; d="scan'208";a="254494619" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by orviesa008.jf.intel.com with ESMTP; 10 Jul 2026 14:53:21 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, andrew+netdev@lunn.ch, netdev@vger.kernel.org Cc: Pavan Kumar Linga , anthony.l.nguyen@intel.com, larysa.zaremba@intel.com, przemyslaw.kitszel@intel.com, aleksander.lobakin@intel.com, sridhar.samudrala@intel.com, anjali.singhai@intel.com, michal.swiatkowski@linux.intel.com, maciej.fijalkowski@intel.com, emil.s.tantilov@intel.com, joshua.a.hay@intel.com, jacob.e.keller@intel.com, jayaprakash.shanmugam@intel.com, jiri@resnulli.us, horms@kernel.org, corbet@lwn.net, richardcochran@gmail.com, linux-doc@vger.kernel.org, Bharath R , Samuel Salin Subject: [PATCH net-next v4 03/15] libeth: allow to create fill queues without NAPI Date: Fri, 10 Jul 2026 14:53:00 -0700 Message-ID: <20260710215313.1475803-4-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20260710215313.1475803-1-anthony.l.nguyen@intel.com> References: <20260710215313.1475803-1-anthony.l.nguyen@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 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.1