From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yh0-f47.google.com (mail-yh0-f47.google.com [209.85.213.47]) by dpdk.org (Postfix) with ESMTP id 02EDE7E62 for ; Fri, 24 Oct 2014 12:52:02 +0200 (CEST) Received: by mail-yh0-f47.google.com with SMTP id c41so207820yho.34 for ; Fri, 24 Oct 2014 04:00:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=G3JUkP5V1bGEkuSU9t0tsnT11B69aU5su+woNEiQwas=; b=kBKIV4a0+nCCwKs43NEiZvyGwCSIAnPfPSAo7/NGQcCZ0aqWVXzjCs7+RaaVDh756v PprxacSbXjOd/MF2MFhCUxYMx/odvp/oSa3fX/pKXBnINShpXee/TKRYeMRvEB6uOltQ Kby5pOO/Kyum9Qho1vDClXXcgmUL07IJIBekzHprb0rKJSDtaWUGpCmpmeIgF3SYDgAu oRzRMCK0bg77pshSXfEPnHoz0ZFArKr3VE6LESHe1MLP5RxOMbg6q0fIEjFGLMz1yOgW /u5yHPJKHEoUV7zDws5VxWtIbyLdAahKFgGrwCcPLGL5uTkDa7u9a1aMvkX4QK0eaHQY 8NzQ== X-Gm-Message-State: ALoCoQn3D++SMXJcifJ2GEmE9PgV3IYYgR2yxhxLEr27XEXB2nYc6FihWtUORg69qOod05gTAHRK MIME-Version: 1.0 X-Received: by 10.170.190.16 with SMTP id h16mr5698754yke.32.1414148431234; Fri, 24 Oct 2014 04:00:31 -0700 (PDT) Received: by 10.182.31.111 with HTTP; Fri, 24 Oct 2014 04:00:31 -0700 (PDT) In-Reply-To: <20141024103452.GA8052@BRICHA3-MOBL> References: <1413975345-24326-1-git-send-email-bruce.richardson@intel.com> <1413975345-24326-2-git-send-email-bruce.richardson@intel.com> <20141024103452.GA8052@BRICHA3-MOBL> Date: Fri, 24 Oct 2014 20:00:31 +0900 Message-ID: From: Masaru Oki To: Bruce Richardson Content-Type: text/plain; charset=UTF-8 Cc: "" Subject: Re: [dpdk-dev] [PATCH 1/2] ixgbe: remove static qualifier for thread safety X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Oct 2014 10:52:03 -0000 Oh, sorry, you are right. I had missed first * for copy. thank you. 2014-10-24 19:34 GMT+09:00 Bruce Richardson : > 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 : >> > 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 >> > --- >> > 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 >> >