/** Port Queue Mapping Structure */
struct bond_rx_queue {
uint16_t queue_id;
+ /**< Next active_slave to poll */
+ uint16_t active_slave;
/**< Queue Id */
struct bond_dev_private *dev_private;
/**< Reference to eth_dev private structure */
uint16_t nb_rx_queues; /**< Total number of rx queues */
uint16_t nb_tx_queues; /**< Total number of tx queues*/
- uint16_t active_slave; /**< Next active_slave to poll */
uint16_t active_slave_count; /**< Number of active slaves */
uint16_t active_slaves[RTE_MAX_ETHPORTS]; /**< Active slave list */
RTE_ASSERT(active_count < RTE_DIM(internals->active_slaves));
internals->active_slave_count = active_count;
- /* Resetting active_slave when reaches to max
- * no of slaves in active list
- */
- if (internals->active_slave >= active_count)
- internals->active_slave = 0;
-
if (eth_dev->data->dev_started) {
if (internals->mode == BONDING_MODE_8023AD) {
bond_mode_8023ad_start(eth_dev);
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;
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;
}
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++) {
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;
}