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 2B992A0547; Fri, 12 Feb 2021 15:56:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B84F222A2A2; Fri, 12 Feb 2021 15:56:55 +0100 (CET) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mails.dpdk.org (Postfix) with ESMTP id 79D7F22A296 for ; Fri, 12 Feb 2021 15:56:54 +0100 (CET) Received: by mail-pg1-f174.google.com with SMTP id o21so6397350pgn.12 for ; Fri, 12 Feb 2021 06:56:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=C6yBwhBoky9Vha3z6c8uvj5dKwCslsKvI3ow3ml+0F4=; b=cYWXjWNk+EWBv+n1/sI2S7bS8EWha1jG7Og6Q6Cdqs6TjfV4ISxJJQQJZzC6M9jYo6 kaYqwN1GDCJjflqZB6V1fS0+R0N5Qrh/boC3zWMwimzrNOqT2VK7E3xMHF9gNnMhdByZ T0TL+ATTKnfEdm6eUEklxh5g/qYrXMdMF8Lc4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version; bh=C6yBwhBoky9Vha3z6c8uvj5dKwCslsKvI3ow3ml+0F4=; b=c7C4hSOoPaLe6aFnNtHIqXLkUaeIzEjf+5Cw14a3VipGXVp5lYK7i2O5AxDsVZdtAi UxwHfiibuUMPbptsTEjnK3DzuvXBddYEMklWO1Oy5VDPtq/Z/UTcMK3OxGsQzzRIPNtE Q5dWsofAZwwdWRL14UsatG+yf7hn5d94LqbyxmGh6Nv90MOB6ztYuG2Xk9WpG8PUpSHC wVtVo8pz+yziL78t/YXniBjh6/oaUydR8xpK3WGxWHy+OIsIglIS9GDj3IX6iqi6h690 5eTv+IIi2L2MJpC1GS2glJyZezExoIAh00ennIQ072h0BzwRcAuQRmmbfBWwIjKjpEf/ 8gGQ== X-Gm-Message-State: AOAM530m/eEFIkEFRruHcj+4BcGZX212mSTwya6MNDXB3GP6nxP4A3WM SWHFcV9hlqaBUnh856eEv6PkPw== X-Google-Smtp-Source: ABdhPJx1qmEdoTYT6/uWhPD0h+NnjJ4TYMl+7g7n2XBnzSts55BJh5Ut44FIrU6AVezYpSNTkOIDZw== X-Received: by 2002:a63:4346:: with SMTP id q67mr3450626pga.223.1613141810888; Fri, 12 Feb 2021 06:56:50 -0800 (PST) Received: from localhost.localdomain ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id m5sm9358807pgj.11.2021.02.12.06.56.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Feb 2021 06:56:50 -0800 (PST) From: Lance Richardson To: Xiaoyun Li Cc: dev@dpdk.org, ferruh.yigit@intel.com Date: Fri, 12 Feb 2021 09:56:37 -0500 Message-Id: <20210212145637.195181-1-lance.richardson@broadcom.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211194434.172212-1-lance.richardson@broadcom.com> References: <20210211194434.172212-1-lance.richardson@broadcom.com> MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000c97fe305bb24d839" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-dev] [PATCH 21.05 v2] app/testpmd: support show Rx queue desc 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" --000000000000c97fe305bb24d839 Content-Transfer-Encoding: 8bit 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. Signed-off-by: Lance Richardson --- app/test-pmd/cmdline.c | 83 +++++++++++++++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 7 ++ 2 files changed, 90 insertions(+) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 59722d268..821dd3d77 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -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 rxq 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, diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index a45910b81..703dead0c 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -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 ~~~~~~~~~~~ -- 2.25.1 --000000000000c97fe305bb24d839--