From patchwork Mon May 21 13:28:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Iremonger, Bernard" X-Patchwork-Id: 40278 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EFEC11B1BA; Mon, 21 May 2018 15:28:24 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id D35641B16F for ; Mon, 21 May 2018 15:28:21 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 May 2018 06:28:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,426,1520924400"; d="scan'208";a="201121139" Received: from sivswdev02.ir.intel.com (HELO localhost.localdomain) ([10.237.217.46]) by orsmga004.jf.intel.com with ESMTP; 21 May 2018 06:28:19 -0700 From: Bernard Iremonger To: dev@dpdk.org, ferruh.yigit@intel.com Cc: Bernard Iremonger Date: Mon, 21 May 2018 14:28:16 +0100 Message-Id: <1526909296-28215-1-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1526401464-4786-1-git-send-email-bernard.iremonger@intel.com> References: <1526401464-4786-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH v2] app/testpmd: fix log of start command X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Call the rte_eth_rxq_info_get() and rte_eth_txq_info_get() functions to update the number of rx and tx descriptors in the rte_port variable. Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings") Signed-off-by: Bernard Iremonger --- app/test-pmd/testpmd.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 1d308f0..293b2a5 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1592,6 +1592,9 @@ static void eth_dev_event_callback(char *device_name, struct rte_port *port; struct ether_addr mac_addr; enum rte_eth_event_type event_type; + struct rte_eth_rxq_info rx_qinfo; + struct rte_eth_txq_info tx_qinfo; + int32_t rc; if (port_id_is_invalid(pid, ENABLED_WARN)) return 0; @@ -1706,8 +1709,19 @@ static void eth_dev_event_callback(char *device_name, &(port->rx_conf[qi]), mp); } - if (diag == 0) + if (diag == 0) { + rc = rte_eth_rx_queue_info_get(pi, qi, + &rx_qinfo); + if (!rc) + port->nb_rx_desc[qi] = + rx_qinfo.nb_desc; + rc = rte_eth_tx_queue_info_get(pi, qi, + &tx_qinfo); + if (!rc) + port->nb_tx_desc[qi] = + tx_qinfo.nb_desc; continue; + } /* Fail to setup rx queue, return */ if (rte_atomic16_cmpset(&(port->port_status),