DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
From: Nikhil Rao <nikhil.rao@intel.com>
To: jerinj@marvell.com
Cc: dev@dpdk.org, Nikhil Rao <nikhil.rao@intel.com>
Subject: [dpdk-dev] [PATCH 2/2] eventdev: add dropped count to Rx adapter stats
Date: Thu, 30 May 2019 06:49:44 +0530
Message-ID: <1559179184-2052-2-git-send-email-nikhil.rao@intel.com> (raw)
In-Reply-To: <1559179184-2052-1-git-send-email-nikhil.rao@intel.com>

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 <nikhil.rao@intel.com>
---
 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


  reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08 23:57 [dpdk-dev] [RFC] eventdev: replace mbufs with events in Rx callback Nikhil Rao
2019-05-30  1:07 ` [dpdk-dev] [PATCH 1/2] " Nikhil Rao
2019-05-30  1:19 ` Nikhil Rao
2019-05-30  1:19   ` Nikhil Rao [this message]
2019-06-13 23:28   ` [dpdk-dev] [PATCH v2] eventdev: change Rx adapter callback and stats structure Nikhil Rao
2019-06-24 23:16   ` [dpdk-dev] [PATCH v3] " Nikhil Rao

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1559179184-2052-2-git-send-email-nikhil.rao@intel.com \
    --to=nikhil.rao@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org dpdk-dev@archiver.kernel.org
	public-inbox-index dpdk-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox