aboutsummaryrefslogtreecommitdiffstats
path: root/examples/vm_power_manager/channel_monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/vm_power_manager/channel_monitor.c')
-rw-r--r--examples/vm_power_manager/channel_monitor.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
index 1c7b6eb2..73bddd99 100644
--- a/examples/vm_power_manager/channel_monitor.c
+++ b/examples/vm_power_manager/channel_monitor.c
@@ -110,12 +110,11 @@ static int
get_pfid(struct policy *pol)
{
- int i, x, ret = 0, nb_ports;
+ int i, x, ret = 0;
- nb_ports = rte_eth_dev_count();
for (i = 0; i < pol->pkt.nb_mac_to_monitor; i++) {
- for (x = 0; x < nb_ports; x++) {
+ RTE_ETH_FOREACH_DEV(x) {
ret = rte_pmd_i40e_query_vfid_by_mac(x,
(struct ether_addr *)&(pol->pkt.vfid[i]));
if (ret != -EINVAL) {