DPDK patches and discussions
 help / color / mirror / Atom feed
From: Declan Doherty <declan.doherty@intel.com>
To: dev@dpdk.org
Cc: Declan Doherty <declan.doherty@intel.com>
Subject: [dpdk-dev] [PATCH v3 1/4] net/bond: calculate number of bonding tx/rx queues
Date: Tue,  4 Jul 2017 17:46:24 +0100	[thread overview]
Message-ID: <20170704164627.324-2-declan.doherty@intel.com> (raw)
In-Reply-To: <20170704164627.324-1-declan.doherty@intel.com>

Fixes: 2efb58cb ("bond: new link bonding library")

This patch fixes the maximum number of tx an rx queues supported by a
bonding device return by the rte_eth_dev_info_get function. The bonding
device now calculates the maximum number of supported tx and rx queues
based on the slaves bound to the bonded device, with the minimum values
of tx and rx queues from the device slaves being the bonded devices
maximum, as each slave must be able to support the same number of tx
and rx queues.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index dccc016..f428e96 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1691,6 +1691,8 @@ static void
 bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
 	struct bond_dev_private *internals = dev->data->dev_private;
+	uint16_t max_nb_rx_queues = UINT16_MAX;
+	uint16_t max_nb_tx_queues = UINT16_MAX;
 
 	dev_info->max_mac_addrs = 1;
 
@@ -1698,8 +1700,29 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 				  ? internals->candidate_max_rx_pktlen
 				  : ETHER_MAX_JUMBO_FRAME_LEN;
 
-	dev_info->max_rx_queues = (uint16_t)128;
-	dev_info->max_tx_queues = (uint16_t)512;
+	if (internals->slave_count > 0) {
+		/* Max number of tx/rx queues that the bonded device can
+		 * support is the minimum values of the bonded slaves, as
+		 * all slaves must be capable of supporting the same number
+		 * of tx/rx queues.
+		 */
+		struct rte_eth_dev_info slave_info;
+		uint8_t idx;
+
+		for (idx = 0; idx < internals->slave_count; idx++) {
+			rte_eth_dev_info_get(internals->slaves[idx].port_id,
+					&slave_info);
+
+			if (slave_info.max_rx_queues < max_nb_rx_queues)
+				max_nb_rx_queues = slave_info.max_rx_queues;
+
+			if (slave_info.max_tx_queues < max_nb_tx_queues)
+				max_nb_tx_queues = slave_info.max_tx_queues;
+		}
+	}
+
+	dev_info->max_rx_queues = max_nb_rx_queues;
+	dev_info->max_tx_queues = max_nb_tx_queues;
 
 	dev_info->min_rx_bufsize = 0;
 
-- 
2.9.4

  reply	other threads:[~2017-07-04 16:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-27 11:27 [dpdk-dev] [PATCH 0/2] LACP control packet filtering offload Tomasz Kulasek
2017-05-27 11:27 ` [dpdk-dev] [PATCH 1/2] " Tomasz Kulasek
2017-05-29  8:10   ` Adrien Mazarguil
2017-06-29  9:18   ` Declan Doherty
2017-05-27 11:27 ` [dpdk-dev] [PATCH 2/2] test-pmd: add set bonding slow_queue hw/sw Tomasz Kulasek
2017-06-29 16:20 ` [dpdk-dev] [PATCH v2 0/2] LACP control packet filtering offload Tomasz Kulasek
2017-06-29 16:20   ` [dpdk-dev] [PATCH v2 1/2] " Tomasz Kulasek
2017-06-29 16:20   ` [dpdk-dev] [PATCH v2 2/2] test-pmd: add set bonding slow_queue hw/sw Tomasz Kulasek
2017-07-04 16:46   ` [dpdk-dev] [PATCH v3 0/4] LACP control packet filtering acceleration Declan Doherty
2017-07-04 16:46     ` Declan Doherty [this message]
2017-07-04 16:46     ` [dpdk-dev] [PATCH v3 2/4] net/bond: use ptype flags for LACP rx filtering Declan Doherty
2017-07-04 19:54       ` Declan Doherty
2017-07-04 16:46     ` [dpdk-dev] [PATCH v3 3/4] net/bond: dedicated hw queues for LACP control traffic Declan Doherty
2017-07-04 19:55       ` Declan Doherty
2017-07-05 11:19       ` Ferruh Yigit
2017-07-05 11:33       ` Ferruh Yigit
2017-12-13  8:16       ` linhaifeng
2017-12-13 12:41         ` Kulasek, TomaszX
2017-07-04 16:46     ` [dpdk-dev] [PATCH v3 4/4] app/test-pmd: add cmd for dedicated LACP rx/tx queues Declan Doherty
2017-07-04 19:56       ` Declan Doherty
2017-07-05 11:33       ` Ferruh Yigit
2017-07-05 11:35     ` [dpdk-dev] [PATCH v3 0/4] LACP control packet filtering acceleration 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=20170704164627.324-2-declan.doherty@intel.com \
    --to=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    /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).