From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by dpdk.org (Postfix) with ESMTP id 484D04C92 for ; Fri, 9 Nov 2018 09:38:51 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 17A85BAB; Fri, 9 Nov 2018 03:38:49 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 09 Nov 2018 03:38:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=kjOJdh8OIst/RNcUiBcc5anE/wwXVxnW1h4ZJZ+QkSM=; b=C6WDWi5SeMq7 cONipKFWF73fyAEfJU2gKcYGR9X69nAJhfhMCOJe1YwcCWuXCqvfpVf1EVlOljsZ tdCEoHvWcFpwbhFANQsrWa2/o9qr71BoiLSX1KQajVxMIpFleugf4cfiFvA359R3 tert3XeT2YSMaGOo0X7kn7w0G4aOhpo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=kjOJdh8OIst/RNcUiBcc5anE/wwXVxnW1h4ZJZ+Qk SM=; b=RHGwPtk3vozBMMElXH3JFBEtGQ+uPZt4sd9PcKEYe/zsgeYmjzO6KTKAr xIUuB9LWhMr57XA3Joqx30ZWmXNouOq0QitlYgiCTowod4nUtaPUdG7C/BH4hRJc NyjuaLmh/vpvlMhWsKRjxnITwnL3Dd9GLOs3cRHz6mhwnCl19M+H6Iwh9KIozpa2 C3jjNiNzoStopVulRMTSdDzYKnH42Toy6eXsB03P1TZgWKiu2ijdby6Nes/x6lsh Y1xFC/eLVaNKNFYrwyndi8SjUfrD8xIy6J5eBd6WUfCZZ/FSr6/9ciVX19tW/Ljn cfpk10h4fhXh5ycG1HagghPKNxh8A== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 85A12102E0; Fri, 9 Nov 2018 03:38:47 -0500 (EST) From: Thomas Monjalon To: Tom Barbette Cc: "dev@dpdk.org" , Ferruh Yigit , Andrew Rybchenko Date: Fri, 09 Nov 2018 09:38:46 +0100 Message-ID: <2479925.7nIZOZccjf@xps> In-Reply-To: <1541752126267.9242@kth.se> References: <1541752126267.9242@kth.se> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] Which counters are set by rte_eth_stats_get 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: Fri, 09 Nov 2018 08:38:51 -0000 09/11/2018 09:28, Tom Barbette: > Hi ethdev maintainers, > > > Support of drivers for the fields in rte_eth_stats is a bit random, and never mentioned in the doc. A quick survey showed me : > > > ipackets : implemented by all drivers > ibytes : all except null, ring > ierror : all except af_packet, ark, avf, axgbe, fm10k, kni, null, pcap, ring, szedata2, vhost > imissed : *only* af_packet, avp, axgbe, fm10k, kni, liquidio, mlx4, mlx5, null, pcap, ring, szedata2, tap, vhost, virtio > rx_nombuf : *only* bnx2x,bnxt,bonding,ena,enic,failsafe,mlx4,mlx5,netvsc,nfp,qede,szedata2,tap,virtio > > With no way to know if we can rely on the value or not, as a DPDK user pov. The only way to know if we can rely on a given counter is to grep the driver code. Except if I missed something? > > Also the doc of rte_eth_stats_get only mention io packets, bytes and errors. Not the other fields, and the way it is written let the reader think it is always supported if the function does not return 0. > > I can update the doc to reflect the state of things. But maybe we could make that function return a bitmask which tells which counter has been set. But that would break the ABI... We could also have the bitmask set through a passed pointer, so it does not break code checking the return value is 0. Or maybe have the bitmask elsewhere, like for the offloads? Which fields are supported is probably a constant. So that may make more sense. I think having capabilities, as for offload, is reasonnable. The other option would be to push for implementing all basic stats in all drivers, and consider an unimplemented stat as a bug.