Re: [PATCH v6] net/af_packet: add Rx scatter for jumbo frames

Stephen Hemminger
2026-03-25T18:42:46Z

On Tue, 24 Mar 2026 17:29:52 +0100
Sriram Yagnaraman <sriram.yagnaraman@ericsson.com> wrote:

> +/*
> + * Copy packet data into chained mbufs when it exceeds single mbuf tailroom.
> + * Returns 0 on success, -1 on mbuf allocation failure.
> + */
> +static int
> +eth_af_packet_rx_scatter(struct rte_mempool *mb_pool, struct rte_mbuf *mbuf,
> + const uint8_t *data, uint32_t data_len)
> +{
> + uint16_t len = rte_pktmbuf_tailroom(mbuf);
> + struct rte_mbuf *m = mbuf;
> +
> + memcpy(rte_pktmbuf_mtod(mbuf, void *), data, len);
> + rte_pktmbuf_data_len(mbuf) = len;

Very minor personal preference here. I prefer avoiding using
rte_pktmbuf_data_len() and rte_pktmbuf_pkt_len() since they are
really macros and the use of data_len and pkt_len directly is clearer
in code that is manipulating other mbuf fields.

Applied to next-net