experimental backport of net-next macb xdp support#7271
Draft
nbuchwitz wants to merge 9 commits intoraspberrypi:rpi-6.18.yfrom
Draft
experimental backport of net-next macb xdp support#7271nbuchwitz wants to merge 9 commits intoraspberrypi:rpi-6.18.yfrom
nbuchwitz wants to merge 9 commits intoraspberrypi:rpi-6.18.yfrom
Conversation
mog_alloc_rx_buffers(), getting called at open, does not do rx buffer alloc on GEM. The bulk of the work is done by gem_rx_refill() filling up all slots with valid buffers. gem_rx_refill() is called at link up by gem_init_rings() == bp->macbgem_ops.mog_init_rings(). Move operation to macb_open(), mostly to allow it to fail early and loudly rather than init the device with Rx mostly broken. About `bool fail_early`: - When called from macb_open(), ring init fails as soon as a queue cannot be refilled. - When called from macb_hresp_error_task(), we do our best to reinit the device: we still iterate over all queues and try refilling all even if a previous queue failed. Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Signed-off-by: Paolo Valerio <pvalerio@redhat.com>
This is a preparation commit as the field in later patches will no longer accomomdate skbuffs, but more generic frames. Signed-off-by: Paolo Valerio <pvalerio@redhat.com>
Use the page pool allocator for the data buffers and enable skb recycling support, instead of relying on netdev_alloc_skb allocating the entire skb during the refill. The patch also add support for receiving network frames that span multiple DMA descriptors in the Cadence MACB/GEM Ethernet driver. The patch removes the requirement that limited frame reception to a single descriptor (RX_SOF && RX_EOF), also avoiding potential contiguous multi-page allocation for large frames. Signed-off-by: Paolo Valerio <pvalerio@redhat.com>
gem_get_ethtool_stats calculates the size of the statistics data to copy always considering maximum number of queues. The patch makes sure the statistics are copied only for the active queues as returned in the string set count op. Signed-off-by: Paolo Valerio <pvalerio@redhat.com>
The macb_tx_skb structure is renamed to macb_tx_buff with no functional changes. This is a preparatory step for adding xdp xmit support. Signed-off-by: Paolo Valerio <pvalerio@redhat.com>
Rename struct macb_tx_buff member skb to ptr and introduce macb_tx_buff_type to identify the buffer type macb_tx_buff represents. Currently the buffer can only be MACB_TYPE_SKB, so the sk_buff case is handled unconditionally in the tx path. The remaining type handling will be handled by subsequent patches. This is the last preparatory step for XDP xmit support. Signed-off-by: Paolo Valerio <pvalerio@redhat.com>
Introduce basic XDP support for macb/gem with the XDP_TX, XDP_PASS, XDP_DROP, XDP_REDIRECT verdict support. Signed-off-by: Paolo Valerio <pvalerio@redhat.com>
Introduce ndo_xdp_xmit function for redirection, update macb_xdp_submit_frame() accordingly, and advertise NETDEV_XDP_ACT_NDO_XMIT capability. Signed-off-by: Paolo Valerio <pvalerio@redhat.com>
macb_xdp_submit_frame() writes TSTART without first waking the MAC from LPI. When EEE is active, TXLPIEN blocks all TX and the GEM MAC has no auto-wake mechanism, so XDP frames will stall in the FIFO indefinitely. Add macb_tx_lpi_wake() before TSTART, matching the regular TX path in macb_start_xmit(). It's a no-op when EEE is not active. Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
Contributor
|
Does this need |
Contributor
Author
AF_XDP (CONFIG_XDP_SOCKETS) is only needed if you want to do something like a userspace packet processor that receives raw frames directly from the NIC via XDP_REDIRECT to an xsk socket. For basic testing with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Experimental backport of https://lore.kernel.org/netdev/20260309144353.1213770-1-pvalerio@redhat.com/ to 6.18
Just meant for having a proper build, so interested parties can test this
CC @ghollingworth