From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Kinzie Subject: [PATCH v2 1/6] bond: use existing enslaved device queues Date: Fri, 19 Feb 2016 11:17:48 -0800 Message-ID: <1455909473-13539-2-git-send-email-ehkinzie@gmail.com> References: <8CEF83825BEC744B83065625E567D7C219FB2C51@IRSMSX108.ger.corp.intel.com> <1455909473-13539-1-git-send-email-ehkinzie@gmail.com> To: dev@dpdk.org Return-path: Received: from mail-pf0-f176.google.com (mail-pf0-f176.google.com [209.85.192.176]) by dpdk.org (Postfix) with ESMTP id 66C26C56E for ; Sat, 20 Feb 2016 08:39:15 +0100 (CET) Received: by mail-pf0-f176.google.com with SMTP id x65so63779608pfb.1 for ; Fri, 19 Feb 2016 23:39:15 -0800 (PST) In-Reply-To: <1455909473-13539-1-git-send-email-ehkinzie@gmail.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This solves issues when an active device is added to a bond. If a device to be enslaved already has transmit and/or receive queues allocated, use those and then create any additional queues that are necessary. Signed-off-by: Eric Kinzie Signed-off-by: Stephen Hemminger Acked-by: Declan Doherty --- drivers/net/bonding/rte_eth_bond_pmd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index b63c886..2f193db 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1344,7 +1344,9 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, } /* Setup Rx Queues */ - for (q_id = 0; q_id < bonded_eth_dev->data->nb_rx_queues; q_id++) { + /* Use existing queues, if any */ + for (q_id = slave_eth_dev->data->nb_rx_queues; + q_id < bonded_eth_dev->data->nb_rx_queues; q_id++) { bd_rx_q = (struct bond_rx_queue *)bonded_eth_dev->data->rx_queues[q_id]; errval = rte_eth_rx_queue_setup(slave_eth_dev->data->port_id, q_id, @@ -1360,7 +1362,9 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, } /* Setup Tx Queues */ - for (q_id = 0; q_id < bonded_eth_dev->data->nb_tx_queues; q_id++) { + /* Use existing queues, if any */ + for (q_id = slave_eth_dev->data->nb_tx_queues; + q_id < bonded_eth_dev->data->nb_tx_queues; q_id++) { bd_tx_q = (struct bond_tx_queue *)bonded_eth_dev->data->tx_queues[q_id]; errval = rte_eth_tx_queue_setup(slave_eth_dev->data->port_id, q_id, -- 1.7.10.4