switch (policy) {
case BALANCE_XMIT_POLICY_LAYER2:
internals->balance_xmit_policy = policy;
+ internals->burst_xmit_hash = burst_xmit_l2_hash;
break;
case BALANCE_XMIT_POLICY_LAYER23:
internals->balance_xmit_policy = policy;
+ internals->burst_xmit_hash = burst_xmit_l23_hash;
break;
case BALANCE_XMIT_POLICY_LAYER34:
internals->balance_xmit_policy = policy;
+ internals->burst_xmit_hash = burst_xmit_l34_hash;
break;
default:
hash = ether_hash(eth_hdr);
- slaves[i++] = (hash ^= hash >> 8) % slave_count;
+ slaves[i] = (hash ^= hash >> 8) % slave_count;
}
}
hash ^= hash >> 16;
hash ^= hash >> 8;
- slaves[i++] = hash % slave_count;
+ slaves[i] = hash % slave_count;
}
}
hash ^= hash >> 16;
hash ^= hash >> 8;
- slaves[i++] = hash % slave_count;
+ slaves[i] = hash % slave_count;
}
}
/* Number of mbufs for transmission on each slave */
uint16_t slave_nb_bufs[RTE_MAX_ETHPORTS] = { 0 };
/* Mapping array generated by hash function to map mbufs to slaves */
- uint16_t bufs_slave_port_idxs[RTE_MAX_ETHPORTS] = { 0 };
+ uint16_t bufs_slave_port_idxs[nb_bufs];
uint16_t slave_tx_count, slave_tx_fail_count[RTE_MAX_ETHPORTS] = { 0 };
uint16_t total_tx_count = 0, total_tx_fail_count = 0;