power: fix for policy dependency to MAC list

Message ID 20190409095401.16740-1-lukaszx.krakowiak@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series power: fix for policy dependency to MAC list |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS

Commit Message

Lukasz Krakowiak April 9, 2019, 9:54 a.m. UTC
  Removed dependency to mac_list from policies:
* BRANCH_RATIO,
* WORKLOAD,
* TIME
in function update_policy.

Fixes: 1b897991473f ("power: update error handling")

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 examples/vm_power_manager/channel_monitor.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
  

Comments

Hunt, David April 18, 2019, 2:13 p.m. UTC | #1
Hi Lukasz,

On 9/4/2019 10:54 AM, Lukasz Krakowiak wrote:
> Removed dependency to mac_list from policies:
> * BRANCH_RATIO,
> * WORKLOAD,
> * TIME
> in function update_policy.
>
> Fixes: 1b897991473f ("power: update error handling")
>
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---
>   examples/vm_power_manager/channel_monitor.c | 18 +++++++++++++-----
>   1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
> index 74df0fe20..ad1ddde07 100644
> --- a/examples/vm_power_manager/channel_monitor.c
> +++ b/examples/vm_power_manager/channel_monitor.c
> @@ -437,9 +437,12 @@ update_policy(struct channel_packet *pkt)
>   			/* Copy the contents of *pkt into the policy.pkt */
>   			policies[i].pkt = *pkt;
>   			get_pcpu_to_control(&policies[i]);
> -			if (get_pfid(&policies[i]) < 0) {
> -				updated = 1;
> -				break;
> +			/* Check Eth dev only for Traffic policy */
> +			if (policies[i].pkt.policy_to_use == TRAFFIC) {
> +				if (get_pfid(&policies[i]) < 0) {
> +					updated = 1;
> +					break;
> +				}
>   			}
>   			core_share_status(i);
>   			policies[i].enabled = 1;
> @@ -451,8 +454,13 @@ update_policy(struct channel_packet *pkt)
>   			if (policies[i].enabled == 0) {
>   				policies[i].pkt = *pkt;
>   				get_pcpu_to_control(&policies[i]);
> -				if (get_pfid(&policies[i]) < 0)
> -					break;
> +				/* Check Eth dev only for Traffic policy */
> +				if (policies[i].pkt.policy_to_use == TRAFFIC) {
> +					if (get_pfid(&policies[i]) < 0) {
> +						updated = 1;
> +						break;
> +					}
> +				}
>   				core_share_status(i);
>   				policies[i].enabled = 1;
>   				break;


Acked-by: David Hunt <david.hunt@intel.com>
  
Hunt, David April 19, 2019, 9:39 a.m. UTC | #2
On 9/4/2019 10:54 AM, Lukasz Krakowiak wrote:
> Removed dependency to mac_list from policies:
> * BRANCH_RATIO,
> * WORKLOAD,
> * TIME
> in function update_policy.
>
> Fixes: 1b897991473f ("power: update error handling")
>
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---
>   examples/vm_power_manager/channel_monitor.c | 18 +++++++++++++-----
>   1 file changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
> index 74df0fe20..ad1ddde07 100644
> --- a/examples/vm_power_manager/channel_monitor.c
> +++ b/examples/vm_power_manager/channel_monitor.c
> @@ -437,9 +437,12 @@ update_policy(struct channel_packet *pkt)
>   			/* Copy the contents of *pkt into the policy.pkt */
>   			policies[i].pkt = *pkt;
>   			get_pcpu_to_control(&policies[i]);
> -			if (get_pfid(&policies[i]) < 0) {
> -				updated = 1;
> -				break;
> +			/* Check Eth dev only for Traffic policy */
> +			if (policies[i].pkt.policy_to_use == TRAFFIC) {
> +				if (get_pfid(&policies[i]) < 0) {
> +					updated = 1;
> +					break;
> +				}
>   			}
>   			core_share_status(i);
>   			policies[i].enabled = 1;
> @@ -451,8 +454,13 @@ update_policy(struct channel_packet *pkt)
>   			if (policies[i].enabled == 0) {
>   				policies[i].pkt = *pkt;
>   				get_pcpu_to_control(&policies[i]);
> -				if (get_pfid(&policies[i]) < 0)
> -					break;
> +				/* Check Eth dev only for Traffic policy */
> +				if (policies[i].pkt.policy_to_use == TRAFFIC) {
> +					if (get_pfid(&policies[i]) < 0) {
> +						updated = 1;
> +						break;
> +					}
> +				}
>   				core_share_status(i);
>   				policies[i].enabled = 1;
>   				break;


I hope it's OK to add Yufeng's Tested-by. As a new member to the mailing 
list, they've tested the patch, but does not have the original email to 
reply to.

Tested-by: Yufeng Mo <yufengx.mo@intel.com>
  
Thomas Monjalon April 22, 2019, 8:05 p.m. UTC | #3
> > Removed dependency to mac_list from policies:
> > * BRANCH_RATIO,
> > * WORKLOAD,
> > * TIME
> > in function update_policy.
> >
> > Fixes: 1b897991473f ("power: update error handling")
> >
> > Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> 
> Acked-by: David Hunt <david.hunt@intel.com>

Applied, thanks
  

Patch

diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
index 74df0fe20..ad1ddde07 100644
--- a/examples/vm_power_manager/channel_monitor.c
+++ b/examples/vm_power_manager/channel_monitor.c
@@ -437,9 +437,12 @@  update_policy(struct channel_packet *pkt)
 			/* Copy the contents of *pkt into the policy.pkt */
 			policies[i].pkt = *pkt;
 			get_pcpu_to_control(&policies[i]);
-			if (get_pfid(&policies[i]) < 0) {
-				updated = 1;
-				break;
+			/* Check Eth dev only for Traffic policy */
+			if (policies[i].pkt.policy_to_use == TRAFFIC) {
+				if (get_pfid(&policies[i]) < 0) {
+					updated = 1;
+					break;
+				}
 			}
 			core_share_status(i);
 			policies[i].enabled = 1;
@@ -451,8 +454,13 @@  update_policy(struct channel_packet *pkt)
 			if (policies[i].enabled == 0) {
 				policies[i].pkt = *pkt;
 				get_pcpu_to_control(&policies[i]);
-				if (get_pfid(&policies[i]) < 0)
-					break;
+				/* Check Eth dev only for Traffic policy */
+				if (policies[i].pkt.policy_to_use == TRAFFIC) {
+					if (get_pfid(&policies[i]) < 0) {
+						updated = 1;
+						break;
+					}
+				}
 				core_share_status(i);
 				policies[i].enabled = 1;
 				break;