[dpdk-dev] examples/vm_power_manager: fix set VF MAC address

Message ID 1516716855-14805-1-git-send-email-david.coyle@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Coyle, David Jan. 23, 2018, 2:14 p.m. UTC
  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")

Signed-off-by: David Coyle <david.coyle@intel.com>
---
 examples/vm_power_manager/main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Comments

Hunt, David Jan. 23, 2018, 2:32 p.m. UTC | #1
Hi David,

On 23/1/2018 2:14 PM, David Coyle wrote:
> 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")
>
> Signed-off-by: David Coyle <david.coyle@intel.com>
> ---
>   examples/vm_power_manager/main.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
> index a50984d..a9f5ad1 100644
> --- a/examples/vm_power_manager/main.c
> +++ b/examples/vm_power_manager/main.c
> @@ -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,

Acked-by: David Hunt <david.hunt@intel.com>
  
Thomas Monjalon Feb. 1, 2018, 12:18 a.m. UTC | #2
23/01/2018 15:32, Hunt, David:
> Hi David,
> 
> On 23/1/2018 2:14 PM, David Coyle wrote:
> > 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")
> >
> > Signed-off-by: David Coyle <david.coyle@intel.com>
> 
> Acked-by: David Hunt <david.hunt@intel.com>

Applied, thanks
  

Patch

diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index a50984d..a9f5ad1 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -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,