From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id E72ED1B59B; Fri, 22 Mar 2019 11:56:13 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4DD88330246; Fri, 22 Mar 2019 10:56:13 +0000 (UTC) Received: from [10.36.112.59] (ovpn-112-59.ams2.redhat.com [10.36.112.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 28B965D9CC; Fri, 22 Mar 2019 10:56:11 +0000 (UTC) To: Hajkowski , david.hunt@intel.com Cc: dev@dpdk.org, stable@dpdk.org References: <20190321105506.6656-1-marcinx.hajkowski@intel.com> <20190321105506.6656-2-marcinx.hajkowski@intel.com> From: Maxime Coquelin Message-ID: Date: Fri, 22 Mar 2019 11:56:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190321105506.6656-2-marcinx.hajkowski@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 22 Mar 2019 10:56:13 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v3 1/4] power: fix invalid socket indicator value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2019 10:56:14 -0000 On 3/21/19 11:55 AM, Hajkowski wrote: > From: Marcin Hajkowski > > 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 > --- > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A24F9A00E6 for ; Fri, 22 Mar 2019 11:56:16 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 323CB1B5A0; Fri, 22 Mar 2019 11:56:15 +0100 (CET) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id E72ED1B59B; Fri, 22 Mar 2019 11:56:13 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4DD88330246; Fri, 22 Mar 2019 10:56:13 +0000 (UTC) Received: from [10.36.112.59] (ovpn-112-59.ams2.redhat.com [10.36.112.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 28B965D9CC; Fri, 22 Mar 2019 10:56:11 +0000 (UTC) To: Hajkowski , david.hunt@intel.com Cc: dev@dpdk.org, stable@dpdk.org References: <20190321105506.6656-1-marcinx.hajkowski@intel.com> <20190321105506.6656-2-marcinx.hajkowski@intel.com> From: Maxime Coquelin Message-ID: Date: Fri, 22 Mar 2019 11:56:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190321105506.6656-2-marcinx.hajkowski@intel.com> Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 22 Mar 2019 10:56:13 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v3 1/4] power: fix invalid socket indicator value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190322105610.M_bIeogNNOzPSLplj8MLVlXey8T0sAUdswUTnLsHvoQ@z> On 3/21/19 11:55 AM, Hajkowski wrote: > From: Marcin Hajkowski > > 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 > --- > 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