From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 233981E98A; Thu, 14 Jun 2018 08:39:52 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jun 2018 23:39:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,222,1526367600"; d="scan'208";a="47663022" Received: from rhorton-mobl1.ger.corp.intel.com (HELO [163.33.230.30]) ([163.33.230.30]) by fmsmga008.fm.intel.com with ESMTP; 13 Jun 2018 23:39:48 -0700 To: Ferruh Yigit , David Marchand , dev@dpdk.org References: <1528359323-22885-1-git-send-email-david.marchand@6wind.com> Cc: wenzhuo.lu@intel.com, jingjing.wu@intel.com, bernard.iremonger@intel.com, stable@dpdk.org, Harry Van Haaren From: Remy Horton Organization: Intel Shannon Limited Message-ID: <94ff9382-dbcd-1afd-b149-349653e1222e@intel.com> Date: Thu, 14 Jun 2018 07:39:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] app/testpmd: add sanity checks when retrieving xstats X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 06:39:53 -0000 On 13/06/2018 16:39, Ferruh Yigit wrote: > On 6/7/2018 9:15 AM, David Marchand wrote: >> Testpmd should not expect the xstats names and values arrays to be >> aligned: neither the arrays sizes, nor the order in which the values are. > > As far as I can see this assumption is everywhere in API implementation: > xstats names and values are aligned with same order. > The basic stat part of the xstats, implemented in ethdev layer, seems relying on > same assumption. Also looks like "xstat size" and "xstat_names size" used > interchangeably. > > And I don't see any case that mentions xstats.id is xstats_name index. > cc'ed Harry, to get more information about initial intention. > > the id value in xstats struct looks like duplication, but other than that, is > there any downside of using array index to mach name, value pair? > And do we really need another layer of indirection (and complexity) to mach > simple name,value key pair in xstats? When I was working on xstats one of my intentions was to allow PMDs to only return a subset of values for all the keys they declare, with xstats[idx].id==idx just being a coincidence that was not to be relied on. Since then there appears to have been several instances of rework, so no idea if this coincidence becoming an assumption was intentional or an oversight. ..Remy