On Thu,  6 Feb 2025 21:46:45 +0100
Ariel Otilibili <ariel.otilib...@6wind.com> wrote:

>  
> +static inline struct xdp_desc *
> +reserve_and_fill(struct pkt_tx_queue *txq, struct rte_mbuf *mbuf,
> +              struct xsk_umem_info *umem, void **pkt_ptr)
> +{
> +     struct xdp_desc *desc = NULL;
> +     uint64_t addr, offset;
> +     uint32_t idx_tx;
> +
> +     if (!xsk_ring_prod__reserve(&txq->tx, 1, &idx_tx))
> +             goto out;
> +
> +     desc = xsk_ring_prod__tx_desc(&txq->tx, idx_tx);
> +     desc->len = mbuf->pkt_len;
> +
> +     addr = (uint64_t)mbuf - (uint64_t)umem->buffer
> +             - umem->mb_pool->header_size;

addr (and the cast of mbuf) should probably be uintptr_t since the
intent is to do calculations with pointers.

Reply via email to