[v1] examples/vm_power: fix no PCI option for guest cli

Message ID 20191029114013.22803-1-david.hunt@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v1] examples/vm_power: fix no PCI option for guest cli |

Checks

Context Check Description
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/Intel-compilation fail Compilation issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/checkpatch success coding style OK

Commit Message

Hunt, David Oct. 29, 2019, 11:40 a.m. UTC
  If there are no ports available to the guest cli application, it will
exit when setting up the default policy because it fails to set the mac
address. This should not be the case, as this example can be used for
many other use cases that do not need ports.

If ports not found, simply set nb_mac_to_monitor in the policy to zero
and continue.

Fixes: 70febdcfd60f ("examples: check status of getting MAC address")
Signed-off-by: David Hunt <david.hunt@intel.com>
---
 examples/vm_power_manager/guest_cli/vm_power_cli_guest.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Yao, Lei A Oct. 30, 2019, 1:09 a.m. UTC | #1
> -----Original Message-----
> From: Hunt, David <david.hunt@intel.com>
> Sent: Tuesday, October 29, 2019 7:40 PM
> To: dev@dpdk.org
> Cc: Yao, Lei A <lei.a.yao@intel.com>; Hunt, David <david.hunt@intel.com>
> Subject: [PATCH v1] examples/vm_power: fix no PCI option for guest cli
> 
> If there are no ports available to the guest cli application, it will exit when
> setting up the default policy because it fails to set the mac address. This
> should not be the case, as this example can be used for many other use
> cases that do not need ports.
> 
> If ports not found, simply set nb_mac_to_monitor in the policy to zero and
> continue.
> 
> Fixes: 70febdcfd60f ("examples: check status of getting MAC address")
> Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Lei Yao <lei.a.yao@intel.com>
> ---
>  examples/vm_power_manager/guest_cli/vm_power_cli_guest.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
> b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
> index eb0ae9114..96c1a1ff6 100644
> --- a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
> +++ b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
> @@ -79,9 +79,9 @@ set_policy_defaults(struct channel_packet *pkt)
> 
>  	ret = set_policy_mac(0, 0);
>  	if (ret != 0)
> -		return ret;
> -
> -	pkt->nb_mac_to_monitor = 1;
> +		pkt->nb_mac_to_monitor = 0;
> +	else
> +		pkt->nb_mac_to_monitor = 1;
> 
>  	pkt->t_boost_status.tbEnabled = false;
> 
> --
> 2.17.1
  
Thomas Monjalon Nov. 12, 2019, 7:29 a.m. UTC | #2
30/10/2019 02:09, Yao, Lei A:
> From: Hunt, David <david.hunt@intel.com>
> > 
> > If there are no ports available to the guest cli application, it will exit when
> > setting up the default policy because it fails to set the mac address. This
> > should not be the case, as this example can be used for many other use
> > cases that do not need ports.
> > 
> > If ports not found, simply set nb_mac_to_monitor in the policy to zero and
> > continue.
> > 
> > Fixes: 70febdcfd60f ("examples: check status of getting MAC address")
> > Signed-off-by: David Hunt <david.hunt@intel.com>
> Acked-by: Lei Yao <lei.a.yao@intel.com>

Applied, thanks
  

Patch

diff --git a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
index eb0ae9114..96c1a1ff6 100644
--- a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
+++ b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
@@ -79,9 +79,9 @@  set_policy_defaults(struct channel_packet *pkt)
 
 	ret = set_policy_mac(0, 0);
 	if (ret != 0)
-		return ret;
-
-	pkt->nb_mac_to_monitor = 1;
+		pkt->nb_mac_to_monitor = 0;
+	else
+		pkt->nb_mac_to_monitor = 1;
 
 	pkt->t_boost_status.tbEnabled = false;