From patchwork Thu Sep 26 14:54:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Haiyue" X-Patchwork-Id: 59910 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 50A471BE98; Thu, 26 Sep 2019 17:00:33 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 7D84234F3 for ; Thu, 26 Sep 2019 17:00:27 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2019 08:00:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,552,1559545200"; d="scan'208";a="194151534" Received: from npg-dpdk-haiyue-1.sh.intel.com ([10.67.119.153]) by orsmga006.jf.intel.com with ESMTP; 26 Sep 2019 08:00:24 -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: Thu, 26 Sep 2019 22:54:44 +0800 Message-Id: <20190926145444.114485-5-haiyue.wang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190926145444.114485-1-haiyue.wang@intel.com> References: <20190926145444.114485-1-haiyue.wang@intel.com> Subject: [dpdk-dev] [PATCH v2 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 --- 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 a3b6cbd08..6676e8651 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -330,9 +330,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 = "*********************"; @@ -360,12 +376,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 = "*********************"; @@ -389,6 +412,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"); }