From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id B44CC9A9E for ; Tue, 26 May 2015 14:47:56 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 26 May 2015 05:47:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,498,1427785200"; d="scan'208";a="735373564" Received: from unknown (HELO stargo) ([10.217.248.233]) by orsmga002.jf.intel.com with SMTP; 26 May 2015 05:47:53 -0700 Received: by stargo (sSMTP sendmail emulation); Tue, 26 May 2015 14:48:26 +0200 From: Maciej Gajdzica To: dev@dpdk.org Date: Tue, 26 May 2015 14:39:38 +0200 Message-Id: <1432643987-8916-2-git-send-email-maciejx.t.gajdzica@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432643987-8916-1-git-send-email-maciejx.t.gajdzica@intel.com> References: <1432643987-8916-1-git-send-email-maciejx.t.gajdzica@intel.com> Subject: [dpdk-dev] [PATCH v3 01/10] table: added structure for storing table 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: Tue, 26 May 2015 12:47:57 -0000 Added common structure for table statistics. Signed-off-by: Maciej Gajdzica --- 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 6e51fe6..1732fbf 100644 --- a/lib/librte_table/rte_table.h +++ b/lib/librte_table/rte_table.h @@ -59,6 +59,12 @@ extern "C" { struct rte_mbuf; +/** Lookup table statistics */ +struct rte_table_stats { + uint64_t n_pkts_in; + uint64_t n_pkts_lookup_miss; +}; + /** * Lookup table create * @@ -187,6 +193,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 */ @@ -194,6 +218,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