From: Justin Chen <justin.chen@broadcom.com>
To: Nicolai Buchwitz <nb@tipi-net.de>, netdev@vger.kernel.org
Cc: Doug Berger <opendmb@gmail.com>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.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>,
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>,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH net-next v3 2/6] net: bcmgenet: register xdp_rxq_info for each RX ring
Date: Thu, 19 Mar 2026 14:18:45 -0700 [thread overview]
Message-ID: <2ccfaa48-7aad-49e8-bdfa-82ca9b6ebcc6@broadcom.com> (raw)
In-Reply-To: <20260319115402.353509-3-nb@tipi-net.de>
On 3/19/26 4:53 AM, Nicolai Buchwitz wrote:
> Register an xdp_rxq_info per RX ring and associate it with the ring's
> page_pool via MEM_TYPE_PAGE_POOL. This is required infrastructure for
> XDP program execution: the XDP framework needs to know the memory model
> backing each RX queue for correct page lifecycle management.
>
> No functional change - XDP programs are not yet attached or executed.
>
> Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
> ---
> .../net/ethernet/broadcom/genet/bcmgenet.c | 22 +++++++++++++++++--
> .../net/ethernet/broadcom/genet/bcmgenet.h | 2 ++
> 2 files changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> index 7410034d9bdc..6e610e73e12f 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
> @@ -2771,16 +2771,32 @@ static int bcmgenet_rx_ring_create_pool(struct bcmgenet_priv *priv,
> .offset = GENET_XDP_HEADROOM,
> .max_len = RX_BUF_LENGTH,
> };
> + int err;
>
> ring->page_pool = page_pool_create(&pp_params);
> if (IS_ERR(ring->page_pool)) {
> - int err = PTR_ERR(ring->page_pool);
> -
> + err = PTR_ERR(ring->page_pool);
This should go in the patch before this.
> ring->page_pool = NULL;
> return err;
> }
>
> + err = xdp_rxq_info_reg(&ring->xdp_rxq, priv->dev, ring->index, 0);
> + if (err)
> + goto err_free_pp;
> +
> + err = xdp_rxq_info_reg_mem_model(&ring->xdp_rxq, MEM_TYPE_PAGE_POOL,
> + ring->page_pool);
> + if (err)
> + goto err_unreg_rxq;
> +
> return 0;
> +
> +err_unreg_rxq:
> + xdp_rxq_info_unreg(&ring->xdp_rxq);
> +err_free_pp:
> + page_pool_destroy(ring->page_pool);
> + ring->page_pool = NULL;
> + return err;
> }
>
> /* Initialize a RDMA ring */
> @@ -2807,6 +2823,7 @@ static int bcmgenet_init_rx_ring(struct bcmgenet_priv *priv,
>
> ret = bcmgenet_alloc_rx_buffers(priv, ring);
> if (ret) {
> + xdp_rxq_info_unreg(&ring->xdp_rxq);
> page_pool_destroy(ring->page_pool);
> ring->page_pool = NULL;
> return ret;
> @@ -3012,6 +3029,7 @@ static void bcmgenet_destroy_rx_page_pools(struct bcmgenet_priv *priv)
> for (i = 0; i <= priv->hw_params->rx_queues; ++i) {
> ring = &priv->rx_rings[i];
> if (ring->page_pool) {
> + xdp_rxq_info_unreg(&ring->xdp_rxq);
> page_pool_destroy(ring->page_pool);
> ring->page_pool = NULL;
> }
> diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
> index 11a0ec563a89..82a6d29f481d 100644
> --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h
> +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
> @@ -16,6 +16,7 @@
> #include <linux/dim.h>
> #include <linux/ethtool.h>
> #include <net/page_pool/helpers.h>
> +#include <net/xdp.h>
>
> #include "../unimac.h"
>
> @@ -579,6 +580,7 @@ struct bcmgenet_rx_ring {
> u32 rx_max_coalesced_frames;
> u32 rx_coalesce_usecs;
> struct page_pool *page_pool;
> + struct xdp_rxq_info xdp_rxq;
> struct bcmgenet_priv *priv;
> };
>
next prev parent reply other threads:[~2026-03-19 21:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-19 11:53 [PATCH net-next v3 0/6] net: bcmgenet: add XDP support Nicolai Buchwitz
2026-03-19 11:53 ` [PATCH net-next v3 1/6] net: bcmgenet: convert RX path to page_pool Nicolai Buchwitz
2026-03-20 17:02 ` Simon Horman
2026-03-19 11:53 ` [PATCH net-next v3 2/6] net: bcmgenet: register xdp_rxq_info for each RX ring Nicolai Buchwitz
2026-03-19 21:18 ` Justin Chen [this message]
2026-03-19 11:53 ` [PATCH net-next v3 3/6] net: bcmgenet: add basic XDP support (PASS/DROP) Nicolai Buchwitz
2026-03-19 21:23 ` Justin Chen
2026-03-19 11:53 ` [PATCH net-next v3 4/6] net: bcmgenet: add XDP_TX support Nicolai Buchwitz
2026-03-19 21:31 ` Justin Chen
2026-03-20 17:02 ` Simon Horman
2026-03-19 11:53 ` [PATCH net-next v3 5/6] net: bcmgenet: add XDP_REDIRECT and ndo_xdp_xmit support Nicolai Buchwitz
2026-03-19 21:34 ` Justin Chen
2026-03-19 11:53 ` [PATCH net-next v3 6/6] net: bcmgenet: add XDP statistics counters Nicolai Buchwitz
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=2ccfaa48-7aad-49e8-bdfa-82ca9b6ebcc6@broadcom.com \
--to=justin.chen@broadcom.com \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
--cc=opendmb@gmail.com \
--cc=pabeni@redhat.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