patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yuanhan Liu <yliu@fridaylinux.org>
To: Declan Doherty <declan.doherty@intel.com>
Cc: dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/bonding: fix number of bonding Tx/Rx queues' has been queued to LTS release 16.11.3
Date: Sat, 15 Jul 2017 19:17:09 +0800	[thread overview]
Message-ID: <1500117433-28932-3-git-send-email-yliu@fridaylinux.org> (raw)
In-Reply-To: <1500117433-28932-1-git-send-email-yliu@fridaylinux.org>

Hi,

FYI, your patch has been queued to LTS release 16.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/19/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From a553b4971cef88f214485c97868b8231893721e5 Mon Sep 17 00:00:00 2001
From: Declan Doherty <declan.doherty@intel.com>
Date: Tue, 4 Jul 2017 17:46:24 +0100
Subject: [PATCH] net/bonding: fix number of bonding Tx/Rx queues

[ upstream commit acfb51e2fe96c27a042248ee32930cbd78f36cd7 ]

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.

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

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 71316b4..7811a5a 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1667,6 +1667,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;
 
@@ -1674,8 +1676,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;
 	dev_info->pci_dev = NULL;
-- 
2.7.4

  parent reply	other threads:[~2017-07-15 11:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-15 11:17 [dpdk-stable] patch 'net/bonding: change link status check to no-wait' " Yuanhan Liu
2017-07-15 11:17 ` [dpdk-stable] patch 'net/ena: fix cleanup of the Tx bufs' " Yuanhan Liu
2017-07-15 11:17 ` Yuanhan Liu [this message]
2017-07-15 11:17 ` [dpdk-stable] patch 'vhost: fix TCP checksum' " Yuanhan Liu
2017-07-15 11:17 ` [dpdk-stable] patch 'vhost: fix IP " Yuanhan Liu
2017-07-15 11:17 ` [dpdk-stable] patch 'net/virtio: do not falsely claim to do " Yuanhan Liu
2017-07-15 11:17 ` [dpdk-stable] patch 'net/virtio: do not claim to support LRO' " Yuanhan Liu

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=1500117433-28932-3-git-send-email-yliu@fridaylinux.org \
    --to=yliu@fridaylinux.org \
    --cc=declan.doherty@intel.com \
    --cc=stable@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).