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 DD2267F11 for ; Thu, 30 Oct 2014 08:18:35 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 30 Oct 2014 00:27:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,284,1413270000"; d="scan'208";a="623301344" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 30 Oct 2014 00:27:30 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id s9U7RSWJ008086; Thu, 30 Oct 2014 15:27:28 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s9U7RPWl007958; Thu, 30 Oct 2014 15:27:27 +0800 Received: (from wujingji@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s9U7RPfN007954; Thu, 30 Oct 2014 15:27:25 +0800 From: Jingjing Wu To: dev@dpdk.org Date: Thu, 30 Oct 2014 15:26:38 +0800 Message-Id: <1414654006-7472-14-git-send-email-jingjing.wu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1414654006-7472-1-git-send-email-jingjing.wu@intel.com> References: <1413939687-11177-1-git-send-email-jingjing.wu@intel.com> <1414654006-7472-1-git-send-email-jingjing.wu@intel.com> Subject: [dpdk-dev] [PATCH v5 13/21] testpmd: display fdir statistics 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: Thu, 30 Oct 2014 07:18:37 -0000 Display flow director's statistics information Signed-off-by: Jingjing Wu --- app/test-pmd/config.c | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 9bc08f4..c516be0 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1815,18 +1815,46 @@ fdir_remove_signature_filter(portid_t port_id, void fdir_get_infos(portid_t port_id) { - struct rte_eth_fdir fdir_infos; + struct rte_eth_fdir_info fdir_infos; + int ret; static const char *fdir_stats_border = "########################"; if (port_id_is_invalid(port_id)) return; - rte_eth_dev_fdir_get_infos(port_id, &fdir_infos); - + memset(&fdir_infos, 0, sizeof(fdir_infos)); + ret = rte_eth_dev_filter_ctrl(port_id, RTE_ETH_FILTER_FDIR, + RTE_ETH_FILTER_INFO, &fdir_infos); + if (ret < 0) { + /* use the old fdir APIs to get info */ + struct rte_eth_fdir fdir; + memset(&fdir, 0, sizeof(fdir)); + ret = rte_eth_dev_fdir_get_infos(port_id, &fdir); + if (ret < 0) { + printf("\n getting fdir info fails on port %-2d\n", + port_id); + return; + } + printf("\n %s FDIR infos for port %-2d %s\n", + fdir_stats_border, port_id, fdir_stats_border); + printf(" collision: %-10"PRIu64" free: %"PRIu64"\n" + " maxhash: %-10"PRIu64" maxlen: %"PRIu64"\n" + " add: %-10"PRIu64" remove: %"PRIu64"\n" + " f_add: %-10"PRIu64" f_remove: %"PRIu64"\n", + (uint64_t)(fdir.collision), (uint64_t)(fdir.free), + (uint64_t)(fdir.maxhash), (uint64_t)(fdir.maxlen), + fdir.add, fdir.remove, fdir.f_add, fdir.f_remove); + printf(" %s############################%s\n", + fdir_stats_border, fdir_stats_border); + return; + } printf("\n %s FDIR infos for port %-2d %s\n", fdir_stats_border, port_id, fdir_stats_border); - + if (fdir_infos.mode) + printf(" FDIR is enabled\n"); + else + printf(" FDIR is disabled\n"); printf(" collision: %-10"PRIu64" free: %"PRIu64"\n" " maxhash: %-10"PRIu64" maxlen: %"PRIu64"\n" " add: %-10"PRIu64" remove: %"PRIu64"\n" @@ -1835,6 +1863,12 @@ fdir_get_infos(portid_t port_id) (uint64_t)(fdir_infos.maxhash), (uint64_t)(fdir_infos.maxlen), fdir_infos.add, fdir_infos.remove, fdir_infos.f_add, fdir_infos.f_remove); + printf(" guarant_space: %-10"PRIu16 + " best_space: %-10"PRIu16"\n", + fdir_infos.guarant_spc, fdir_infos.best_spc); + printf(" guarant_count: %-10"PRIu16 + " best_count: %-10"PRIu16"\n", + fdir_infos.guarant_cnt, fdir_infos.best_cnt); printf(" %s############################%s\n", fdir_stats_border, fdir_stats_border); } -- 1.8.1.4