DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>, <xiaoyun.li@intel.com>
Subject: [dpdk-dev] [PATCH] app/testpmd: support display queue state
Date: Wed, 21 Apr 2021 11:24:59 +0800	[thread overview]
Message-ID: <1618975499-58463-1-git-send-email-humin29@huawei.com> (raw)

From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports display queue state in "show rxq/txq" commands.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 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",
-- 
2.7.4


             reply	other threads:[~2021-04-21  3:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21  3:24 Min Hu (Connor) [this message]
2021-04-21 12:08 ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1618975499-58463-1-git-send-email-humin29@huawei.com \
    --to=humin29@huawei.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=xiaoyun.li@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).