From patchwork Fri Sep 26 06:03:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingjing Wu X-Patchwork-Id: 557 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 9C18A7E13; Fri, 26 Sep 2014 07:58:18 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 8242C7E07 for ; Fri, 26 Sep 2014 07:58:17 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 25 Sep 2014 23:04:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,603,1406617200"; d="scan'208";a="579305133" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 25 Sep 2014 23:04:10 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id s8Q649RB029332; Fri, 26 Sep 2014 14:04:09 +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 s8Q64606013000; Fri, 26 Sep 2014 14:04:09 +0800 Received: (from wujingji@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s8Q646Mx012996; Fri, 26 Sep 2014 14:04:06 +0800 From: Jingjing Wu To: dev@dpdk.org Date: Fri, 26 Sep 2014 14:03:30 +0800 Message-Id: <1411711418-12881-13-git-send-email-jingjing.wu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1411711418-12881-1-git-send-email-jingjing.wu@intel.com> References: <1411711418-12881-1-git-send-email-jingjing.wu@intel.com> Subject: [dpdk-dev] [PATCH v3 12/20] app/test-pmd: 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" display flow director's statistics information Signed-off-by: Jingjing Wu Acked-by: Chen Jing D(Mark) Acked-by: Helin Zhang --- app/test-pmd/config.c | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 2a1b93f..f28e338 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1815,26 +1815,48 @@ 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_OP_GET_INFO, &fdir_infos); + if (ret < 0) { + ret = rte_eth_dev_fdir_get_infos(port_id, &fdir_infos.info); + if (ret < 0) { + printf("\n getting fdir info fails on port %-2d\n", + port_id); + return; + } + fdir_infos.mode = (fdir_conf.mode == RTE_FDIR_MODE_NONE) ? 0 : 1; + } 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" + " add: %-10"PRIu64" remove: %"PRIu64"\n" " f_add: %-10"PRIu64" f_remove: %"PRIu64"\n", - (uint64_t)(fdir_infos.collision), (uint64_t)(fdir_infos.free), - (uint64_t)(fdir_infos.maxhash), (uint64_t)(fdir_infos.maxlen), - fdir_infos.add, fdir_infos.remove, - fdir_infos.f_add, fdir_infos.f_remove); + (uint64_t)(fdir_infos.info.collision), (uint64_t)(fdir_infos.info.free), + (uint64_t)(fdir_infos.info.maxhash), (uint64_t)(fdir_infos.info.maxlen), + fdir_infos.info.add, fdir_infos.info.remove, + fdir_infos.info.f_add, fdir_infos.info.f_remove); + printf(" guarant_space: %-10"PRIu16 + " best_space: %-10"PRIu16"\n", + fdir_infos.info_ext.guarant_spc, + fdir_infos.info_ext.best_spc); + printf(" guarant_count: %-10"PRIu16 + " best_count: %-10"PRIu16"\n", + fdir_infos.info_ext.guarant_cnt, + fdir_infos.info_ext.best_cnt); printf(" %s############################%s\n", fdir_stats_border, fdir_stats_border); }