From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Kinzie Subject: [PATCH 1/5] bond: use existing enslaved device queues Date: Mon, 6 Apr 2015 10:01:21 -0700 Message-ID: <1428339685-27686-2-git-send-email-ehkinzie@gmail.com> References: <1428339685-27686-1-git-send-email-ehkinzie@gmail.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1428339685-27686-1-git-send-email-ehkinzie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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 --- lib/librte_pmd_bond/rte_eth_bond_pmd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/librte_pmd_bond/rte_eth_bond_pmd.c b/lib/librte_pmd_bond/rte_eth_bond_pmd.c index c937e6b..4fd7d97 100644 --- a/lib/librte_pmd_bond/rte_eth_bond_pmd.c +++ b/lib/librte_pmd_bond/rte_eth_bond_pmd.c @@ -1318,7 +1318,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, @@ -1334,7 +1336,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