From: Paolo Valerio <pvalerio@redhat.com>
To: netdev@vger.kernel.org
Cc: "Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
"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>,
"Lorenzo Bianconi" <lorenzo@kernel.org>,
"Théo Lebrun" <theo.lebrun@bootlin.com>
Subject: [PATCH RFC net-next v2 0/8] net: macb: Add XDP support and page pool integration
Date: Sun, 21 Dec 2025 00:51:27 +0100 [thread overview]
Message-ID: <20251220235135.1078587-1-pvalerio@redhat.com> (raw)
This was initially planned to be sent as non-RFC, but given net-next
will remain closed for some more, might make sense to start sending it as
RFC v2.
Tested on Raspberry Pi 5.
All the changes are intended for gem only.
The series consists of two main changes:
- Migration from netdev_alloc_skb() to page pool allocation model,
enabling skb recycling.
This also adds support for multi-descriptor frame reception,
removing the previous single-descriptor approach and avoiding
potentially large contiguous allocations for e.g. jumbo frames
with CONFIG_PAGE_SIZE_4KB.
- XDP support: Base XDP implementation supporting all major
verdicts (XDP_PASS, XDP_DROP, XDP_REDIRECT, XDP_TX) along with
the ndo_xdp_xmit function for packet redirection.
The driver now advertises NETDEV_XDP_ACT_BASIC, NETDEV_XDP_ACT_REDIRECT,
NETDEV_XDP_ACT_NDO_XMIT capabilities.
v1: https://lore.kernel.org/netdev/20251119135330.551835-1-pvalerio@redhat.com/
Changes since RFC v1
====================
- Squashed 1/6 and 2/6
- Reworked rx_buffer_size computation. It no longer takes into
accounts extra room.
- A bunch of renaming (rx_offset => rx_headroom, removed MACB_MAX_PAD,
MACB_PP_HEADROOM => XDP_PACKET_HEADROOM, data => ptr, xdp_q => xdp_rxq,
macb_xdp() => gem_xdp(), macb_xdp_xmit() => gem_xdp_xmit())
- Deduplicated buffer size computation in gem_xdp_valid_mtu()
and gem_xdp_setup()
- gem_xdp_setup() no longer close()/open()
- Renaming from rx_skbuff to rx_buff is now got split in a separate commit
- Open-coded gem_page_pool_get_buff()
- Added missing rx_buff re-initialization in the error path during rx
- Page pool creation failure now fails the device open
- Moved xdp buff preparation inside gem_xdp_run()
- Added missing rcu_access_pointer()
- Turned return value in -EOPNOTSUPP for macb_xdp() on failure
- moved tx_skb to tx_buff renaming to a separate commit
- Removed some unneeded code and set MACB_TYPE_SKB for lp->rm9200_txq[desc].type as well
- Replaced !!addr with a dedicated bool in macb_xdp_submit_frame()
Additional notes
================
- Clamping is there and needed as rx_buffer_size + overhead cannot be greater
than a PAGE_SIZE. This is fine as frames larger than PAGE_SIZE
are still handled in a scattered way as intended.
- Code in macb_xdp_submit_frame() and macb_start_xmit()/macb_tx_map() was not
factored as the skb path, other than being scattered across skb specific code,
also contains frags handling.
Probably a unification attempt might better be done when multi buff support for
xdp gets added.
Paolo Valerio (7):
net: macb: rename rx_skbuff into rx_buff
cadence: macb: Add page pool support handle multi-descriptor frame rx
cadence: macb: use the current queue number for stats
cadence: macb: add XDP support for gem
cadence: macb: make macb_tx_skb generic
cadence: macb: make tx path skb agnostic
cadence: macb: introduce xmit support
Théo Lebrun (1):
net: macb: move Rx buffers alloc from link up to open
drivers/net/ethernet/cadence/Kconfig | 1 +
drivers/net/ethernet/cadence/macb.h | 41 +-
drivers/net/ethernet/cadence/macb_main.c | 811 +++++++++++++++++------
3 files changed, 654 insertions(+), 199 deletions(-)
--
2.52.0
next reply other threads:[~2025-12-20 23:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-20 23:51 Paolo Valerio [this message]
2025-12-20 23:51 ` [PATCH RFC net-next v2 1/8] net: macb: move Rx buffers alloc from link up to open Paolo Valerio
2026-01-08 15:24 ` Théo Lebrun
2026-01-12 14:14 ` Paolo Valerio
2025-12-20 23:51 ` [PATCH RFC net-next v2 2/8] net: macb: rename rx_skbuff into rx_buff Paolo Valerio
2025-12-20 23:51 ` [PATCH RFC net-next v2 3/8] cadence: macb: Add page pool support handle multi-descriptor frame rx Paolo Valerio
2026-01-08 15:43 ` Théo Lebrun
2026-01-12 14:16 ` Paolo Valerio
2026-01-12 18:43 ` Paolo Valerio
2026-01-13 10:35 ` Théo Lebrun
2026-01-13 19:30 ` Paolo Valerio
2026-01-13 10:43 ` Théo Lebrun
2025-12-20 23:51 ` [PATCH RFC net-next v2 4/8] cadence: macb: use the current queue number for stats Paolo Valerio
2025-12-20 23:51 ` [PATCH RFC net-next v2 5/8] cadence: macb: add XDP support for gem Paolo Valerio
2026-01-08 15:49 ` Théo Lebrun
2026-01-12 14:17 ` Paolo Valerio
2025-12-20 23:51 ` [PATCH RFC net-next v2 6/8] cadence: macb: make macb_tx_skb generic Paolo Valerio
2025-12-20 23:51 ` [PATCH RFC net-next v2 7/8] cadence: macb: make tx path skb agnostic Paolo Valerio
2025-12-20 23:51 ` [PATCH RFC net-next v2 8/8] cadence: macb: introduce xmit support Paolo Valerio
2026-01-08 15:54 ` Théo Lebrun
2026-01-12 14:17 ` Paolo Valerio
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=20251220235135.1078587-1-pvalerio@redhat.com \
--to=pvalerio@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=claudiu.beznea@tuxon.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=lorenzo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=pabeni@redhat.com \
--cc=theo.lebrun@bootlin.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