examples/vm_power_manager: fix set VF MAC address
authorDavid Coyle <david.coyle@intel.com>
Tue, 23 Jan 2018 14:14:15 +0000 (14:14 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 1 Feb 2018 00:19:35 +0000 (01:19 +0100)
Current code only sets mac address of first VF. Fix code so that it
continues through the loop and sets the mac address of each VF.

Fixes: c9a4779135c9 ("examples/vm_power_mgr: set MAC address of VF")
Cc: stable@dpdk.org
Signed-off-by: David Coyle <david.coyle@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
examples/vm_power_manager/main.c

index ad22b17..8a1e95b 100644 (file)
@@ -290,7 +290,7 @@ main(int argc, char **argv)
        for (portid = 0; portid < nb_ports; portid++) {
                struct ether_addr eth;
                int w, j;
-               int ret = -ENOTSUP;
+               int ret;
 
                if ((enabled_port_mask & (1 << portid)) == 0)
                        continue;
@@ -308,8 +308,7 @@ main(int argc, char **argv)
                for (w = 0; w < MAX_VFS; w++) {
                        eth.addr_bytes[5] = w + 0xf0;
 
-                       if (ret == -ENOTSUP)
-                               ret = rte_pmd_ixgbe_set_vf_mac_addr(portid,
+                       ret = rte_pmd_ixgbe_set_vf_mac_addr(portid,
                                                w, &eth);
                        if (ret == -ENOTSUP)
                                ret = rte_pmd_i40e_set_vf_mac_addr(portid,