[PATCH 2/5] net/bnxt: use buf address for external mbuf

Stephen Hemminger stephen at networkplumber.org
Wed Jun 3 23:43:07 CEST 2026


On Wed,  3 Jun 2026 15:13:38 -0600
Mohammad Shuab Siddique <mohammad-shuab.siddique at broadcom.com> wrote:

> +static inline uint64_t
> +bnxt_mbuf_buf_addr(const struct rte_mbuf *mb)
> +{
> +	return (uint64_t)mb->buf_addr + mb->data_off;
> +}

Why are you reinventing this?

/**
 * A macro that points to an offset into the data in the mbuf.
 *
 * The returned pointer is cast to type t. Before using this
 * function, the user must ensure that the first segment is large
 * enough to accommodate its data.
 *
 * @param m
 *   The packet mbuf.
 * @param o
 *   The offset into the mbuf data.
 * @param t
 *   The type to cast the result into.
 */
#define rte_pktmbuf_mtod_offset(m, t, o)	\
	((t)(void *)((char *)(m)->buf_addr + (m)->data_off + (o)))


More information about the dev mailing list