From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by dpdk.org (Postfix) with ESMTP id 5DFAE678D for ; Mon, 24 Mar 2014 16:24:15 +0100 (CET) Received: by mail-bk0-f52.google.com with SMTP id my13so558134bkb.11 for ; Mon, 24 Mar 2014 08:25:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=ZXjfzbOsLPY6L2HZC2Wqc3lIJzl2E/A1wiZUlaIKzn4=; b=lcoUElvpS39CrfhVRQdtuUaP5nWe4t3gzL32ByUPv7b8v6OHqSihG47gg356a+KVRU yWbWrYlum3YROX6dAwRw/wG7iAeJgkmwdeR6u7GnUxqDI1juLUPzyniddfxwRM0g0Cc0 3SVmNEnbibeqmPvSNPPe0i94sjU9GpghBgBEkt4xLQ1BiI6Z1/HOV8XlWLvbu6OvX8jL dy2P0O9kgVmzYThKdObzSLUMS4KyhKkOdjZ0Sgux8+FI3WoZKZOfU7Zcezlm3GVqRQWM enXgSCtwipH4ol1hbERE7rxBdGMb+55IbUUBxgfB5EhQM/sGQaeuiiOOVlZkK/sBQELa dd3w== X-Gm-Message-State: ALoCoQngIfYVInCJV7bXZXMzH4ORPbAN1voPc7yjp0CgjL2XuuOS/2rFNsthaPy2W8/Zuhhr9ylD X-Received: by 10.205.98.10 with SMTP id cm10mr241089bkc.85.1395674747709; Mon, 24 Mar 2014 08:25:47 -0700 (PDT) Received: from xps13.localnet (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id xk2sm13772423bkb.9.2014.03.24.08.25.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Mar 2014 08:25:46 -0700 (PDT) From: Thomas Monjalon To: Hiroshi Shimamoto Date: Mon, 24 Mar 2014 16:25:44 +0100 Message-ID: <1588240.i7QGELTBWt@xps13> Organization: 6WIND User-Agent: KMail/4.12.3 (Linux/3.13.6-1-ARCH; KDE/4.12.3; x86_64; ; ) In-Reply-To: <7F861DC0615E0C47A872E6F3C5FCDDBD01073B19@BPXM14GP.gisp.nec.co.jp> References: <7F861DC0615E0C47A872E6F3C5FCDDBD01073B19@BPXM14GP.gisp.nec.co.jp> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org, Hayato Momma Subject: Re: [dpdk-dev] [memnic PATCH 3/5] pmd: implement stats of MEMNIC 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: Mon, 24 Mar 2014 15:24:15 -0000 Hi, 11/03/2014 05:38, Hiroshi Shimamoto: > From: Hiroshi Shimamoto > > Implement missing feature to account statistics. > This patch adds just an infrastructure. > > Signed-off-by: Hiroshi Shimamoto > Reviewed-by: Hayato Momma [...] > @@ -51,6 +51,7 @@ struct memnic_adapter { > int up_idx, down_idx; > struct rte_mempool *mp; > struct ether_addr mac_addr; > + struct rte_eth_stats stats[RTE_MAX_LCORE]; > }; Could you make a comment to explain why you allocate a structure per core? It is easier to read when locking strategy is described. > + for (i = 0; i < RTE_MAX_LCORE; i++) { > + struct rte_eth_stats *st = &adapter->stats[i]; > + > + memset(st, 0, sizeof(*st)); > + } Could you use only one memset for the array? -- Thomas