power: update for handling fifo path string

Message ID 20190403115251.10768-1-lukaszx.krakowiak@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series power: update for handling fifo path string |

Checks

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

Commit Message

Lukasz Krakowiak April 3, 2019, 11:52 a.m. UTC
  Removed doubled created fifo path string for channel info.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 examples/vm_power_manager/channel_manager.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
  

Comments

Hunt, David April 15, 2019, 3:50 p.m. UTC | #1
Hi Lukasz,

On 15/4/2019 11:01 AM, Lukasz Gosiewski wrote:
> From: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
>
> Removed doubled created fifo path string for channel info.
>
> ---
> v3:
> *improvement to coding style
>
> v2:
> * rebase to master changes
>
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> Signed-off-by: Lukasz Gosiewski <lukaszx.gosiewski@intel.com>
> ---
>   examples/vm_power_manager/channel_manager.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
> index 0187f79ab..05c0eea44 100644
> --- a/examples/vm_power_manager/channel_manager.c
> +++ b/examples/vm_power_manager/channel_manager.c
> @@ -24,6 +24,7 @@
>   #include <rte_log.h>
>   #include <rte_atomic.h>
>   #include <rte_spinlock.h>
> +#include <rte_string_fns.h>
>   
>   #include <libvirt/libvirt.h>
>   
> @@ -362,8 +363,6 @@ setup_host_channel_info(struct channel_info **chan_info_dptr,
>   	chan_info->status = CHANNEL_MGR_CHANNEL_DISCONNECTED;
>   	chan_info->type = CHANNEL_TYPE_JSON;
>   
> -	fifo_path(chan_info->channel_path, sizeof(chan_info->channel_path));
> -
>   	if (open_host_channel(chan_info) < 0) {
>   		RTE_LOG(ERR, CHANNEL_MANAGER, "Could not open host channel: "
>   				"'%s'\n",
> @@ -563,8 +562,8 @@ add_host_channel(void)
>   				"channel '%s'\n", socket_path);
>   		return 0;
>   	}
> -	strlcpy(chan_info->channel_path, socket_path,
> -		sizeof(chan_info->channel_path));
> +	rte_strlcpy(chan_info->channel_path, socket_path, UNIX_PATH_MAX);
> +
>   	if (setup_host_channel_info(&chan_info, 0) < 0) {
>   		rte_free(chan_info);
>   		return 0;


I'm not seeing this patch in patchwork, I'm seeing the original v1 from 
Lukasz K. Can you try re-sending to mailing list? If it's not in 
patchwork, it won't get applied.

Rgds,
Dave.
  
Hunt, David April 16, 2019, 8:16 a.m. UTC | #2
Hi Lukasz, 

-----Original Message-----
From: Gosiewski, LukaszX 
Sent: Tuesday, 16 April, 2019 8:03 AM
To: Hunt, David <david.hunt@intel.com>
Cc: dev@dpdk.org; Krakowiak, LukaszX <lukaszx.krakowiak@intel.com>; Gosiewski, LukaszX <lukaszx.gosiewski@intel.com>
Subject: [PATCH v3] power: update for handling fifo path string

From: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>

Removed doubled created fifo path string for channel info.

---
v3:
*improvement to coding style

v2:
* rebase to master changes

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Signed-off-by: Lukasz Gosiewski <lukaszx.gosiewski@intel.com>
---

This patch is still not appearing in patchwork. It may be because the "Signed-off" tags are below the first '---'.
Could you post up as v4?

Rgds,
Dave.
  
Lukasz Krakowiak April 16, 2019, 8:19 a.m. UTC | #3
Hi,

On Friday Lukasz sent patch: [PATCH v2 1/3] power: update for handling fifo path string.
But this was mistake, it should be the one patch, and I suppose this lock the newer versions of this patches.

Lukasz

-----Original Message-----
From: Hunt, David 
Sent: Tuesday, April 16, 2019 10:16 AM
To: Gosiewski, LukaszX <lukaszx.gosiewski@intel.com>
Cc: dev@dpdk.org; Krakowiak, LukaszX <lukaszx.krakowiak@intel.com>
Subject: RE: [PATCH v3] power: update for handling fifo path string

Hi Lukasz, 

-----Original Message-----
From: Gosiewski, LukaszX 
Sent: Tuesday, 16 April, 2019 8:03 AM
To: Hunt, David <david.hunt@intel.com>
Cc: dev@dpdk.org; Krakowiak, LukaszX <lukaszx.krakowiak@intel.com>; Gosiewski, LukaszX <lukaszx.gosiewski@intel.com>
Subject: [PATCH v3] power: update for handling fifo path string

From: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>

Removed doubled created fifo path string for channel info.

---
v3:
*improvement to coding style

v2:
* rebase to master changes

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Signed-off-by: Lukasz Gosiewski <lukaszx.gosiewski@intel.com>
---

This patch is still not appearing in patchwork. It may be because the "Signed-off" tags are below the first '---'.
Could you post up as v4?

Rgds,
Dave.
  
Lukasz Gosiewski April 16, 2019, 8:23 a.m. UTC | #4
Hi, 
Could there be also possibility, that patch is on hold because it's still waiting for moderator approval? 
I got this mail when posting:
" Your mail to 'dev' with the subject

    [PATCH v3] power: update for handling fifo path string

Is being held until the list moderator can review it for approval.

The reason it is being held:

    Post by non-member to a members-only list"

Lukasz

-----Original Message-----
From: Krakowiak, LukaszX 
Sent: Tuesday, April 16, 2019 10:20 AM
To: Hunt, David <david.hunt@intel.com>; Gosiewski, LukaszX <lukaszx.gosiewski@intel.com>
Cc: dev@dpdk.org
Subject: RE: [PATCH v3] power: update for handling fifo path string

Hi,

On Friday Lukasz sent patch: [PATCH v2 1/3] power: update for handling fifo path string.
But this was mistake, it should be the one patch, and I suppose this lock the newer versions of this patches.

Lukasz

-----Original Message-----
From: Hunt, David 
Sent: Tuesday, April 16, 2019 10:16 AM
To: Gosiewski, LukaszX <lukaszx.gosiewski@intel.com>
Cc: dev@dpdk.org; Krakowiak, LukaszX <lukaszx.krakowiak@intel.com>
Subject: RE: [PATCH v3] power: update for handling fifo path string

Hi Lukasz, 

-----Original Message-----
From: Gosiewski, LukaszX 
Sent: Tuesday, 16 April, 2019 8:03 AM
To: Hunt, David <david.hunt@intel.com>
Cc: dev@dpdk.org; Krakowiak, LukaszX <lukaszx.krakowiak@intel.com>; Gosiewski, LukaszX <lukaszx.gosiewski@intel.com>
Subject: [PATCH v3] power: update for handling fifo path string

From: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>

Removed doubled created fifo path string for channel info.

---
v3:
*improvement to coding style

v2:
* rebase to master changes

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Signed-off-by: Lukasz Gosiewski <lukaszx.gosiewski@intel.com>
---

This patch is still not appearing in patchwork. It may be because the "Signed-off" tags are below the first '---'.
Could you post up as v4?

Rgds,
Dave.
  
Ferruh Yigit April 16, 2019, 4:17 p.m. UTC | #5
On 4/16/2019 9:23 AM, Gosiewski, LukaszX wrote:
> Hi, 
> Could there be also possibility, that patch is on hold because it's still waiting for moderator approval? 
> I got this mail when posting:
> " Your mail to 'dev' with the subject
> 
>     [PATCH v3] power: update for handling fifo path string
> 
> Is being held until the list moderator can review it for approval.
> 
> The reason it is being held:
> 
>     Post by non-member to a members-only list"

It was on host because of above reason, you need to subscribe to the mail list.

> 
> Lukasz
> 
> -----Original Message-----
> From: Krakowiak, LukaszX 
> Sent: Tuesday, April 16, 2019 10:20 AM
> To: Hunt, David <david.hunt@intel.com>; Gosiewski, LukaszX <lukaszx.gosiewski@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v3] power: update for handling fifo path string
> 
> Hi,
> 
> On Friday Lukasz sent patch: [PATCH v2 1/3] power: update for handling fifo path string.
> But this was mistake, it should be the one patch, and I suppose this lock the newer versions of this patches.
> 
> Lukasz
> 
> -----Original Message-----
> From: Hunt, David 
> Sent: Tuesday, April 16, 2019 10:16 AM
> To: Gosiewski, LukaszX <lukaszx.gosiewski@intel.com>
> Cc: dev@dpdk.org; Krakowiak, LukaszX <lukaszx.krakowiak@intel.com>
> Subject: RE: [PATCH v3] power: update for handling fifo path string
> 
> Hi Lukasz, 
> 
> -----Original Message-----
> From: Gosiewski, LukaszX 
> Sent: Tuesday, 16 April, 2019 8:03 AM
> To: Hunt, David <david.hunt@intel.com>
> Cc: dev@dpdk.org; Krakowiak, LukaszX <lukaszx.krakowiak@intel.com>; Gosiewski, LukaszX <lukaszx.gosiewski@intel.com>
> Subject: [PATCH v3] power: update for handling fifo path string
> 
> From: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> 
> Removed doubled created fifo path string for channel info.
> 
> ---
> v3:
> *improvement to coding style
> 
> v2:
> * rebase to master changes
> 
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> Signed-off-by: Lukasz Gosiewski <lukaszx.gosiewski@intel.com>
> ---
> 
> This patch is still not appearing in patchwork. It may be because the "Signed-off" tags are below the first '---'.
> Could you post up as v4?
> 
> Rgds,
> Dave.
>
  

Patch

diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
index 09bfa5c0d..f1dd8cbf3 100644
--- a/examples/vm_power_manager/channel_manager.c
+++ b/examples/vm_power_manager/channel_manager.c
@@ -23,6 +23,7 @@ 
 #include <rte_log.h>
 #include <rte_atomic.h>
 #include <rte_spinlock.h>
+#include <rte_string_fns.h>
 
 #include <libvirt/libvirt.h>
 
@@ -361,8 +362,6 @@  setup_host_channel_info(struct channel_info **chan_info_dptr,
 	chan_info->status = CHANNEL_MGR_CHANNEL_DISCONNECTED;
 	chan_info->type = CHANNEL_TYPE_JSON;
 
-	fifo_path(chan_info->channel_path, sizeof(chan_info->channel_path));
-
 	if (open_host_channel(chan_info) < 0) {
 		RTE_LOG(ERR, CHANNEL_MANAGER, "Could not open host channel: "
 				"'%s'\n",
@@ -562,8 +561,8 @@  add_host_channel(void)
 				"channel '%s'\n", socket_path);
 		return 0;
 	}
-	snprintf(chan_info->channel_path,
-			sizeof(chan_info->channel_path), "%s", socket_path);
+	rte_strlcpy(chan_info->channel_path, socket_path, UNIX_PATH_MAX);
+
 	if (setup_host_channel_info(&chan_info, 0) < 0) {
 		rte_free(chan_info);
 		return 0;