DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org,
	"Nicolás Pernas Maradei" <nicolas.pernas.maradei@emutex.com>
Subject: Re: [dpdk-dev] [PATCH v2 2/3] ring: remove duplicate fields in internal data struct
Date: Tue, 23 Feb 2016 16:06:02 +0000	[thread overview]
Message-ID: <20160223160602.GA17720@bricha3-MOBL3> (raw)
In-Reply-To: <56CC81BA.10303@intel.com>

On Tue, Feb 23, 2016 at 03:58:50PM +0000, Ferruh Yigit wrote:
> On 2/23/2016 3:26 PM, Bruce Richardson wrote:
> > On Thu, Feb 18, 2016 at 11:26:42AM +0000, Ferruh Yigit wrote:
> >> 1- Remove duplicate nb_rx/tx_queues fields from internals
> >>
> >> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> >> ---
> >>  drivers/net/ring/rte_eth_ring.c | 57 ++++++++++++++++++-----------------------
> >>  1 file changed, 25 insertions(+), 32 deletions(-)
> >>
> >> diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
> >> index d92b088..fd87999 100644
> >> --- a/drivers/net/ring/rte_eth_ring.c
> >> +++ b/drivers/net/ring/rte_eth_ring.c
> >> @@ -59,9 +59,6 @@ struct ring_queue {
> >>  };
> >>  
> >>  struct pmd_internals {
> >> -	unsigned nb_rx_queues;
> >> -	unsigned nb_tx_queues;
> >> -
> >>  	struct ring_queue rx_ring_queues[RTE_PMD_RING_MAX_RX_RINGS];
> >>  	struct ring_queue tx_ring_queues[RTE_PMD_RING_MAX_TX_RINGS];
> >>  
> >> @@ -138,7 +135,7 @@ eth_dev_set_link_up(struct rte_eth_dev *dev)
> >>  }
> >>  
> >>  static int
> >> -eth_rx_queue_setup(struct rte_eth_dev *dev,uint16_t rx_queue_id,
> >> +eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
> >>  				    uint16_t nb_rx_desc __rte_unused,
> >>  				    unsigned int socket_id __rte_unused,
> >>  				    const struct rte_eth_rxconf *rx_conf __rte_unused,
> >> @@ -165,40 +162,39 @@ static void
> >>  eth_dev_info(struct rte_eth_dev *dev,
> >>  		struct rte_eth_dev_info *dev_info)
> >>  {
> >> -	struct pmd_internals *internals = dev->data->dev_private;
> >>  	dev_info->driver_name = drivername;
> >>  	dev_info->max_mac_addrs = 1;
> >>  	dev_info->max_rx_pktlen = (uint32_t)-1;
> >> -	dev_info->max_rx_queues = (uint16_t)internals->nb_rx_queues;
> >> -	dev_info->max_tx_queues = (uint16_t)internals->nb_tx_queues;
> >> +	dev_info->max_rx_queues = dev->data->nb_rx_queues;
> >> +	dev_info->max_tx_queues = dev->data->nb_tx_queues;
> > 
> > I'm still not convined this is correct. What happens if a ring PMD is created
> > with 16 queues (i.e. backed by 16 rings), and then the user uses
> > rte_eth_dev_configure to only actually use 4 queues.
> 
> Right, since user explicitly set 4 queues.
> 
> > The fact that the internal
> > array still has 16 queues will be lost, 
> 
> Not lost exactly, app can re-configure with rte_eth_dev_configure() to
> use 16 queses back and it will work fine.
> 
No, it can't do that, because the vNIC is reporting that the max number of queues
supported is now 4, since you now set max_rx_queues = nb_rx_queues.

> > and the device will only ever report
> > 4 as the max number it can support.
> 
> I think this is same for all PMDs, and data->nb_xx_queues reports the
> number of the configured queues, not max number; and indeed for ring PMD
> max queue number is hardcoded in the config file.
Yes, it is consistent with other PMDs as it is. The variables you think are
duplicate and want to remove are the ones that track the max number of queues
to be reported out, so that the app can know how many it can use in a call
to reconfigure.

/Bruce
> 
> I guess you what you refer is "number of queues used in first
> configuration", is there a use case to save this value? And if there is
> does it make sense to application save it instead of PMD, because for
> your sample case application creates ring with rte_eth_from_ring() API,
> so app already knows the initial configured queue number.
> 
> Thanks,
> ferruh

  reply	other threads:[~2016-02-23 16:06 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29 17:16 [dpdk-dev] [PATCH 0/3] clean-up on virtual PMDs Ferruh Yigit
2016-01-29 17:16 ` [dpdk-dev] [PATCH 1/3] pcap: remove duplicate fields in internal data struct Ferruh Yigit
2016-01-29 17:16 ` [dpdk-dev] [PATCH 2/3] ring: " Ferruh Yigit
2016-02-17 17:36   ` Bruce Richardson
2016-02-18  9:50     ` Ferruh Yigit
2016-01-29 17:16 ` [dpdk-dev] [PATCH 3/3] null: " Ferruh Yigit
2016-02-03  6:21   ` Tetsuya Mukawa
2016-02-18 11:26 ` [dpdk-dev] [PATCH v2 0/3] clean-up on virtual PMDs Ferruh Yigit
2016-02-18 11:26   ` [dpdk-dev] [PATCH v2 1/3] pcap: remove duplicate fields in internal data struct Ferruh Yigit
2016-02-22  9:54     ` Nicolas Pernas Maradei
2016-02-18 11:26   ` [dpdk-dev] [PATCH v2 2/3] ring: " Ferruh Yigit
2016-02-22  9:55     ` Nicolas Pernas Maradei
2016-02-23 15:26     ` Bruce Richardson
2016-02-23 15:58       ` Ferruh Yigit
2016-02-23 16:06         ` Bruce Richardson [this message]
2016-02-18 11:26   ` [dpdk-dev] [PATCH v2 3/3] null: " Ferruh Yigit
2016-02-22  9:56     ` Nicolas Pernas Maradei
2016-02-26 15:26   ` [dpdk-dev] [PATCH v3 0/3] clean-up on virtual PMDs Ferruh Yigit
2016-02-26 15:26     ` [dpdk-dev] [PATCH v3 1/3] pcap: remove duplicate fields in internal data struct Ferruh Yigit
2016-02-26 15:26     ` [dpdk-dev] [PATCH v3 2/3] ring: rename " Ferruh Yigit
2016-02-26 16:35       ` Bruce Richardson
2016-02-26 15:26     ` [dpdk-dev] [PATCH v3 3/3] null: remove duplicate " Ferruh Yigit
2016-02-26 16:58     ` [dpdk-dev] [PATCH v4 0/3] clean-up on virtual PMDs Ferruh Yigit
2016-02-26 16:58       ` [dpdk-dev] [PATCH v4 1/3] pcap: remove duplicate fields in internal data struct Ferruh Yigit
2016-02-26 16:58       ` [dpdk-dev] [PATCH v4 2/3] ring: variable rename and code cleanup Ferruh Yigit
2016-03-10 11:11         ` Bruce Richardson
2016-02-26 16:58       ` [dpdk-dev] [PATCH v4 3/3] null: remove duplicate fields in internal data struct Ferruh Yigit
2016-03-10 11:12       ` [dpdk-dev] [PATCH v4 0/3] clean-up on virtual PMDs Bruce Richardson

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=20160223160602.GA17720@bricha3-MOBL3 \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=nicolas.pernas.maradei@emutex.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).