From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by dpdk.org (Postfix) with ESMTP id 66C1F4C92 for ; Fri, 9 Nov 2018 17:23:50 +0100 (CET) Received: by mail-pl1-f194.google.com with SMTP id f12-v6so1168203plo.1 for ; Fri, 09 Nov 2018 08:23:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SN8xQ7zBmVyQEls+o09wYT4wTuyAG9vQubytOukEDFI=; b=qBqTBtlRVm56MFivEpegRdYI2uyaBGIONbC/yIZj5l7OE4s/jDx/UAnun8bg10XFS1 G61xYK/uYsOECKwYY3sPoeIlp/NfdZM84+Ebu9EZlhW4x12zcDVDu5Uh62dkwO6Rz03n FoqKpC0+OziqxfIBWKT2xAMaxNNdCADLlP1ziPyyeAlAGeLHJ9jfGWl2lejp9YHyuqMX Q4hS6eau8KhZHP2HIuDNv9Lv5/oidD0QX5JqcwdQlfJsMYYE76AaHxq7MfyZVCmVaZgB WpoUx2K3MDRO2hJY3NJeVm7KrYQP27WvnfTNz1bGGpLw31h3jcoLDEdpm1GD14ohI8ld 2Rjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SN8xQ7zBmVyQEls+o09wYT4wTuyAG9vQubytOukEDFI=; b=CiZRPa84aQ9f0zqr3/wOryFBw8+9kEHsQjsn5mgvK5Y8IYm6ayFX27HZX3/JmSYpLD IRI8of9ZBY6CFtFYam7r6MjMVPdspNvb4fg8n8F2BqfPljyqV/i06oNMkwaZyRtldoUL +0OinS+EoKI2TNDnjgRLcxzXslXyb+vvP0k8LDTa3uKt4bzLYsCsMoiYfnLWISjQUBOd xjb53L9Y217wEA3k47COFg+EkCK6MS0efOFvD9o/bzvuHaepcdqMMnIMc/Jw+wqorM/S 0Vf3TmFHo2j2gSTWQvrC8bY5Ukr1UXwPADThiU1t6IDCIt1bqjc7oeUD1ZtNinhVVcdR YWkA== X-Gm-Message-State: AGRZ1gIFmx0ZlcehqVWy5Ui6Ghp/Wt8kA01Y6i1mJ2mEzJumD2yq2S6v VPk6xVJ+p0gdk4T2GTgG83kdbux+ymM= X-Google-Smtp-Source: AJdET5cDSWDluZ/Hu4fSPH1EUs06hyPrexQa++Md38KHy8KeguHkKAgeblcv/+JdzY/ckG75lEb2CQ== X-Received: by 2002:a17:902:6e17:: with SMTP id u23-v6mr9747441plk.127.1541780629453; Fri, 09 Nov 2018 08:23:49 -0800 (PST) Received: from xeon-e3 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id l64sm5475450pge.73.2018.11.09.08.23.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Nov 2018 08:23:49 -0800 (PST) Date: Fri, 9 Nov 2018 08:23:47 -0800 From: Stephen Hemminger To: Thomas Monjalon Cc: Tom Barbette , "dev@dpdk.org" , Ferruh Yigit , Andrew Rybchenko Message-ID: <20181109082347.05665665@xeon-e3> In-Reply-To: <2479925.7nIZOZccjf@xps> References: <1541752126267.9242@kth.se> <2479925.7nIZOZccjf@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 16:23:50 -0000 On Fri, 09 Nov 2018 09:38:46 +0100 Thomas Monjalon wrote: > 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. > > > More capabablities makes it harder for applications. For the examples you give, some of these are just *bugs* in the drivers. Like the ibytes field. Let's fix the bugs rather than expect application to workaround them. For others, if the driver has no places it allocates mbufs or drops packets in the driver I see no reason that the driver needs to do anything with those fields.