All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Masaru Oki <m-oki-kJJssGRo5Gr08ZWpFnN8/c8NsWr+9BEh@public.gmane.org>
Cc: "<dev-VfR2kkLFssw@public.gmane.org>" <dev-VfR2kkLFssw@public.gmane.org>
Subject: Re: [PATCH 1/2] ixgbe: remove static qualifier for thread safety
Date: Fri, 24 Oct 2014 11:34:52 +0100	[thread overview]
Message-ID: <20141024103452.GA8052@BRICHA3-MOBL> (raw)
In-Reply-To: <CAFLKUzKY5488C-e5LwVd=+JqxgoLOv8ddURtPYVgntevrY6aEQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu, Oct 23, 2014 at 08:43:39AM +0900, Masaru Oki wrote:
> Hi,
> 
> in this code, pointer of local variable (mb_def) is returned by your changes.
> mb_def should be static for each thread.

Actually, no. A copy is made of 8 bytes of the mb_def variable and stored as 
an mbuf initializer inside the rxq structure. No use of the memory occupied 
by mb_def is made outside of the function, so the value does not need to be 
static.

/Bruce
> 
> 2014-10-22 19:55 GMT+09:00 Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>:
> > Remove the "static" prefix to the template mbuf variable in
> > ixgbe_rxq_vec_setup function. This will then allow different
> > threads to initialize different RX queues at the same time,
> > without one overwriting the other's data.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > ---
> >  lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
> > index a0d3d78..e813e43 100644
> > --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
> > +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
> > @@ -730,7 +730,7 @@ static struct ixgbe_txq_ops vec_txq_ops = {
> >  int
> >  ixgbe_rxq_vec_setup(struct igb_rx_queue *rxq)
> >  {
> > -       static struct rte_mbuf mb_def = {
> > +       struct rte_mbuf mb_def = {
> >                 .nb_segs = 1,
> >                 .data_off = RTE_PKTMBUF_HEADROOM,
> >  #ifdef RTE_MBUF_REFCNT
> > --
> > 1.9.3
> >

  parent reply	other threads:[~2014-10-24 10:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22 10:55 [PATCH 0/2] ixgbe: vector pmd fixes Bruce Richardson
     [not found] ` <1413975345-24326-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-10-22 10:55   ` [PATCH 1/2] ixgbe: remove static qualifier for thread safety Bruce Richardson
     [not found]     ` <1413975345-24326-2-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-10-22 23:43       ` Masaru Oki
     [not found]         ` <CAFLKUzKY5488C-e5LwVd=+JqxgoLOv8ddURtPYVgntevrY6aEQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-24 10:34           ` Bruce Richardson [this message]
2014-10-24 11:00             ` Masaru Oki
2014-10-22 10:55   ` [PATCH 2/2] ixgbe: always perform vec RX setup if vpmd enabled Bruce Richardson
2014-10-23  1:40   ` [PATCH 0/2] ixgbe: vector pmd fixes Ouyang, Changchun
     [not found]     ` <F52918179C57134FAEC9EA62FA2F96251187C4B7-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-10-29 23:33       ` Thomas Monjalon

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=20141024103452.GA8052@BRICHA3-MOBL \
    --to=bruce.richardson-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    --cc=m-oki-kJJssGRo5Gr08ZWpFnN8/c8NsWr+9BEh@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.