On 5/29/26 4:33 PM, Thomas Monjalon wrote:
From: Gregory Etelson <[email protected]>

Receiving an entire packet is not always needed.
The Rx performance can be improved by receiving only partial data
and safely discard the rest of the packet data,
because it reduces the PCI bandwidth and the memory consumption.

Selective Rx allows an application to receive
only pre-configured packet segments and discard the rest.
For example:
- Deliver the first N bytes only.
- Deliver the last N bytes only.
- Deliver N1 bytes from offset Off1 and N2 bytes from offset Off2.

Selective Rx is implemented on top of the Rx buffer split API:
- rte_eth_rxseg_split uses the null mempool for segments
that should be discarded.
- the PMD does not create mbuf segments if no data read.

For example: Deliver Ethernet header only

Rx queue segments configuration:
struct rte_eth_rxseg_split split[2] = {
     {
         .mp = <some mempool>,
         .length = sizeof(struct rte_ether_hdr)
     },
     {
         .mp = NULL, /* discard data */
         .length = 0 /* default to buffer size */
     }
};

Received mbuf:
     pkt_len = sizeof(struct rte_ether_hdr);
     data_len = sizeof(struct rte_ether_hdr);
     next = NULL; /* The next segment did not deliver data */

After selective Rx, the mbuf packet length reflects only the data
that was actually received,
and can be less than the original wire packet length.

A PMD activates the selective Rx capability by setting
the rte_eth_rxseg_capa.selective_rx bit.

This new capability bit is inserted in a bitmap hole
of the struct rte_eth_rxseg_capa,
but it needs to be ignored in the ABI check as libabigail sees a change.

Signed-off-by: Gregory Etelson <[email protected]>
Signed-off-by: Thomas Monjalon <[email protected]>

LGTM, thanks

Reviewed-by: Andrew Rybchenko <[email protected]>

Reply via email to