On Wed,  3 Jun 2026 15:13:38 -0600
Mohammad Shuab Siddique <[email protected]> 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)))

Reply via email to