From patchwork Wed Apr 21 03:24:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "humin (Q)" X-Patchwork-Id: 91908 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6C87BA0547; Wed, 21 Apr 2021 05:24:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A501418DB; Wed, 21 Apr 2021 05:24:54 +0200 (CEST) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by mails.dpdk.org (Postfix) with ESMTP id 2CB5D418AA for ; Wed, 21 Apr 2021 05:24:52 +0200 (CEST) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FQ5TG45B5z7wZ7 for ; Wed, 21 Apr 2021 11:22:26 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.498.0; Wed, 21 Apr 2021 11:24:45 +0800 From: "Min Hu (Connor)" To: CC: , Date: Wed, 21 Apr 2021 11:24:59 +0800 Message-ID: <1618975499-58463-1-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] app/testpmd: support display queue state X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Chengwen Feng This patch supports display queue state in "show rxq/txq" commands. Signed-off-by: Chengwen Feng Signed-off-by: Min Hu (Connor) Reviewed-by: Ferruh Yigit --- app/test-pmd/config.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index ccb9bd3..b61aff3 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -363,6 +363,19 @@ nic_xstats_clear(portid_t port_id) } } +static const char * +get_queue_state_name(uint8_t queue_state) +{ + if (queue_state == RTE_ETH_QUEUE_STATE_STOPPED) + return "stopped"; + else if (queue_state == RTE_ETH_QUEUE_STATE_STARTED) + return "started"; + else if (queue_state == RTE_ETH_QUEUE_STATE_HAIRPIN) + return "hairpin"; + else + return "unknown"; +} + void rx_queue_infos_display(portid_t port_id, uint16_t queue_id) { @@ -393,6 +406,7 @@ rx_queue_infos_display(portid_t port_id, uint16_t queue_id) (qinfo.conf.rx_deferred_start != 0) ? "on" : "off"); printf("\nRX scattered packets: %s", (qinfo.scattered_rx != 0) ? "on" : "off"); + printf("\nRx queue state: %s", get_queue_state_name(qinfo.queue_state)); if (qinfo.rx_buf_size != 0) printf("\nRX buffer size: %hu", qinfo.rx_buf_size); printf("\nNumber of RXDs: %hu", qinfo.nb_desc); @@ -433,6 +447,7 @@ 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); + printf("\nTx queue state: %s", get_queue_state_name(qinfo.queue_state)); if (rte_eth_tx_burst_mode_get(port_id, queue_id, &mode) == 0) printf("\nBurst mode: %s%s",