From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 6849AA045E for ; Thu, 30 May 2019 15:20:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D5E861B94A; Thu, 30 May 2019 15:20:15 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 1514A1B944 for ; Thu, 30 May 2019 15:20:13 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 May 2019 06:20:13 -0700 X-ExtLoop1: 1 Received: from unknown (HELO broadwell-dev-4.localdomain) ([10.224.122.193]) by orsmga001.jf.intel.com with ESMTP; 30 May 2019 06:20:12 -0700 From: Nikhil Rao To: jerinj@marvell.com Cc: dev@dpdk.org, Nikhil Rao Date: Thu, 30 May 2019 06:49:44 +0530 Message-Id: <1559179184-2052-2-git-send-email-nikhil.rao@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1559179184-2052-1-git-send-email-nikhil.rao@intel.com> References: <1557359847-6374-1-git-send-email-nikhil.rao@intel.com> <1559179184-2052-1-git-send-email-nikhil.rao@intel.com> Subject: [dpdk-dev] [PATCH 2/2] eventdev: add dropped count to Rx adapter stats 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" The application can install a callback invoked by the Rx adapter. The callback can drop packets and populate a callback argument with the number of dropped packets. Add a Rx adapter stats field to keep track of the total number of dropped packets. Signed-off-by: Nikhil Rao --- lib/librte_eventdev/rte_event_eth_rx_adapter.h | 2 ++ lib/librte_eventdev/rte_event_eth_rx_adapter.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.h b/lib/librte_eventdev/rte_event_eth_rx_adapter.h index a64eed0..4ea5a53 100644 --- a/lib/librte_eventdev/rte_event_eth_rx_adapter.h +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.h @@ -197,6 +197,8 @@ struct rte_event_eth_rx_adapter_stats { /**< Eventdev enqueue count */ uint64_t rx_enq_retry; /**< Eventdev enqueue retry count */ + uint64_t rx_dropped; + /**< Received packet dropped count */ uint64_t rx_enq_start_ts; /**< Rx enqueue start timestamp */ uint64_t rx_enq_block_cycles; diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c index ab4e3cf..4d41aa7 100644 --- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c @@ -807,6 +807,7 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b) if (dev_info->cb_fn) { + dropped = 0; nb_cb = dev_info->cb_fn(eth_dev_id, rx_queue_id, ETH_EVENT_BUFFER_SIZE, @@ -820,6 +821,8 @@ static uint16_t rxa_gcd_u16(uint16_t a, uint16_t b) nb_cb, num); else num = nb_cb; + if (dropped) + rx_adapter->stats.rx_dropped += dropped; } buf->count += num; -- 1.8.3.1