From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9EB79A0547; Fri, 12 Feb 2021 12:51:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D83922A24E; Fri, 12 Feb 2021 12:51:56 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 4D71122A23C for ; Fri, 12 Feb 2021 12:51:52 +0100 (CET) IronPort-SDR: hIB5/ns02FTT4fLiKNX7RDsl401ICwePukZuV23l41G3V4DQnGpU7Ls86uTeWMrX+ak0EbQdiF 0mRZIZSqbxfw== X-IronPort-AV: E=McAfee;i="6000,8403,9892"; a="161542131" X-IronPort-AV: E=Sophos;i="5.81,173,1610438400"; d="scan'208";a="161542131" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2021 03:51:51 -0800 IronPort-SDR: XFN/JXL+C/2TLFO5FyYIbiL1Wv4RERss0oePZA1O1bzDzuKxu1bjXEuVrXKg+OoO5Os6xHZ1zH RmkWZXHPm/wg== X-IronPort-AV: E=Sophos;i="5.81,173,1610438400"; d="scan'208";a="437557831" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.252.3.39]) ([10.252.3.39]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2021 03:51:50 -0800 To: Lance Richardson , Xiaoyun Li Cc: dev@dpdk.org References: <20210211194434.172212-1-lance.richardson@broadcom.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <8e2ba062-eba4-e7f9-cfd7-888e41a16183@intel.com> Date: Fri, 12 Feb 2021 11:51:47 +0000 MIME-Version: 1.0 In-Reply-To: <20210211194434.172212-1-lance.richardson@broadcom.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 21.05] app/testpmd: support show Rx queue count 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" On 2/11/2021 7:44 PM, Lance Richardson wrote: > 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. > Signed-off-by: Lance Richardson > --- > app/test-pmd/cmdline.c | 65 +++++++++++++++++++++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 6 ++ > 2 files changed, 71 insertions(+) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index 59722d268..6e2fe57a6 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -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 rxq count", There is already an existing command: "show port rxq|txq desc status" What do you think adding the new one as something like: "show port rxq desc used 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, > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index a45910b81..789ee7d27 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -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 > + > +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. > + > + testpmd> show port (port_id) rxq (queue_id) count > > show config > ~~~~~~~~~~~ >