From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7AE7DA0597; Wed, 8 Apr 2020 10:33:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 63E9D1C1C2; Wed, 8 Apr 2020 10:29:58 +0200 (CEST) Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by dpdk.org (Postfix) with ESMTP id 8D1BB1C1A1 for ; Wed, 8 Apr 2020 10:29:52 +0200 (CEST) Received: by mail-lf1-f65.google.com with SMTP id j17so4478576lfe.7 for ; Wed, 08 Apr 2020 01:29:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J9gqqnaTMXcqQgWdFhVDfYPoqc6jIAmVfH9BEDKs3HM=; b=T3cPnTG++7LODM3BlGueugDp5yEXPs0P71Bv7NRwSkPHhqUFMuqhOcatDhOYogulDz yA87tOrSVgxu+Z0MPeUEF2DwywZuLGIoK9L0B//BMKNZqluAj/qa53hEqAU5YInyRutb ve+kbM51wmJIB/Bzo7KqZzx8c2xbGXSlF+EPdqcGqTyqVdz9uasZdF5VKOPyyMVAuPny ZKaUSP+zD7ufIZ/0mY/3r0lrumKwvau4WHC2ebZriHuwAVMbSih6MtmlLDUFbp0JE44Q 43jZmIg+d366hjY48ByNRoYPNCPUZSW8WVsYCYPlXPaZwHYd2n5GZ5Gvr2+bBJkSyuNc B1Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J9gqqnaTMXcqQgWdFhVDfYPoqc6jIAmVfH9BEDKs3HM=; b=BFWokLslKEJMfIXObGdx1MHSBzn0zQQan5VP1mLj+6PBBC2fNIIQ1i4o6mDW58WHmY ccYYLk+6Uid4zGwR7Yxoyyae9y7iiNbvOYpCgcyaDlKPoUE7HNOY3hEJC5JkydC7Hy7T T+fhVJ8YjipCchLYUgNa1mCfJoDO6bRKQCInHS68kjb210tShBQ26DQlGsxTN4tI1CrT +Y/ZuiX0WnRgkNWkmzcPYIAM3267OUiGXQXVW3fQV3zZmZsAYInmcsA4fL76ITDUeYjs u1Jd9wCYf5M21RpPOhAJ1lNNHDsPvvsgbiqOle4rpJQu6EnvHK7wMHl67VfW0OnK3HOj pnxw== X-Gm-Message-State: AGi0PuYLvg8Q18YRc/lsXR9aWXTtuK9isXRNEB5qhKlCmcxEurhSF2sc k7dMKWyjZ1w4g/utTgvjPoO9v/1Uegk= X-Google-Smtp-Source: APiQypL2EB6m3niK+Q5qQipEsCVHnpzIp3HOzPQIf0j6+s4tY59tLzBryfC45GXjhim0e22ZrUOIWw== X-Received: by 2002:ac2:43b1:: with SMTP id t17mr3903546lfl.9.1586334591828; Wed, 08 Apr 2020 01:29:51 -0700 (PDT) Received: from mkPC.semihalf.local (193-106-246-138.noc.fibertech.net.pl. [193.106.246.138]) by smtp.gmail.com with ESMTPSA id e8sm765685lja.3.2020.04.08.01.29.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2020 01:29:51 -0700 (PDT) From: Michal Krawczyk To: dev@dpdk.org Cc: mw@semihalf.com, mba@semihalf.com, gtzalik@amazon.com, evgenys@amazon.com, igorch@amazon.com, ferruh.yigit@intel.com, arybchenko@solarflare.com, Michal Krawczyk Date: Wed, 8 Apr 2020 10:29:12 +0200 Message-Id: <20200408082921.31000-22-mk@semihalf.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200408082921.31000-1-mk@semihalf.com> References: <20200408082921.31000-1-mk@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 21/30] net/ena: add Tx drops statistic 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" ENA device can report in the AENQ handler amount of Tx packets that were dropped and not sent. This statistic is showing global value for the device and because rte_eth_stats is missing field that could indicate this value (it isn't the Tx error), it is being presented as a extended statistic. As the current design of extended statistics prevents tx_drops from being an atomic variable and both tx_drops and rx_drops are only updated from the AENQ handler, both were set as non-atomic for the alignment. Signed-off-by: Michal Krawczyk Reviewed-by: Igor Chauskin Reviewed-by: Guy Tzalik --- v3: * Update release notes doc/guides/rel_notes/release_20_05.rst | 1 + drivers/net/ena/ena_ethdev.c | 11 ++++++++--- drivers/net/ena/ena_ethdev.h | 8 +++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/doc/guides/rel_notes/release_20_05.rst b/doc/guides/rel_notes/release_20_05.rst index 7c73fe8fd5..bcd8d86299 100644 --- a/doc/guides/rel_notes/release_20_05.rst +++ b/doc/guides/rel_notes/release_20_05.rst @@ -83,6 +83,7 @@ New Features Updated ena PMD with new features and improvements, including: * Added support for large LLQ (Low-latency queue) headers. + * Added Tx drops as new extended driver statistic. Removed Items diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 07feb62c3f..0d4523c1da 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -96,6 +96,7 @@ static const struct ena_stats ena_stats_global_strings[] = { ENA_STAT_GLOBAL_ENTRY(wd_expired), ENA_STAT_GLOBAL_ENTRY(dev_start), ENA_STAT_GLOBAL_ENTRY(dev_stop), + ENA_STAT_GLOBAL_ENTRY(tx_drops), }; static const struct ena_stats ena_stats_tx_strings[] = { @@ -938,7 +939,7 @@ static void ena_stats_restart(struct rte_eth_dev *dev) rte_atomic64_init(&adapter->drv_stats->ierrors); rte_atomic64_init(&adapter->drv_stats->oerrors); rte_atomic64_init(&adapter->drv_stats->rx_nombuf); - rte_atomic64_init(&adapter->drv_stats->rx_drops); + adapter->drv_stats->rx_drops = 0; } static int ena_stats_get(struct rte_eth_dev *dev, @@ -972,7 +973,7 @@ static int ena_stats_get(struct rte_eth_dev *dev, ena_stats.tx_bytes_low); /* Driver related stats */ - stats->imissed = rte_atomic64_read(&adapter->drv_stats->rx_drops); + stats->imissed = adapter->drv_stats->rx_drops; stats->ierrors = rte_atomic64_read(&adapter->drv_stats->ierrors); stats->oerrors = rte_atomic64_read(&adapter->drv_stats->oerrors); stats->rx_nombuf = rte_atomic64_read(&adapter->drv_stats->rx_nombuf); @@ -2785,12 +2786,16 @@ static void ena_keep_alive(void *adapter_data, struct ena_adapter *adapter = adapter_data; struct ena_admin_aenq_keep_alive_desc *desc; uint64_t rx_drops; + uint64_t tx_drops; adapter->timestamp_wd = rte_get_timer_cycles(); desc = (struct ena_admin_aenq_keep_alive_desc *)aenq_e; rx_drops = ((uint64_t)desc->rx_drops_high << 32) | desc->rx_drops_low; - rte_atomic64_set(&adapter->drv_stats->rx_drops, rx_drops); + tx_drops = ((uint64_t)desc->tx_drops_high << 32) | desc->tx_drops_low; + + adapter->drv_stats->rx_drops = rx_drops; + adapter->dev_stats.tx_drops = tx_drops; } /** diff --git a/drivers/net/ena/ena_ethdev.h b/drivers/net/ena/ena_ethdev.h index ed3674b202..5afce25f13 100644 --- a/drivers/net/ena/ena_ethdev.h +++ b/drivers/net/ena/ena_ethdev.h @@ -134,13 +134,19 @@ struct ena_driver_stats { rte_atomic64_t ierrors; rte_atomic64_t oerrors; rte_atomic64_t rx_nombuf; - rte_atomic64_t rx_drops; + u64 rx_drops; }; struct ena_stats_dev { u64 wd_expired; u64 dev_start; u64 dev_stop; + /* + * Tx drops cannot be reported as the driver statistic, because DPDK + * rte_eth_stats structure isn't providing appropriate field for that. + * As a workaround it is being published as an extended statistic. + */ + u64 tx_drops; }; struct ena_offloads { -- 2.20.1