From: Bruce Richardson <bruce.richardson@intel.com>
To: David Marchand <david.marchand@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] ixgbe: fix icc issue with mbuf initializer
Date: Mon, 3 Nov 2014 12:47:32 +0000 [thread overview]
Message-ID: <20141103124732.GB4840@bricha3-MOBL3> (raw)
In-Reply-To: <CALwxeUvZvztFv915kZkAFZP1F4535m6SLmXTyfN+M-wTKGJ4PQ@mail.gmail.com>
On Mon, Nov 03, 2014 at 01:31:10PM +0100, David Marchand wrote:
> Hello Bruce,
>
> On Mon, Nov 3, 2014 at 12:11 PM, Bruce Richardson <
> bruce.richardson@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).
It's a good point, I'll update patch to use the appropriate macro which will clean up the code a bit.
/Bruce
>
> 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
next prev parent reply other threads:[~2014-11-03 12:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-03 11:11 Bruce Richardson
2014-11-03 12:31 ` David Marchand
2014-11-03 12:47 ` Bruce Richardson [this message]
2014-11-03 12:59 ` Thomas Monjalon
2014-11-03 13:16 ` Bruce Richardson
2014-11-03 17:01 ` [dpdk-dev] [PATCH v2] " Bruce Richardson
2014-11-05 21:45 ` Thomas Monjalon
2014-11-28 8:52 ` Cao, Min
2014-11-28 8:52 ` [dpdk-dev] [PATCH] " Cao, Min
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141103124732.GB4840@bricha3-MOBL3 \
--to=bruce.richardson@intel.com \
--cc=david.marchand@6wind.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).