Skip to content

ixgbe: XDP via libie_xg (code sharing with ixgbevf) - #8

Open
walking-machine wants to merge 25 commits into
ixgbevf-xdp-publicfrom
libie-xgb-xdp-xsk
Open

ixgbe: XDP via libie_xg (code sharing with ixgbevf)#8
walking-machine wants to merge 25 commits into
ixgbevf-xdp-publicfrom
libie-xgb-xdp-xsk

Conversation

@walking-machine

Copy link
Copy Markdown
Owner

No description provided.

Magda-Pytel and others added 25 commits August 3, 2026 23:21
Similarly, like for virtual function in ixgbevf, remove
ixgbe_construct_skb(), the legacy-rx private flag, and all
ring_uses_build_skb() conditionals. build_skb is now the
only RX code path.

This is a preparation for the conversion to libeth and page_pool
based Rx buffer management.

Signed-off-by: Magdalena Pytel <magdalena.pytel@intel.com>
Stop sharing pages between multiple Rx buffers. Convert ixgbe Rx path
from page-sharing/recycling to a simple one-page-per-packet model.
Remove logic that refers to page-sharing buffer management. This is a
preparatory step before converting the Rx path to page_pool
and libeth.

Fixed XDP_DROP/ABORTED: reaches ixgbe_put_rx_buffer() but page
is never freed.

Signed-off-by: Magdalena Pytel <magdalena.pytel@intel.com>
Convert ixgbe Rx path from manual page-per-packet DMA management
to libeth/page_pool infrastructure, and integrates libeth XDP helpers.
Each packet gets its own buffer instead of sharing pages between packets.

Signed-off-by: Magdalena Pytel <magdalena.pytel@intel.com>
* Added branch prediction hints to the ixgbe Rx path and clean up
the packet accounting.
* Moved total_rx_bytes and total_rx_packets accounting together.

Signed-off-by: Magdalena Pytel <magdalena.pytel@intel.com>
Implement XDP multi-buffer support for Rx fragmented packets
using libeth_xdp.

* Added MODULE_IMPORT_NS("LIBETH_XDP")
and #include <net/libeth/types.h>
* Replaced struct sk_buff *skb in ixgbe_ring with
struct libeth_xdp_buff_stash
 and ixgbe_clean_rx_ring skb cleanup with libeth_xdp_return_stash
* Removed ixgbe_add_rx_frag()
* Reorganized ixgbe_clean_rx_irq() and ixgbe_is_non_eop()
* Updated ixgbe_xdp_setup() to allow multi-buffer XDP programs
* Added NETDEV_XDP_ACT_RX_SG in xdp_features

Signed-off-by: Magdalena Pytel <magdalena.pytel@intel.com>
In order to share some generation-specific non-trivial XDP code between
ixgbevf and ixgbe, identify required ring fields and separate them into a
base ring structure.

Use the structure in a somewhat struct_group fashion, exposing a named
.base structure (for shared code to use) as well as direct field access in
a union (to not disturb the ancient code). But given that 2 different
structures will need to include the base, instead of struct_group, utilize
a relatively recently enabled -fms-extensions anonymous member structures
feature.

Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Some functions used in ixgbevf XDP_TX and AF_XDP ZC implementation are at
the same time non-trivial and trivially shareable with ixgbe. Move those
functions to a new libie_xg header and rename them accordingly.

Inline sharing was chosen, since a big chunk of those function are used in
datapath, and a hypothetical small module would introduce more memory
overhead than plain code duplication.

Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
…oduce and use libie_xg_ring"

This reverts commit a66f091.
Replace overlapping fields in ixgbe_ring with libie_xg_ring, included both
as anonymous and named structure. For now, add xdp_frame to the generic Tx
buffer, but it will be rendered unnecessary by further commits.

Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Wakeup is not necessarily tied to Tx processing, so Tx not being active is
not a reason to skip on Rx buffer refill. Also, some checks are redundant.

Rely on Rx rings to access the interrupt, and clear up the redundant code.

Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Introduce pseudo header split support in the ixgbe driver.

* Added IXGBE_RX_SRRCTL_BUF_SIZE macro and IXGBE_FLAG2_HSPLIT flag
* Added hdr_truesize, hdr_fqes, hdr_pp, hdr_buf_len to ixgbe_ring
* Added ixgbe_rx_hsplit_wa() to copy header from data to header buffer
* Added ixgbe_rx_create_pp()/ixgbe_rx_destroy_pp() helpers
* Updated ixgbe_alloc_rx_buffers to allocate header buffers
* Updated ixgbe_clean_rx_irq to process header split
* Refactored ixgbe_setup_rx_resources to use ixgbe_rx_create_pp
* Refactored ixgbe_free_rx_resources to use ixgbe_rx_destroy_pp
* Set IXGBE_FLAG2_HSPLIT for 82599 in ixgbe_sw_init
* Updated ixgbe_xdp_setup to require mbuf frags with hsplit

Signed-off-by: Magdalena Pytel <magdalena.pytel@intel.com>
* Moved page pool creation from ixgbe_setup_rx_resources() to
  ixgbe_configure_rx_ring()
* Moved page pool destruction to ixgbe_clean_all_rx_rings() and
  ixgbe_free_rx_resources()
* Added ixgbe_dma_dev_from_ring() helper to obtain DMA device without
  relying on page pool pointer.
* Handled XSK path in ixgbe_configure_rx_ring()

Signed-off-by: Magdalena Pytel <magdalena.pytel@intel.com>
Utilize libeth and libie_xg libraries to support segments in AF_XDP ZC
mode. Since Tx path supports frags, it does not need updating for now.

Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants