From patchwork Mon Oct 14 15:35:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Haiyue" X-Patchwork-Id: 61129 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 866501C2B8; Mon, 14 Oct 2019 17:42:03 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 0B9301C122 for ; Mon, 14 Oct 2019 17:41:54 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Oct 2019 08:41:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,296,1566889200"; d="scan'208";a="225112004" Received: from npg-dpdk-haiyue-1.sh.intel.com ([10.67.119.153]) by fmsmga002.fm.intel.com with ESMTP; 14 Oct 2019 08:41:53 -0700 From: Haiyue Wang To: dev@dpdk.org, ferruh.yigit@intel.com, xiaolong.ye@intel.com Cc: ray.kinsella@intel.com, bernard.iremonger@intel.com, chenmin.sun@intel.com, Haiyue Wang Date: Mon, 14 Oct 2019 23:35:57 +0800 Message-Id: <20191014153557.88467-5-haiyue.wang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191014153557.88467-1-haiyue.wang@intel.com> References: <20191014153557.88467-1-haiyue.wang@intel.com> Subject: [dpdk-dev] [PATCH v3 4/4] app/testpmd: show the Rx/Tx burst mode description X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add the 'Burst mode' section into command 'show rxq|txq info ' to show the Rx/Tx burst mode description like: "Burst mode: Vector AVX2 Scattered" Signed-off-by: Haiyue Wang Acked-by: Bernard Iremonger Reviewed-by: Xiaolong Ye --- app/test-pmd/config.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 2356afee9..1844e4875 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -346,9 +346,25 @@ nic_stats_mapping_display(portid_t port_id) nic_stats_mapping_border, nic_stats_mapping_border); } +static void +burst_mode_options_display(uint64_t options) +{ + int offset; + + while (options != 0) { + offset = rte_bsf64(options); + + printf(" %s", + rte_eth_burst_mode_option_name(1ULL << offset)); + + options &= ~(1ULL << offset); + } +} + void rx_queue_infos_display(portid_t port_id, uint16_t queue_id) { + struct rte_eth_burst_mode mode; struct rte_eth_rxq_info qinfo; int32_t rc; static const char *info_border = "*********************"; @@ -376,12 +392,19 @@ rx_queue_infos_display(portid_t port_id, uint16_t queue_id) printf("\nRX scattered packets: %s", (qinfo.scattered_rx != 0) ? "on" : "off"); printf("\nNumber of RXDs: %hu", qinfo.nb_desc); + + if (rte_eth_rx_burst_mode_get(port_id, queue_id, &mode) == 0) { + printf("\nBurst mode:"); + burst_mode_options_display(mode.options); + } + printf("\n"); } void tx_queue_infos_display(portid_t port_id, uint16_t queue_id) { + struct rte_eth_burst_mode mode; struct rte_eth_txq_info qinfo; int32_t rc; static const char *info_border = "*********************"; @@ -405,6 +428,12 @@ tx_queue_infos_display(portid_t port_id, uint16_t queue_id) printf("\nTX deferred start: %s", (qinfo.conf.tx_deferred_start != 0) ? "on" : "off"); printf("\nNumber of TXDs: %hu", qinfo.nb_desc); + + if (rte_eth_tx_burst_mode_get(port_id, queue_id, &mode) == 0) { + printf("\nBurst mode:"); + burst_mode_options_display(mode.options); + } + printf("\n"); }