From: Tony Nguyen <anthony.l.nguyen@intel.com>
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 <madhu.chittim@intel.com>,
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 <bharath.r@intel.com>,
Samuel Salin <Samuel.salin@intel.com>,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Subject: [PATCH net-next v2 03/14] libeth: allow to create fill queues without NAPI
Date: Fri, 3 Apr 2026 12:49:25 -0700 [thread overview]
Message-ID: <20260403194938.3577011-4-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20260403194938.3577011-1-anthony.l.nguyen@intel.com>
From: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
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 <aleksander.lobakin@intel.com>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Tested-by: Bharath R <bharath.r@intel.com>
Tested-by: Samuel Salin <Samuel.salin@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
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
next prev parent reply other threads:[~2026-04-03 19:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-03 19:49 [PATCH net-next v2 00/14][pull request] Introduce iXD driver Tony Nguyen
2026-04-03 19:49 ` [PATCH net-next v2 01/14] virtchnl: create 'include/linux/intel' and move necessary header files Tony Nguyen
2026-04-03 19:49 ` [PATCH net-next v2 02/14] libie: add PCI device initialization helpers to libie Tony Nguyen
2026-04-09 8:56 ` Paolo Abeni
2026-04-03 19:49 ` Tony Nguyen [this message]
2026-04-03 19:49 ` [PATCH net-next v2 04/14] libie: add control queue support Tony Nguyen
2026-04-03 19:49 ` [PATCH net-next v2 05/14] libie: add bookkeeping support for control queue messages Tony Nguyen
2026-04-09 9:07 ` Paolo Abeni
2026-04-09 18:11 ` Tony Nguyen
2026-04-03 19:49 ` [PATCH net-next v2 06/14] idpf: remove 'vport_params_reqd' field Tony Nguyen
2026-04-03 19:49 ` [PATCH net-next v2 07/14] idpf: refactor idpf to use libie_pci APIs Tony Nguyen
2026-04-03 19:49 ` [PATCH net-next v2 08/14] idpf: refactor idpf to use libie control queues Tony Nguyen
2026-04-03 19:49 ` [PATCH net-next v2 09/14] idpf: make mbx_task queueing and cancelling more consistent Tony Nguyen
2026-04-03 19:49 ` [PATCH net-next v2 10/14] idpf: print a debug message and bail in case of non-event ctlq message Tony Nguyen
2026-04-03 19:49 ` [PATCH net-next v2 11/14] ixd: add basic driver framework for Intel(R) Control Plane Function Tony Nguyen
2026-04-03 19:49 ` [PATCH net-next v2 12/14] ixd: add reset checks and initialize the mailbox Tony Nguyen
2026-04-03 19:49 ` [PATCH net-next v2 13/14] ixd: add the core initialization Tony Nguyen
2026-04-03 19:49 ` [PATCH net-next v2 14/14] ixd: add devlink support Tony Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260403194938.3577011-4-anthony.l.nguyen@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=Samuel.salin@intel.com \
--cc=aleksander.lobakin@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anjali.singhai@intel.com \
--cc=bharath.r@intel.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=emil.s.tantilov@intel.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=jayaprakash.shanmugam@intel.com \
--cc=jiri@resnulli.us \
--cc=joshua.a.hay@intel.com \
--cc=kuba@kernel.org \
--cc=larysa.zaremba@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=madhu.chittim@intel.com \
--cc=michal.swiatkowski@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=richardcochran@gmail.com \
--cc=sridhar.samudrala@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox