uint64_t improvement = 0;
uint32_t num_pmds;
uint32_t *pmd_corelist;
- struct rxq_poll *poll, *poll_next;
+ struct rxq_poll *poll;
bool ret;
num_pmds = cmap_count(&dp->poll_threads);
/* Estimate the cycles to cover all intervals. */
total_cycles *= PMD_RXQ_INTERVAL_MAX;
- HMAP_FOR_EACH_SAFE (poll, poll_next, node, &pmd->poll_list) {
- uint64_t proc_cycles = 0;
+ ovs_mutex_lock(&pmd->port_mutex);
+ HMAP_FOR_EACH (poll, node, &pmd->poll_list) {
for (unsigned i = 0; i < PMD_RXQ_INTERVAL_MAX; i++) {
- proc_cycles += dp_netdev_rxq_get_intrvl_cycles(poll->rxq, i);
+ total_proc += dp_netdev_rxq_get_intrvl_cycles(poll->rxq, i);
}
- total_proc += proc_cycles;
}
+ ovs_mutex_unlock(&pmd->port_mutex);
+
if (total_proc) {
curr_pmd_usage[num_pmds] = (total_proc * 100) / total_cycles;
}