net/bonding: fix Rx queue conversion
[dpdk.git] / drivers / net / bonding / rte_eth_bond_pmd.c
index a9ed5d8..1c404b2 100644 (file)
@@ -69,7 +69,7 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
        struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue;
        internals = bd_rx_q->dev_private;
        slave_count = internals->active_slave_count;
-       active_slave = internals->active_slave;
+       active_slave = bd_rx_q->active_slave;
 
        for (i = 0; i < slave_count && nb_pkts; i++) {
                uint16_t num_rx_slave;
@@ -86,8 +86,8 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
                        active_slave = 0;
        }
 
-       if (++internals->active_slave >= slave_count)
-               internals->active_slave = 0;
+       if (++bd_rx_q->active_slave >= slave_count)
+               bd_rx_q->active_slave = 0;
        return num_rx_total;
 }
 
@@ -303,9 +303,9 @@ rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,
        memcpy(slaves, internals->active_slaves,
                        sizeof(internals->active_slaves[0]) * slave_count);
 
-       idx = internals->active_slave;
+       idx = bd_rx_q->active_slave;
        if (idx >= slave_count) {
-               internals->active_slave = 0;
+               bd_rx_q->active_slave = 0;
                idx = 0;
        }
        for (i = 0; i < slave_count && num_rx_total < nb_pkts; i++) {
@@ -367,8 +367,8 @@ rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,
                        idx = 0;
        }
 
-       if (++internals->active_slave >= slave_count)
-               internals->active_slave = 0;
+       if (++bd_rx_q->active_slave >= slave_count)
+               bd_rx_q->active_slave = 0;
 
        return num_rx_total;
 }
@@ -534,8 +534,8 @@ mode6_debug(const char __rte_unused *info,
 static uint16_t
 bond_ethdev_rx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 {
-       struct bond_tx_queue *bd_tx_q = (struct bond_tx_queue *)queue;
-       struct bond_dev_private *internals = bd_tx_q->dev_private;
+       struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue;
+       struct bond_dev_private *internals = bd_rx_q->dev_private;
        struct rte_ether_hdr *eth_h;
        uint16_t ether_type, offset;
        uint16_t nb_recv_pkts;
@@ -3209,7 +3209,6 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
        }
 
        internals = eth_dev->data->dev_private;
-       eth_dev->data->dev_flags |= RTE_ETH_DEV_CLOSE_REMOVE;
        eth_dev->data->nb_rx_queues = (uint16_t)1;
        eth_dev->data->nb_tx_queues = (uint16_t)1;