Skip to contentSkip to conversation

app/testpmd: support show Rx queue count

PATCH Superseded Lance Richardson 3 participants 8 messages Feb 11, 2021 – Feb 22, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd: support show Rx queue count

Add support for querying receive queue count in order to allow the rte_eth_dev rx_queue_count() API to be exercised and tested.

---
 app/test-pmd/cmdline.c                      | 65 +++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  6 ++
 2 files changed, 71 insertions(+)
app/test-pmd/cmdline.c +65 -0
index 59722d268..6e2fe57a6 100644
@@ -16699,6 +16699,70 @@ cmdline_parse_inst_t cmd_show_rx_tx_desc_status = {
 	},
 };
 
+/* *** display rx queue count *** */
+struct cmd_show_rx_queue_count_result {
+	cmdline_fixed_string_t cmd_show;
+	cmdline_fixed_string_t cmd_port;
+	cmdline_fixed_string_t cmd_rxq;
+	cmdline_fixed_string_t cmd_count;
+	portid_t cmd_pid;
+	portid_t cmd_qid;
+};
+
+static void
+cmd_show_rx_queue_count_parsed(void *parsed_result,
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
+{
+	struct cmd_show_rx_queue_count_result *res = parsed_result;
+	int rc;
+
+	if (!rte_eth_dev_is_valid_port(res->cmd_pid)) {
+		printf("invalid port id %u\n", res->cmd_pid);
+		return;
+	}
+
+	rc = rte_eth_rx_queue_count(res->cmd_pid, res->cmd_qid);
+	if (rc < 0) {
+		printf("Invalid queueid = %d\n", res->cmd_qid);
+		return;
+	}
+	printf("Used desc count = %d\n", rc);
+}
+
+cmdline_parse_token_string_t cmd_show_rx_queue_count_show =
+	TOKEN_STRING_INITIALIZER(struct cmd_show_rx_queue_count_result,
+			cmd_show, "show");
+cmdline_parse_token_string_t cmd_show_rx_queue_count_port =
+	TOKEN_STRING_INITIALIZER(struct cmd_show_rx_queue_count_result,
+			cmd_port, "port");
+cmdline_parse_token_num_t cmd_show_rx_queue_count_pid =
+	TOKEN_NUM_INITIALIZER(struct cmd_show_rx_queue_count_result,
+			cmd_pid, RTE_UINT16);
+cmdline_parse_token_string_t cmd_show_rx_queue_count_rxq =
+	TOKEN_STRING_INITIALIZER(struct cmd_show_rx_queue_count_result,
+			cmd_rxq, "rxq");
+cmdline_parse_token_num_t cmd_show_rx_queue_count_qid =
+	TOKEN_NUM_INITIALIZER(struct cmd_show_rx_queue_count_result,
+			cmd_qid, RTE_UINT16);
+cmdline_parse_token_string_t cmd_show_rx_queue_count_count =
+	TOKEN_STRING_INITIALIZER(struct cmd_show_rx_queue_count_result,
+			cmd_count, "count");
+cmdline_parse_inst_t cmd_show_rx_queue_count = {
+	.f = cmd_show_rx_queue_count_parsed,
+	.data = NULL,
+	.help_str = "show port <port_id> rxq <queue_id> count",
+	.tokens = {
+		(void *)&cmd_show_rx_queue_count_show,
+		(void *)&cmd_show_rx_queue_count_port,
+		(void *)&cmd_show_rx_queue_count_pid,
+		(void *)&cmd_show_rx_queue_count_rxq,
+		(void *)&cmd_show_rx_queue_count_qid,
+		(void *)&cmd_show_rx_queue_count_count,
+		NULL,
+	},
+};
+
 /* Common result structure for set port ptypes */
 struct cmd_set_port_ptypes_result {
 	cmdline_fixed_string_t set;
@@ -17098,6 +17162,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_config_tx_metadata_specific,
 	(cmdline_parse_inst_t *)&cmd_show_tx_metadata,
 	(cmdline_parse_inst_t *)&cmd_show_rx_tx_desc_status,
+	(cmdline_parse_inst_t *)&cmd_show_rx_queue_count,
 	(cmdline_parse_inst_t *)&cmd_set_raw,
 	(cmdline_parse_inst_t *)&cmd_show_set_raw,
 	(cmdline_parse_inst_t *)&cmd_show_set_raw_all,
doc/guides/testpmd_app_ug/testpmd_funcs.rst +6 -0
index a45910b81..789ee7d27 100644
@@ -266,6 +266,12 @@ Display information for a given port's RX/TX descriptor status::
 
    testpmd> show port (port_id) (rxq|txq) (queue_id) desc (desc_id) status
 
+show rxq count
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Display the number of ready descriptors on a given RX queue::
+
+   testpmd> show port (port_id) rxq (queue_id) count
 
 show config
 ~~~~~~~~~~~
Signature · 1 line
2.25.1
#1 lore raw
Quoted 3 lines · Lance Richardson

Add support for querying receive queue count in order to allow the rte_eth_dev rx_queue_count() API to be exercised and tested.

+1 to adding this feature, but the naming is a little misleading, "Rx queue count", it looks like it will print the number of Rx queues, and the API has the same problem indeed.

Can you please clarify it that it is to get number of used descriptor in a Rx queue? And "used descriptor" part also needs some explanation I think.

Quoted 57 lines
---
  app/test-pmd/cmdline.c                      | 65 +++++++++++++++++++++
  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  6 ++
  2 files changed, 71 insertions(+)
app/test-pmd/cmdline.c +43 -0
index 59722d268..6e2fe57a6 100644
@@ -16699,6 +16699,70 @@ cmdline_parse_inst_t cmd_show_rx_tx_desc_status = {
  	},
  };
 
+/* *** display rx queue count *** */
+struct cmd_show_rx_queue_count_result {
+	cmdline_fixed_string_t cmd_show;
+	cmdline_fixed_string_t cmd_port;
+	cmdline_fixed_string_t cmd_rxq;
+	cmdline_fixed_string_t cmd_count;
+	portid_t cmd_pid;
+	portid_t cmd_qid;
+};
+
+static void
+cmd_show_rx_queue_count_parsed(void *parsed_result,
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
+{
+	struct cmd_show_rx_queue_count_result *res = parsed_result;
+	int rc;
+
+	if (!rte_eth_dev_is_valid_port(res->cmd_pid)) {
+		printf("invalid port id %u\n", res->cmd_pid);
+		return;
+	}
+
+	rc = rte_eth_rx_queue_count(res->cmd_pid, res->cmd_qid);
+	if (rc < 0) {
+		printf("Invalid queueid = %d\n", res->cmd_qid);
+		return;
+	}
+	printf("Used desc count = %d\n", rc);
+}
+
+cmdline_parse_token_string_t cmd_show_rx_queue_count_show =
+	TOKEN_STRING_INITIALIZER(struct cmd_show_rx_queue_count_result,
+			cmd_show, "show");
+cmdline_parse_token_string_t cmd_show_rx_queue_count_port =
+	TOKEN_STRING_INITIALIZER(struct cmd_show_rx_queue_count_result,
+			cmd_port, "port");
+cmdline_parse_token_num_t cmd_show_rx_queue_count_pid =
+	TOKEN_NUM_INITIALIZER(struct cmd_show_rx_queue_count_result,
+			cmd_pid, RTE_UINT16);
+cmdline_parse_token_string_t cmd_show_rx_queue_count_rxq =
+	TOKEN_STRING_INITIALIZER(struct cmd_show_rx_queue_count_result,
+			cmd_rxq, "rxq");

app/test-pmd/cmdline.c cmdline_parse_inst_t cmd_show_rx_tx_desc_status = { · line 16754

Quoted 10 lines
app/test-pmd/cmdline.c +10 -0
+cmdline_parse_token_num_t cmd_show_rx_queue_count_qid =
+	TOKEN_NUM_INITIALIZER(struct cmd_show_rx_queue_count_result,
+			cmd_qid, RTE_UINT16);
+cmdline_parse_token_string_t cmd_show_rx_queue_count_count =
+	TOKEN_STRING_INITIALIZER(struct cmd_show_rx_queue_count_result,
+			cmd_count, "count");
+cmdline_parse_inst_t cmd_show_rx_queue_count = {
+	.f = cmd_show_rx_queue_count_parsed,
+	.data = NULL,
+	.help_str = "show port <port_id> rxq <queue_id> count",

There is already an existing command:
"show port <port_id> rxq|txq <queue_id> desc <desc_id> status"

What do you think adding the new one as something like:
"show port <port_id> rxq <queue_id> desc used count"

Quoted 27 lines
app/test-pmd/cmdline.c +12 -0
+	.tokens = {
+		(void *)&cmd_show_rx_queue_count_show,
+		(void *)&cmd_show_rx_queue_count_port,
+		(void *)&cmd_show_rx_queue_count_pid,
+		(void *)&cmd_show_rx_queue_count_rxq,
+		(void *)&cmd_show_rx_queue_count_qid,
+		(void *)&cmd_show_rx_queue_count_count,
+		NULL,
+	},
+};
+
  /* Common result structure for set port ptypes */
  struct cmd_set_port_ptypes_result {
  	cmdline_fixed_string_t set;
@@ -17098,6 +17162,7 @@ cmdline_parse_ctx_t main_ctx[] = {
  	(cmdline_parse_inst_t *)&cmd_config_tx_metadata_specific,
  	(cmdline_parse_inst_t *)&cmd_show_tx_metadata,
  	(cmdline_parse_inst_t *)&cmd_show_rx_tx_desc_status,
+	(cmdline_parse_inst_t *)&cmd_show_rx_queue_count,
  	(cmdline_parse_inst_t *)&cmd_set_raw,
  	(cmdline_parse_inst_t *)&cmd_show_set_raw,
  	(cmdline_parse_inst_t *)&cmd_show_set_raw_all,
doc/guides/testpmd_app_ug/testpmd_funcs.rst +0 -0
index a45910b81..789ee7d27 100644

doc/guides/testpmd_app_ug/testpmd_funcs.rst Display information for a given port's RX/TX descriptor status:: · line 270

Quoted 5 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2 -0
@@ -266,6 +266,12 @@ Display information for a given port's RX/TX descriptor status::
 
     testpmd> show port (port_id) (rxq|txq) (queue_id) desc (desc_id) status
 
+show rxq count
+~~~~~~~~~~~~~~~~~~~~~~~~~

The '~' line length should be same as header length

doc/guides/testpmd_app_ug/testpmd_funcs.rst Display information for a given port's RX/TX descriptor status:: · line 272

Quoted 2 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2 -0
+
+Display the number of ready descriptors on a given RX queue::

Can you please describe more, what is "ready descriptor"?

The 'rte_eth_rx_queue_count()' API should be returning number of descriptors filled by HW.

Quoted 6 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2 -0
+
+   testpmd> show port (port_id) rxq (queue_id) count
 
  show config
  ~~~~~~~~~~~
#2 lore raw
Quoted 6 lines · Ferruh Yigit
Quoted 3 lines · Lance Richardson

Add support for querying receive queue count in order to allow the rte_eth_dev rx_queue_count() API to be exercised and tested.

Quoted 7 lines

+1 to adding this feature, but the naming is a little misleading, "Rx queue count", it looks like it will print the number of Rx queues, and the API has the same problem indeed.

Can you please clarify it that it is to get number of used descriptor in a Rx queue? And "used descriptor" part also needs some explanation I think.

That makes sense, fixed in v2.

Quoted 6 lines

There is already an existing command:
"show port <port_id> rxq|txq <queue_id> desc <desc_id> status"

What do you think adding the new one as something like:
"show port <port_id> rxq <queue_id> desc used count"

Sounds good, v2 is updated to use that form.

Quoted 5 lines
Quoted 2 lines

+show rxq count
+~~~~~~~~~~~~~~~~~~~~~~~~~

The '~' line length should be same as header length

Fixed in v2.

Quoted 8 lines

doc/guides/testpmd_app_ug/testpmd_funcs.rst Display information for a given port's RX/TX descriptor status:: · line 272

Quoted 2 lines
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2 -0
+
+Display the number of ready descriptors on a given RX queue::

Can you please describe more, what is "ready descriptor"?

The 'rte_eth_rx_queue_count()' API should be returning number of descriptors filled by HW.

I took a stab at this in v2, but maybe it could be expanded more.

As I understand it, the returned descriptor count should correspond to the number of packets that could be received in the next call to the burst receive function... not necessarily the hardware-specific notion of a descriptor, which might include descriptors used for chained mbufs, LRO metadata, async status messages from firmware, etc.

Thanks,

Lance

#3 lore raw

PATCH v2 1/1 app/testpmd: support show Rx queue desc count

In reply to Lance Richardson

Add support for querying the count of ready descriptors on a receive queue in order to allow the rte_eth_dev rx_queue_count() API to be exercised and tested.

---
 app/test-pmd/cmdline.c                      | 83 +++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
 2 files changed, 90 insertions(+)
app/test-pmd/cmdline.c +83 -0
index 59722d268..821dd3d77 100644
@@ -16699,6 +16699,88 @@ cmdline_parse_inst_t cmd_show_rx_tx_desc_status = {
 	},
 };
 
+/* *** display rx queue desc used count *** */
+struct cmd_show_rx_queue_desc_used_count_result {
+	cmdline_fixed_string_t cmd_show;
+	cmdline_fixed_string_t cmd_port;
+	cmdline_fixed_string_t cmd_rxq;
+	cmdline_fixed_string_t cmd_desc;
+	cmdline_fixed_string_t cmd_used;
+	cmdline_fixed_string_t cmd_count;
+	portid_t cmd_pid;
+	portid_t cmd_qid;
+};
+
+static void
+cmd_show_rx_queue_desc_used_count_parsed(void *parsed_result,
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
+{
+	struct cmd_show_rx_queue_desc_used_count_result *res = parsed_result;
+	int rc;
+
+	if (!rte_eth_dev_is_valid_port(res->cmd_pid)) {
+		printf("invalid port id %u\n", res->cmd_pid);
+		return;
+	}
+
+	rc = rte_eth_rx_queue_count(res->cmd_pid, res->cmd_qid);
+	if (rc < 0) {
+		printf("Invalid queueid = %d\n", res->cmd_qid);
+		return;
+	}
+	printf("Used desc count = %d\n", rc);
+}
+
+cmdline_parse_token_string_t cmd_show_rx_queue_desc_used_count_show =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_show, "show");
+cmdline_parse_token_string_t cmd_show_rx_queue_desc_used_count_port =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_port, "port");
+cmdline_parse_token_num_t cmd_show_rx_queue_desc_used_count_pid =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_pid, RTE_UINT16);
+cmdline_parse_token_string_t cmd_show_rx_queue_desc_used_count_rxq =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_rxq, "rxq");
+cmdline_parse_token_num_t cmd_show_rx_queue_desc_used_count_qid =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_qid, RTE_UINT16);
+cmdline_parse_token_string_t cmd_show_rx_queue_desc_used_count_desc =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_count, "desc");
+cmdline_parse_token_string_t cmd_show_rx_queue_desc_used_count_used =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_count, "used");
+cmdline_parse_token_string_t cmd_show_rx_queue_desc_used_count_count =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_count, "count");
+cmdline_parse_inst_t cmd_show_rx_queue_count = {
+	.f = cmd_show_rx_queue_desc_used_count_parsed,
+	.data = NULL,
+	.help_str = "show port <port_id> rxq <queue_id> desc used count",
+	.tokens = {
+		(void *)&cmd_show_rx_queue_desc_used_count_show,
+		(void *)&cmd_show_rx_queue_desc_used_count_port,
+		(void *)&cmd_show_rx_queue_desc_used_count_pid,
+		(void *)&cmd_show_rx_queue_desc_used_count_rxq,
+		(void *)&cmd_show_rx_queue_desc_used_count_qid,
+		(void *)&cmd_show_rx_queue_desc_used_count_desc,
+		(void *)&cmd_show_rx_queue_desc_used_count_used,
+		(void *)&cmd_show_rx_queue_desc_used_count_count,
+		NULL,
+	},
+};
+
 /* Common result structure for set port ptypes */
 struct cmd_set_port_ptypes_result {
 	cmdline_fixed_string_t set;
@@ -17098,6 +17180,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_config_tx_metadata_specific,
 	(cmdline_parse_inst_t *)&cmd_show_tx_metadata,
 	(cmdline_parse_inst_t *)&cmd_show_rx_tx_desc_status,
+	(cmdline_parse_inst_t *)&cmd_show_rx_queue_count,
 	(cmdline_parse_inst_t *)&cmd_set_raw,
 	(cmdline_parse_inst_t *)&cmd_show_set_raw,
 	(cmdline_parse_inst_t *)&cmd_show_set_raw_all,
doc/guides/testpmd_app_ug/testpmd_funcs.rst +7 -0
index a45910b81..703dead0c 100644
@@ -266,6 +266,13 @@ Display information for a given port's RX/TX descriptor status::
 
    testpmd> show port (port_id) (rxq|txq) (queue_id) desc (desc_id) status
 
+show rxq desc used count
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Display the number of receive packet descriptors currently filled by hardware
+and ready to be processed by the driver on a given RX queue::
+
+   testpmd> show port (port_id) rxq (queue_id) desc used count
 
 show config
 ~~~~~~~~~~~
Signature · 1 line
2.25.1
#4 lore raw

Re: [dpdk-dev] [PATCH 21.05 v2] app/testpmd: support show Rx queue desc count

Quoted 4 lines · Lance Richardson

Add support for querying the count of ready descriptors on a receive queue in order to allow the rte_eth_dev rx_queue_count() API to be exercised and tested.

Overall looks good to me, but there are slightly different reference to the feature, the commit title mentions from feature as "show Rx queue desc count", the commit log has as "count of ready descriptors",
and the documentation has "rxq desc used count",
what do you think unifying them?

Quoted 1 line

<...>

app/test-pmd/cmdline.c cmdline_parse_inst_t cmd_show_rx_tx_desc_status = { · line 16770

Quoted 3 lines
app/test-pmd/cmdline.c +3 -0
+	.f = cmd_show_rx_queue_desc_used_count_parsed,
+	.data = NULL,
+	.help_str = "show port <port_id> rxq <queue_id> desc used count",

Can you please add the new command to the help, 'cmd_help_long_parsed()' too?

#5 lore raw

PATCH v3 1/1 app/testpmd: display rxq desc used count

In reply to Lance Richardson

Add support for displaying the count of used (filled by hardware but not yet processed by the driver) descriptors on a receive queue in order to allow the rte_eth_dev rx_queue_count() API to be exercised and tested.

---
v3:
- Made terminology more consistent betwen commit log, title, and documentation text.
- Added long help text for new command.

v2:
- Changed command syntax from "show port <> rxq <> count" to "show port <> rxq <> desc used count".
- Expanded description to clarify the meaning of the displayed descriptor count.
- Fixed header line length.

 app/test-pmd/cmdline.c                      | 87 +++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
 2 files changed, 94 insertions(+)
app/test-pmd/cmdline.c +87 -0
index 59722d268..8eb2a48ef 100644
@@ -246,6 +246,10 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"show port (port_id) rxq|txq (queue_id) desc (desc_id) status"
 			"       Show status of rx|tx descriptor.\n\n"
 
+			"show port (port_id) rxq (queue_id) desc used count\n"
+			"    Show current number of filled receive"
+			" packet descriptors.\n\n"
+
 			"show port (port_id) macs|mcast_macs"
 			"       Display list of mac addresses added to port.\n\n"
 
@@ -16699,6 +16703,88 @@ cmdline_parse_inst_t cmd_show_rx_tx_desc_status = {
 	},
 };
 
+/* *** display rx queue desc used count *** */
+struct cmd_show_rx_queue_desc_used_count_result {
+	cmdline_fixed_string_t cmd_show;
+	cmdline_fixed_string_t cmd_port;
+	cmdline_fixed_string_t cmd_rxq;
+	cmdline_fixed_string_t cmd_desc;
+	cmdline_fixed_string_t cmd_used;
+	cmdline_fixed_string_t cmd_count;
+	portid_t cmd_pid;
+	portid_t cmd_qid;
+};
+
+static void
+cmd_show_rx_queue_desc_used_count_parsed(void *parsed_result,
+		__rte_unused struct cmdline *cl,
+		__rte_unused void *data)
+{
+	struct cmd_show_rx_queue_desc_used_count_result *res = parsed_result;
+	int rc;
+
+	if (!rte_eth_dev_is_valid_port(res->cmd_pid)) {
+		printf("invalid port id %u\n", res->cmd_pid);
+		return;
+	}
+
+	rc = rte_eth_rx_queue_count(res->cmd_pid, res->cmd_qid);
+	if (rc < 0) {
+		printf("Invalid queueid = %d\n", res->cmd_qid);
+		return;
+	}
+	printf("Used desc count = %d\n", rc);
+}
+
+cmdline_parse_token_string_t cmd_show_rx_queue_desc_used_count_show =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_show, "show");
+cmdline_parse_token_string_t cmd_show_rx_queue_desc_used_count_port =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_port, "port");
+cmdline_parse_token_num_t cmd_show_rx_queue_desc_used_count_pid =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_pid, RTE_UINT16);
+cmdline_parse_token_string_t cmd_show_rx_queue_desc_used_count_rxq =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_rxq, "rxq");
+cmdline_parse_token_num_t cmd_show_rx_queue_desc_used_count_qid =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_qid, RTE_UINT16);
+cmdline_parse_token_string_t cmd_show_rx_queue_desc_used_count_desc =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_count, "desc");
+cmdline_parse_token_string_t cmd_show_rx_queue_desc_used_count_used =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_count, "used");
+cmdline_parse_token_string_t cmd_show_rx_queue_desc_used_count_count =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_show_rx_queue_desc_used_count_result,
+		 cmd_count, "count");
+cmdline_parse_inst_t cmd_show_rx_queue_desc_used_count = {
+	.f = cmd_show_rx_queue_desc_used_count_parsed,
+	.data = NULL,
+	.help_str = "show port <port_id> rxq <queue_id> desc used count",
+	.tokens = {
+		(void *)&cmd_show_rx_queue_desc_used_count_show,
+		(void *)&cmd_show_rx_queue_desc_used_count_port,
+		(void *)&cmd_show_rx_queue_desc_used_count_pid,
+		(void *)&cmd_show_rx_queue_desc_used_count_rxq,
+		(void *)&cmd_show_rx_queue_desc_used_count_qid,
+		(void *)&cmd_show_rx_queue_desc_used_count_desc,
+		(void *)&cmd_show_rx_queue_desc_used_count_used,
+		(void *)&cmd_show_rx_queue_desc_used_count_count,
+		NULL,
+	},
+};
+
 /* Common result structure for set port ptypes */
 struct cmd_set_port_ptypes_result {
 	cmdline_fixed_string_t set;
@@ -17098,6 +17184,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_config_tx_metadata_specific,
 	(cmdline_parse_inst_t *)&cmd_show_tx_metadata,
 	(cmdline_parse_inst_t *)&cmd_show_rx_tx_desc_status,
+	(cmdline_parse_inst_t *)&cmd_show_rx_queue_desc_used_count,
 	(cmdline_parse_inst_t *)&cmd_set_raw,
 	(cmdline_parse_inst_t *)&cmd_show_set_raw,
 	(cmdline_parse_inst_t *)&cmd_show_set_raw_all,
doc/guides/testpmd_app_ug/testpmd_funcs.rst +7 -0
index a45910b81..703dead0c 100644
@@ -266,6 +266,13 @@ Display information for a given port's RX/TX descriptor status::
 
    testpmd> show port (port_id) (rxq|txq) (queue_id) desc (desc_id) status
 
+show rxq desc used count
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Display the number of receive packet descriptors currently filled by hardware
+and ready to be processed by the driver on a given RX queue::
+
+   testpmd> show port (port_id) rxq (queue_id) desc used count
 
 show config
 ~~~~~~~~~~~
Signature · 1 line
2.25.1
Acked-by on v3 1/1
#6 lore raw

Re: [dpdk-dev] [PATCH 21.05 v3] app/testpmd: display rxq desc used count

Quoted 26 lines

-----Original Message-----
From: Lance Richardson <[email protected]>
Sent: Saturday, February 13, 2021 05:25
To: Li, Xiaoyun <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>
Subject: [PATCH 21.05 v3] app/testpmd: display rxq desc used count

Add support for displaying the count of used (filled by hardware but not yet processed by the driver) descriptors on a receive queue in order to allow the rte_eth_dev rx_queue_count() API to be exercised and tested.

---
v3:
- Made terminology more consistent betwen commit log, title, and documentation text.
- Added long help text for new command.

v2:
- Changed command syntax from "show port <> rxq <> count" to "show port <> rxq <> desc used count".
- Expanded description to clarify the meaning of the displayed descriptor count.
- Fixed header line length.

Quoted 4 lines
 app/test-pmd/cmdline.c                      | 87 +++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
 2 files changed, 94 insertions(+)
Applied
#7 lore raw

Re: [dpdk-dev] [PATCH 21.05 v3] app/testpmd: display rxq desc used count

Quoted 26 lines · Xiaoyun
Quoted 26 lines

-----Original Message-----
From: Lance Richardson <[email protected]>
Sent: Saturday, February 13, 2021 05:25
To: Li, Xiaoyun <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>
Subject: [PATCH 21.05 v3] app/testpmd: display rxq desc used count

Add support for displaying the count of used (filled by hardware but not yet processed by the driver) descriptors on a receive queue in order to allow the rte_eth_dev rx_queue_count() API to be exercised and tested.

---
v3:
- Made terminology more consistent betwen commit log, title, and documentation text.
- Added long help text for new command.

v2:
- Changed command syntax from "show port <> rxq <> count" to "show port <> rxq <> desc used count".
- Expanded description to clarify the meaning of the displayed descriptor count.
- Fixed header line length.

Quoted 7 lines
Quoted 4 lines
  app/test-pmd/cmdline.c                      | 87 +++++++++++++++++++++
  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++
  2 files changed, 94 insertions(+)

Applied to dpdk-next-net/main, thanks.

Added release notes update while merging.