[dpdk-dev] [PATCH] ixgbe: fix icc issue with mbuf initializer
David Marchand
david.marchand at 6wind.com
Mon Nov 3 13:31:10 CET 2014
Hello Bruce,
On Mon, Nov 3, 2014 at 12:11 PM, Bruce Richardson <
bruce.richardson at intel.com> wrote:
> diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
> b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
> index e813e43..b57c588 100644
> --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
> +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
> @@ -730,16 +730,15 @@ static struct ixgbe_txq_ops vec_txq_ops = {
> int
> ixgbe_rxq_vec_setup(struct igb_rx_queue *rxq)
> {
> - struct rte_mbuf mb_def = {
> - .nb_segs = 1,
> - .data_off = RTE_PKTMBUF_HEADROOM,
> -#ifdef RTE_MBUF_REFCNT
> - { .refcnt = 1, }
> -#endif
> - };
> + struct rte_mbuf mb_def = { .buf_addr = 0 }; /* zeroed mbuf */
>
> + mb_def.nb_segs = 1;
> + mb_def.data_off = RTE_PKTMBUF_HEADROOM;
> mb_def.buf_len = rxq->mb_pool->elt_size - sizeof(struct rte_mbuf);
> mb_def.port = rxq->port_id;
> +#ifdef RTE_MBUF_REFCNT
> + mb_def.refcnt = 1;
> +#endif
> rxq->mbuf_initializer = *((uint64_t *)&mb_def.rearm_data);
> return 0;
> }
>
I would expect we use rte_mbuf_refcnt_set / rte_mbuf_refcnt_read to access
this "refcnt" field.
This api handles both RTE_MBUF_REFCNT_ATOMIC and ! RTE_MBUF_REFCNT_ATOMIC
configs.
But I suppose this is fine at init time (since the union will initialize
properly the field).
By the way, why do we have this RTE_MBUF_REFCNT_ATOMIC option ?
>From my point of view, there is not much use of a refcnt that is not atomic
:-).
--
David Marchand
More information about the dev
mailing list