From: Ferruh Yigit Subject: Re: [PATCH v2] app/testpmd: fix log of start command Date: Mon, 21 May 2018 15:15:31 +0100 Message-ID: References: <1526401464-4786-1-git-send-email-bernard.iremonger@intel.com> <1526909296-28215-1-git-send-email-bernard.iremonger@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Bernard Iremonger , dev@dpdk.org Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 059A81B1A3 for ; Mon, 21 May 2018 16:15:37 +0200 (CEST) In-Reply-To: <1526909296-28215-1-git-send-email-bernard.iremonger@intel.com> Content-Language: en-US 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 5/21/2018 2:28 PM, Bernard Iremonger wrote: > 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; Hi Bernard, port->nb_rx_desc[qi] and port->nb_tx_desc[qi] are intentionally set to zero, to be able to use PMD provided values, assigning value to them will break that logic. Instead of updating these values, what about using same information on print only?