[dpdk-dev] [PATCH v2 01/10] table: added structure for storing table stats
Michal Jastrzebski
michalx.k.jastrzebski at intel.com
Thu Apr 30 14:14:29 CEST 2015
From: Maciej Gajdzica <maciejx.t.gajdzica at intel.com>
Added common structure for table statistics.
Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica at intel.com>
---
lib/librte_table/rte_table.h | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/lib/librte_table/rte_table.h b/lib/librte_table/rte_table.h
index d57bc33..9860b7b 100644
--- a/lib/librte_table/rte_table.h
+++ b/lib/librte_table/rte_table.h
@@ -58,6 +58,12 @@ extern "C" {
#include <rte_mbuf.h>
#include <rte_port.h>
+/** Lookup table statistics */
+struct rte_table_stats {
+ uint64_t n_pkts_in;
+ uint64_t n_pkts_lookup_miss;
+};
+
/**
* Lookup table create
*
@@ -186,6 +192,24 @@ typedef int (*rte_table_op_lookup)(
uint64_t *lookup_hit_mask,
void **entries);
+/**
+ * Lookup table stats read
+ *
+ * @param port
+ * Handle to lookup table instance
+ * @param stats
+ * Handle to table stats struct to copy data
+ * @param clear
+ * Flag indicating that stats should be cleared after read
+ *
+ * @return
+ * Error code or 0 on success.
+ */
+typedef int (*rte_table_op_stats_read)(
+ void *table,
+ struct rte_table_stats *stats,
+ int clear);
+
/** Lookup table interface defining the lookup table operation */
struct rte_table_ops {
rte_table_op_create f_create; /**< Create */
@@ -193,6 +217,7 @@ struct rte_table_ops {
rte_table_op_entry_add f_add; /**< Entry add */
rte_table_op_entry_delete f_delete; /**< Entry delete */
rte_table_op_lookup f_lookup; /**< Lookup */
+ rte_table_op_stats_read f_stats; /**< Stats */
};
#ifdef __cplusplus
--
1.7.9.5
More information about the dev
mailing list