From: Simon Horman <horms@kernel.org>
To: Larysa Zaremba <larysa.zaremba@intel.com>
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>,
intel-wired-lan@lists.osuosl.org,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Alexander Lobakin <aleksander.lobakin@intel.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Stanislav Fomichev <sdf@fomichev.me>,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
Natalia Wochtman <natalia.wochtman@intel.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH iwl-next 03/10] ixgbevf: use libeth in Rx processing
Date: Tue, 24 Feb 2026 17:45:50 +0000 [thread overview]
Message-ID: <aZ3jzpKs7VcVi-mL@horms.kernel.org> (raw)
In-Reply-To: <20260223095222.3205363-4-larysa.zaremba@intel.com>
On Mon, Feb 23, 2026 at 10:52:10AM +0100, Larysa Zaremba wrote:
> Use page_pool buffers by the means of libeth in the Rx queues, this
> significantly reduces code complexity of the driver itself.
>
> Suggested-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
...
> @@ -3257,12 +3133,26 @@ static int ixgbevf_setup_all_tx_resources(struct ixgbevf_adapter *adapter)
> int ixgbevf_setup_rx_resources(struct ixgbevf_adapter *adapter,
> struct ixgbevf_ring *rx_ring)
> {
> - int size;
> + struct libeth_fq fq = {
> + .count = rx_ring->count,
> + .nid = NUMA_NO_NODE,
> + .type = LIBETH_FQE_MTU,
> + .xdp = !!rx_ring->xdp_prog,
> + .idx = rx_ring->queue_index,
> + .buf_len = IXGBEVF_RX_PAGE_LEN(rx_ring->xdp_prog ?
> + LIBETH_XDP_HEADROOM :
> + LIBETH_SKB_HEADROOM),
> + };
> + int ret;
>
> - size = sizeof(struct ixgbevf_rx_buffer) * rx_ring->count;
> - rx_ring->rx_buffer_info = vmalloc(size);
> - if (!rx_ring->rx_buffer_info)
> - goto err;
> + ret = libeth_rx_fq_create(&fq, &rx_ring->q_vector->napi);
> + if (ret)
> + return ret;
> +
> + rx_ring->pp = fq.pp;
> + rx_ring->rx_fqes = fq.fqes;
> + rx_ring->truesize = fq.truesize;
> + rx_ring->rx_buf_len = fq.buf_len;
>
> u64_stats_init(&rx_ring->syncp);
>
> @@ -3270,25 +3160,29 @@ int ixgbevf_setup_rx_resources(struct ixgbevf_adapter *adapter,
> rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
> rx_ring->size = ALIGN(rx_ring->size, 4096);
>
> - rx_ring->desc = dma_alloc_coherent(rx_ring->dev, rx_ring->size,
> + rx_ring->desc = dma_alloc_coherent(fq.pp->p.dev, rx_ring->size,
> &rx_ring->dma, GFP_KERNEL);
>
> if (!rx_ring->desc)
Hi Larysa,
Prior to this patch, if this error condition was met,
then function would return -ENOMEM. But now it will return 0.
This does not seem intentional.
Flagged by Smatch.
> goto err;
>
> /* XDP RX-queue info */
> - if (xdp_rxq_info_reg(&rx_ring->xdp_rxq, adapter->netdev,
> - rx_ring->queue_index, 0) < 0)
> + ret = __xdp_rxq_info_reg(&rx_ring->xdp_rxq, adapter->netdev,
> + rx_ring->queue_index, 0, rx_ring->truesize);
> + if (ret)
> goto err;
>
> + xdp_rxq_info_attach_page_pool(&rx_ring->xdp_rxq, fq.pp);
> +
> rx_ring->xdp_prog = adapter->xdp_prog;
>
> return 0;
> err:
> - vfree(rx_ring->rx_buffer_info);
> - rx_ring->rx_buffer_info = NULL;
> + libeth_rx_fq_destroy(&fq);
> + rx_ring->rx_fqes = NULL;
> + rx_ring->pp = NULL;
> dev_err(rx_ring->dev, "Unable to allocate memory for the Rx descriptor ring\n");
> - return -ENOMEM;
> + return ret;
> }
>
> /**
...
next prev parent reply other threads:[~2026-02-24 17:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 9:52 [PATCH iwl-next 00/10] libeth and full XDP for ixgbevf Larysa Zaremba
2026-02-23 9:52 ` [PATCH iwl-next 01/10] ixgbevf: remove legacy Rx Larysa Zaremba
2026-02-23 9:52 ` [PATCH iwl-next 02/10] ixgbevf: do not share pages between packets Larysa Zaremba
2026-02-23 9:52 ` [PATCH iwl-next 03/10] ixgbevf: use libeth in Rx processing Larysa Zaremba
2026-02-24 17:45 ` Simon Horman [this message]
2026-02-25 17:19 ` Larysa Zaremba
2026-02-25 18:59 ` Simon Horman
2026-02-23 9:52 ` [PATCH iwl-next 04/10] ixgbevf: branch prediction and cleanup Larysa Zaremba
2026-02-23 9:52 ` [PATCH iwl-next 05/10] ixgbevf: support XDP multi-buffer on Rx path Larysa Zaremba
2026-02-23 9:52 ` [PATCH iwl-next 06/10] ixgbevf: XDP_TX in multi-buffer through libeth Larysa Zaremba
2026-02-24 17:54 ` Simon Horman
2026-02-25 17:21 ` Larysa Zaremba
2026-02-23 9:52 ` [PATCH iwl-next 07/10] ixgbevf: support XDP_REDIRECT and .ndo_xdp_xmit Larysa Zaremba
2026-02-23 9:52 ` [PATCH iwl-next 08/10] ixgbevf: add pseudo header split Larysa Zaremba
2026-02-23 9:52 ` [PATCH iwl-next 09/10] ixgbevf: reconfigure page pool when reallocating buffers Larysa Zaremba
2026-02-23 9:52 ` [PATCH iwl-next 10/10] ixgbevf: allow changing MTU when XDP program is attached Larysa Zaremba
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=aZ3jzpKs7VcVi-mL@horms.kernel.org \
--to=horms@kernel.org \
--cc=aleksander.lobakin@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=larysa.zaremba@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=natalia.wochtman@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=sdf@fomichev.me \
/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