From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by dpdk.org (Postfix) with ESMTP id 6F238C450 for ; Wed, 17 Jun 2015 15:59:14 +0200 (CEST) Received: by wicnd19 with SMTP id nd19so84204806wic.1 for ; Wed, 17 Jun 2015 06:59:14 -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=AK1/YhU8DFVRXPgfQdx0ghNvOOpgoOHqMEbEk6OODVY=; b=PCYctRfxgKJZLTCAbUyZesThqYFlVpAfg8Y6DsUtuJl4go6Kl/hppNQpr0RgmycBC3 MTNx5A9Aa8SAJhAyusXxPVn1faVk+4WpMNWV+QjrjeMvHH0DopF+cp88aiI7QjzklVRt JIHsmWAfAkQzwUEgLcNZl5ClYb0ZLiQrmddkk5yPteaaoUrOptHyamLN/ZODNSj126Qk 4/SNWxTPvm/FyBLfp7n9AT57ooctdku6F1M8N6CueCGJo3ETa9/leQwZ2T8IS8PlD/d+ mg7nCxmIN7ZrJ5m0CxZRuaHMuwDy11mbLqBUQQm3eOs+m43BzF2wf7UDtWh6GPYZ2qeJ Seiw== X-Gm-Message-State: ALoCoQmslBZOPc5ZOC6FzbaNwyyTpv2AapRstI3J35OZQal7H+9344IzE6XMavREShQC9HvSZoDw X-Received: by 10.180.105.227 with SMTP id gp3mr917252wib.56.1434549554198; Wed, 17 Jun 2015 06:59:14 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id fb3sm26156063wib.21.2015.06.17.06.59.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jun 2015 06:59:13 -0700 (PDT) From: Thomas Monjalon To: Maryam Tahhan Date: Wed, 17 Jun 2015 15:58:13 +0200 Message-ID: <6388992.ny7qEppTdV@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <1433525705-17041-3-git-send-email-maryam.tahhan@intel.com> References: <1433525705-17041-1-git-send-email-maryam.tahhan@intel.com> <1433525705-17041-3-git-send-email-maryam.tahhan@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 2/4] ethdev: expose extended error stats 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: Wed, 17 Jun 2015 13:59:14 -0000 2015-06-05 18:35, Maryam Tahhan: > Extend rte_eth_xstats_get to retrieve additional stats from the device > driver as well the top level extended stats. Add additional drop > counters to the extended stats. > > Signed-off-by: Maryam Tahhan [..] Patch 1/4 doesn't compile without patch 2/4. > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -129,6 +129,8 @@ static const struct rte_eth_xstats_name_off rte_stats_strings[] = { > {"rx_crc_errors", offsetof(struct rte_eth_stats, ibadcrc)}, > {"rx_bad_length_errors", offsetof(struct rte_eth_stats, ibadlen)}, > {"rx_errors", offsetof(struct rte_eth_stats, ierrors)}, > + {"rx_mac_err", offsetof(struct rte_eth_stats, imacerr)}, > + {"rx_phy_err", offsetof(struct rte_eth_stats, iphyerr)}, > {"alloc_rx_buff_failed", offsetof(struct rte_eth_stats, rx_nombuf)}, > {"fdir_match", offsetof(struct rte_eth_stats, fdirmatch)}, > {"fdir_miss", offsetof(struct rte_eth_stats, fdirmiss)}, > @@ -136,6 +138,8 @@ static const struct rte_eth_xstats_name_off rte_stats_strings[] = { > {"rx_flow_control_xon", offsetof(struct rte_eth_stats, rx_pause_xon)}, > {"tx_flow_control_xoff", offsetof(struct rte_eth_stats, tx_pause_xoff)}, > {"rx_flow_control_xoff", offsetof(struct rte_eth_stats, rx_pause_xoff)}, > + {"tx_drops", offsetof(struct rte_eth_stats, odrop)}, > + {"rx_drops", offsetof(struct rte_eth_stats, idrop)}, > }; [...] > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -224,6 +224,10 @@ struct rte_eth_stats { > > /**< Total number of good bytes received from loopback,VF Only */ > uint64_t olbbytes; > /**< Total number of good bytes transmitted to loopback,VF Only */ > > + uint64_t imacerr; /**< Total of RX packets with MAC Errors. */ > + uint64_t iphyerr; /**< Total of RX packets with PHY Errors. */ > + uint64_t idrop; /**< Total number of dropped received packets. */ > + uint64_t odrop; /**< Total number of dropped transmitted packets. */ > }; You are extending the generic stats. This is not the idea behind xstats. The xstats are specific to the driver. Furthermore we should migrate some "not really generic stats" to xstats in order to keep only the really basic and common stats in rte_eth_stats. By the way, in order to avoid duplicated code when getting generic stats through xstats API, we need to change the implementation of rte_eth_xstats_get() to add generic stats automatically, even if the driver provide some xstats.