bonding: use existing enslaved device queues
[dpdk.git] / drivers / net / bonding / rte_eth_bond_pmd.c
index 8961a67..fb26d35 100644 (file)
@@ -1305,6 +1305,8 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
        struct bond_rx_queue *bd_rx_q;
        struct bond_tx_queue *bd_tx_q;
 
+       uint16_t old_nb_tx_queues = slave_eth_dev->data->nb_tx_queues;
+       uint16_t old_nb_rx_queues = slave_eth_dev->data->nb_rx_queues;
        int errval;
        uint16_t q_id;
 
@@ -1345,7 +1347,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 = old_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,
@@ -1361,7 +1365,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 = old_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,