DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Iremonger, Bernard" <bernard.iremonger@intel.com>
To: "Yigit, Ferruh" <ferruh.yigit@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Iremonger, Bernard" <bernard.iremonger@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2] app/testpmd: fix log of start command
Date: Tue, 22 May 2018 09:06:02 +0000	[thread overview]
Message-ID: <8CEF83825BEC744B83065625E567D7C24E0CF1C7@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <ce448bc1-ee4d-0d81-c0ac-2ac3ce000390@intel.com>

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Monday, May 21, 2018 3:16 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org
> Subject: Re: [PATCH v2] app/testpmd: fix log of start command
> 
> 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 <bernard.iremonger@intel.com>
> > ---
> >  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
> port->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?

I don't think this fix is breaking any logic, as the nb_rx_desc[qi] and nb_tx_desc[qi] values are not being updated until after the rx and tx queues have been configured using the original values.
The nb_rxd and nb_txd values assigned to nb_rx_desc[qi] and nb_tx_desc[qi]  are initialised to 0 but can be initialised to other vallues  from the command line.

I will investigate using the updated values in the print only to avoid any risk.

Regards,

Bernard.




  reply	other threads:[~2018-05-22  9:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15 16:24 [dpdk-dev] [PATCH] app/test-pmd: fix testpmd " Bernard Iremonger
2018-05-18 11:52 ` Ferruh Yigit
2018-05-21 13:28 ` [dpdk-dev] [PATCH v2] app/testpmd: fix " Bernard Iremonger
2018-05-21 14:15   ` Ferruh Yigit
2018-05-22  9:06     ` Iremonger, Bernard [this message]
2018-05-22 10:22   ` [dpdk-dev] [PATCH v3] " Bernard Iremonger
2018-05-22 10:35     ` Ferruh Yigit
2018-05-22 10:46       ` Iremonger, Bernard
2018-05-22 15:10     ` [dpdk-dev] [PATCH v4] " Bernard Iremonger
2018-05-22 16:31       ` Ferruh Yigit
2018-05-22 16:42         ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8CEF83825BEC744B83065625E567D7C24E0CF1C7@IRSMSX108.ger.corp.intel.com \
    --to=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).