patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v3 1/4] power: fix invalid socket indicator value
       [not found] <20190321105506.6656-1-marcinx.hajkowski@intel.com>
@ 2019-03-21 10:55 ` Hajkowski
  2019-03-22 10:56   ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
  2019-03-27 14:03   ` Burakov, Anatoly
       [not found] ` <20190402082121.5472-1-marcinx.hajkowski@intel.com>
  1 sibling, 2 replies; 4+ messages in thread
From: Hajkowski @ 2019-03-21 10:55 UTC (permalink / raw)
  To: david.hunt; +Cc: dev, Marcin Hajkowski, stable

From: Marcin Hajkowski <marcinx.hajkowski@intel.com>

Currently 0 is being used for not connected slot indication.
This is not consistent with linux doc which identifies 0 as valid
(connected) slot, thus modification was done to change it.

Fixes: cd0d5547 ("power: vm communication channels in guest")
Cc: stable@dpdk.org

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
---
 lib/librte_power/guest_channel.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/librte_power/guest_channel.c b/lib/librte_power/guest_channel.c
index c17ea46b4..9cf7d2cb2 100644
--- a/lib/librte_power/guest_channel.c
+++ b/lib/librte_power/guest_channel.c
@@ -19,7 +19,7 @@
 
 #define RTE_LOGTYPE_GUEST_CHANNEL RTE_LOGTYPE_USER1
 
-static int global_fds[RTE_MAX_LCORE];
+static int global_fds[RTE_MAX_LCORE] = { [0 ... RTE_MAX_LCORE-1] = -1 };
 
 int
 guest_channel_host_connect(const char *path, unsigned int lcore_id)
@@ -35,7 +35,7 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id)
 		return -1;
 	}
 	/* check if path is already open */
-	if (global_fds[lcore_id] != 0) {
+	if (global_fds[lcore_id] != -1) {
 		RTE_LOG(ERR, GUEST_CHANNEL, "Channel(%u) is already open with fd %d\n",
 				lcore_id, global_fds[lcore_id]);
 		return -1;
@@ -84,7 +84,7 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id)
 	return 0;
 error:
 	close(fd);
-	global_fds[lcore_id] = 0;
+	global_fds[lcore_id] = -1;
 	return -1;
 }
 
@@ -100,7 +100,7 @@ guest_channel_send_msg(struct channel_packet *pkt, unsigned int lcore_id)
 		return -1;
 	}
 
-	if (global_fds[lcore_id] == 0) {
+	if (global_fds[lcore_id] < 0) {
 		RTE_LOG(ERR, GUEST_CHANNEL, "Channel is not connected\n");
 		return -1;
 	}
@@ -134,8 +134,8 @@ guest_channel_host_disconnect(unsigned int lcore_id)
 				lcore_id, RTE_MAX_LCORE-1);
 		return;
 	}
-	if (global_fds[lcore_id] == 0)
+	if (global_fds[lcore_id] < 0)
 		return;
 	close(global_fds[lcore_id]);
-	global_fds[lcore_id] = 0;
+	global_fds[lcore_id] = -1;
 }
-- 
2.17.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v3 1/4] power: fix invalid socket indicator value
  2019-03-21 10:55 ` [dpdk-stable] [PATCH v3 1/4] power: fix invalid socket indicator value Hajkowski
@ 2019-03-22 10:56   ` Maxime Coquelin
  2019-03-27 14:03   ` Burakov, Anatoly
  1 sibling, 0 replies; 4+ messages in thread
From: Maxime Coquelin @ 2019-03-22 10:56 UTC (permalink / raw)
  To: Hajkowski, david.hunt; +Cc: dev, stable



On 3/21/19 11:55 AM, Hajkowski wrote:
> From: Marcin Hajkowski <marcinx.hajkowski@intel.com>
> 
> Currently 0 is being used for not connected slot indication.
> This is not consistent with linux doc which identifies 0 as valid
> (connected) slot, thus modification was done to change it.
> 
> Fixes: cd0d5547 ("power: vm communication channels in guest")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
> ---
>   lib/librte_power/guest_channel.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/librte_power/guest_channel.c b/lib/librte_power/guest_channel.c
> index c17ea46b4..9cf7d2cb2 100644
> --- a/lib/librte_power/guest_channel.c
> +++ b/lib/librte_power/guest_channel.c
> @@ -19,7 +19,7 @@
>   
>   #define RTE_LOGTYPE_GUEST_CHANNEL RTE_LOGTYPE_USER1
>   
> -static int global_fds[RTE_MAX_LCORE];
> +static int global_fds[RTE_MAX_LCORE] = { [0 ... RTE_MAX_LCORE-1] = -1 };
>   
>   int
>   guest_channel_host_connect(const char *path, unsigned int lcore_id)
> @@ -35,7 +35,7 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id)
>   		return -1;
>   	}
>   	/* check if path is already open */
> -	if (global_fds[lcore_id] != 0) {
> +	if (global_fds[lcore_id] != -1) {
>   		RTE_LOG(ERR, GUEST_CHANNEL, "Channel(%u) is already open with fd %d\n",
>   				lcore_id, global_fds[lcore_id]);
>   		return -1;
> @@ -84,7 +84,7 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id)
>   	return 0;
>   error:
>   	close(fd);
> -	global_fds[lcore_id] = 0;
> +	global_fds[lcore_id] = -1;
>   	return -1;
>   }
>   
> @@ -100,7 +100,7 @@ guest_channel_send_msg(struct channel_packet *pkt, unsigned int lcore_id)
>   		return -1;
>   	}
>   
> -	if (global_fds[lcore_id] == 0) {
> +	if (global_fds[lcore_id] < 0) {
>   		RTE_LOG(ERR, GUEST_CHANNEL, "Channel is not connected\n");
>   		return -1;
>   	}
> @@ -134,8 +134,8 @@ guest_channel_host_disconnect(unsigned int lcore_id)
>   				lcore_id, RTE_MAX_LCORE-1);
>   		return;
>   	}
> -	if (global_fds[lcore_id] == 0)
> +	if (global_fds[lcore_id] < 0)
>   		return;
>   	close(global_fds[lcore_id]);
> -	global_fds[lcore_id] = 0;
> +	global_fds[lcore_id] = -1;
>   }
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v3 1/4] power: fix invalid socket indicator value
  2019-03-21 10:55 ` [dpdk-stable] [PATCH v3 1/4] power: fix invalid socket indicator value Hajkowski
  2019-03-22 10:56   ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
@ 2019-03-27 14:03   ` Burakov, Anatoly
  1 sibling, 0 replies; 4+ messages in thread
From: Burakov, Anatoly @ 2019-03-27 14:03 UTC (permalink / raw)
  To: Hajkowski, david.hunt; +Cc: dev, stable

On 21-Mar-19 10:55 AM, Hajkowski wrote:
> From: Marcin Hajkowski <marcinx.hajkowski@intel.com>
> 
> Currently 0 is being used for not connected slot indication.
> This is not consistent with linux doc which identifies 0 as valid
> (connected) slot, thus modification was done to change it.
> 
> Fixes: cd0d5547 ("power: vm communication channels in guest")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
> ---
>   lib/librte_power/guest_channel.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/librte_power/guest_channel.c b/lib/librte_power/guest_channel.c
> index c17ea46b4..9cf7d2cb2 100644
> --- a/lib/librte_power/guest_channel.c
> +++ b/lib/librte_power/guest_channel.c

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] [PATCH v4 1/4] power: fix invalid socket indicator value
       [not found] ` <20190402082121.5472-1-marcinx.hajkowski@intel.com>
@ 2019-04-02  8:21   ` Hajkowski
  0 siblings, 0 replies; 4+ messages in thread
From: Hajkowski @ 2019-04-02  8:21 UTC (permalink / raw)
  To: david.hunt; +Cc: dev, Marcin Hajkowski, stable

From: Marcin Hajkowski <marcinx.hajkowski@intel.com>

Currently 0 is being used for not connected slot indication.
This is not consistent with linux doc which identifies 0 as valid
(connected) slot, thus modification was done to change it.

Fixes: cd0d5547 ("power: vm communication channels in guest")
Cc: stable@dpdk.org

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
---
 lib/librte_power/guest_channel.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/librte_power/guest_channel.c b/lib/librte_power/guest_channel.c
index c17ea46b4..9cf7d2cb2 100644
--- a/lib/librte_power/guest_channel.c
+++ b/lib/librte_power/guest_channel.c
@@ -19,7 +19,7 @@
 
 #define RTE_LOGTYPE_GUEST_CHANNEL RTE_LOGTYPE_USER1
 
-static int global_fds[RTE_MAX_LCORE];
+static int global_fds[RTE_MAX_LCORE] = { [0 ... RTE_MAX_LCORE-1] = -1 };
 
 int
 guest_channel_host_connect(const char *path, unsigned int lcore_id)
@@ -35,7 +35,7 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id)
 		return -1;
 	}
 	/* check if path is already open */
-	if (global_fds[lcore_id] != 0) {
+	if (global_fds[lcore_id] != -1) {
 		RTE_LOG(ERR, GUEST_CHANNEL, "Channel(%u) is already open with fd %d\n",
 				lcore_id, global_fds[lcore_id]);
 		return -1;
@@ -84,7 +84,7 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id)
 	return 0;
 error:
 	close(fd);
-	global_fds[lcore_id] = 0;
+	global_fds[lcore_id] = -1;
 	return -1;
 }
 
@@ -100,7 +100,7 @@ guest_channel_send_msg(struct channel_packet *pkt, unsigned int lcore_id)
 		return -1;
 	}
 
-	if (global_fds[lcore_id] == 0) {
+	if (global_fds[lcore_id] < 0) {
 		RTE_LOG(ERR, GUEST_CHANNEL, "Channel is not connected\n");
 		return -1;
 	}
@@ -134,8 +134,8 @@ guest_channel_host_disconnect(unsigned int lcore_id)
 				lcore_id, RTE_MAX_LCORE-1);
 		return;
 	}
-	if (global_fds[lcore_id] == 0)
+	if (global_fds[lcore_id] < 0)
 		return;
 	close(global_fds[lcore_id]);
-	global_fds[lcore_id] = 0;
+	global_fds[lcore_id] = -1;
 }
-- 
2.17.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-02  8:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190321105506.6656-1-marcinx.hajkowski@intel.com>
2019-03-21 10:55 ` [dpdk-stable] [PATCH v3 1/4] power: fix invalid socket indicator value Hajkowski
2019-03-22 10:56   ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
2019-03-27 14:03   ` Burakov, Anatoly
     [not found] ` <20190402082121.5472-1-marcinx.hajkowski@intel.com>
2019-04-02  8:21   ` [dpdk-stable] [PATCH v4 " Hajkowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).