//TREX_PATCH
// fill stats array with fdir rules match count statistics
+// Notice that we read statistics from start to start + len, but we fill the stats are
+// starting from 0 with len values
void
i40e_trex_fdir_stats_get(struct rte_eth_dev *dev, uint32_t *stats, uint32_t start, uint32_t len)
{
p_user_id->set_need_to_send_rx(port);
}
} else {
- std::cerr << __METHOD_NAME__ << i << ":Could not count " << rx_stats[i] << " rx packets, because no mapping was found" << std::endl;
+ std::cerr << __METHOD_NAME__ << i << ":Could not count " << rx_stats[i] << " rx packets, on port "
+ << (uint16_t)port << ", because no mapping was found." << std::endl;
}
}
if (tx_stats[i].get_pkts() != 0) {
p_user_id->set_need_to_send_tx(port);
}
} else {
- std::cerr << __METHOD_NAME__ << i << ":Could not count tx " << tx_pkts << " because no mapping was found" << std::endl;
+ std::cerr << __METHOD_NAME__ << i << ":Could not count " << tx_pkts << " tx packets on port "
+ << (uint16_t)port << ", because no mapping was found." << std::endl;
}
}
}
rte_eth_fdir_stats_get(port_id, hw_stats, start, len);
for (int i = loop_start; i < loop_start + len; i++) {
- if (hw_stats[i] >= prev_stats[i]) {
- stats[i] = (uint64_t)(hw_stats[i] - prev_stats[i]);
+ if (hw_stats[i - min] >= prev_stats[i]) {
+ stats[i] = (uint64_t)(hw_stats[i - min] - prev_stats[i]);
} else {
// Wrap around
- stats[i] = (uint64_t)((hw_stats[i] + ((uint64_t)1 << 32)) - prev_stats[i]);
+ stats[i] = (uint64_t)((hw_stats[i - min] + ((uint64_t)1 << 32)) - prev_stats[i]);
}
- prev_stats[i] = hw_stats[i];
+ prev_stats[i] = hw_stats[i - min];
}
return 0;