From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id BDA6C4C93 for ; Tue, 19 Mar 2019 16:00:51 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Mar 2019 08:00:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,498,1544515200"; d="scan'208";a="143312194" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by orsmga002.jf.intel.com with ESMTP; 19 Mar 2019 08:00:48 -0700 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX108.ger.corp.intel.com (163.33.3.3) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 19 Mar 2019 15:00:48 +0000 Received: from irsmsx110.ger.corp.intel.com ([169.254.15.102]) by irsmsx155.ger.corp.intel.com ([169.254.14.140]) with mapi id 14.03.0415.000; Tue, 19 Mar 2019 15:00:47 +0000 From: "Pattan, Reshma" To: "Hajkowski, MarcinX" , "Hunt, David" CC: "dev@dpdk.org" , "Hajkowski, MarcinX" Thread-Topic: [dpdk-dev] [PATCH v2 2/4] power: extend guest channel api for reading Thread-Index: AQHU3ZHr+apn4mSY+0O+GJSSCplPWqYS+c5Q Date: Tue, 19 Mar 2019 15:00:47 +0000 Message-ID: <3AEA2BF9852C6F48A459DA490692831F2A42F1B4@irsmsx110.ger.corp.intel.com> References: <20190318134815.14928-1-marcinx.hajkowski@intel.com> <20190318134815.14928-3-marcinx.hajkowski@intel.com> In-Reply-To: <20190318134815.14928-3-marcinx.hajkowski@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjM0YWZlNzAtNGZiMC00OTNhLWEzMWUtNTZkOWI1OTNhYmViIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoib3VkN2JxRWJucFdUXC9yXC9WWWxFUjZtZXljQ1FrXC9tNWNaZTJKNVFick4yc1V6TCtzXC9XMk55RnpTMmNCQlREbHMifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 2/4] power: extend guest channel api for reading 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: Tue, 19 Mar 2019 15:00:52 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Hajkowski > --- > diff --git a/lib/librte_power/channel_commands.h > +#define CPU_POWER_CMD_NAK 2 Instead of NAK , NACK would be better I guess. > + if (global_fds[lcore_id] =3D=3D 0) { Is this now < 0 ? > + ret =3D read(global_fds[lcore_id], > + buffer, buffer_len); > + if (ret < 0) { read() return value 0 also should be handled? > + > +int rte_power_guest_channel_receive_msg(struct channel_packet *pkt, > + unsigned int lcore_id) > +{ > + int ret; > + > + struct pollfd fds; > + fds.fd =3D global_fds[lcore_id]; > + fds.events =3D POLLIN; > + > + ret =3D poll(&fds, 1, TIMEOUT); > + if (ret =3D=3D 0) { > + RTE_LOG(DEBUG, GUEST_CHANNEL, "Timeout occurs during > poll function.\n"); > + return -1; > + } else if (ret < 0) { > + RTE_LOG(ERR, GUEST_CHANNEL, "Error occurred during poll > function: %s\n", > + strerror(ret)); > + return -1; > + } > + You can keep this function simple by moving all the code above code to powe= r_guest_channel_read_msg(), like the way done in rte_power_guest_channel_se= nd_msg() and guest_channel_send_msg(). Thanks, Reshma 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 250F0A00E6 for ; Tue, 19 Mar 2019 16:00:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC1B84C95; Tue, 19 Mar 2019 16:00:52 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id BDA6C4C93 for ; Tue, 19 Mar 2019 16:00:51 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Mar 2019 08:00:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,498,1544515200"; d="scan'208";a="143312194" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by orsmga002.jf.intel.com with ESMTP; 19 Mar 2019 08:00:48 -0700 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX108.ger.corp.intel.com (163.33.3.3) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 19 Mar 2019 15:00:48 +0000 Received: from irsmsx110.ger.corp.intel.com ([169.254.15.102]) by irsmsx155.ger.corp.intel.com ([169.254.14.140]) with mapi id 14.03.0415.000; Tue, 19 Mar 2019 15:00:47 +0000 From: "Pattan, Reshma" To: "Hajkowski, MarcinX" , "Hunt, David" CC: "dev@dpdk.org" , "Hajkowski, MarcinX" Thread-Topic: [dpdk-dev] [PATCH v2 2/4] power: extend guest channel api for reading Thread-Index: AQHU3ZHr+apn4mSY+0O+GJSSCplPWqYS+c5Q Date: Tue, 19 Mar 2019 15:00:47 +0000 Message-ID: <3AEA2BF9852C6F48A459DA490692831F2A42F1B4@irsmsx110.ger.corp.intel.com> References: <20190318134815.14928-1-marcinx.hajkowski@intel.com> <20190318134815.14928-3-marcinx.hajkowski@intel.com> In-Reply-To: <20190318134815.14928-3-marcinx.hajkowski@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjM0YWZlNzAtNGZiMC00OTNhLWEzMWUtNTZkOWI1OTNhYmViIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoib3VkN2JxRWJucFdUXC9yXC9WWWxFUjZtZXljQ1FrXC9tNWNaZTJKNVFick4yc1V6TCtzXC9XMk55RnpTMmNCQlREbHMifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 2/4] power: extend guest channel api for reading 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: <20190319150047.N5RcrduEfdBLJK5vUMnA--28V-2OIC9HS9FaEriOrVQ@z> > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Hajkowski > --- > diff --git a/lib/librte_power/channel_commands.h > +#define CPU_POWER_CMD_NAK 2 Instead of NAK , NACK would be better I guess. > + if (global_fds[lcore_id] =3D=3D 0) { Is this now < 0 ? > + ret =3D read(global_fds[lcore_id], > + buffer, buffer_len); > + if (ret < 0) { read() return value 0 also should be handled? > + > +int rte_power_guest_channel_receive_msg(struct channel_packet *pkt, > + unsigned int lcore_id) > +{ > + int ret; > + > + struct pollfd fds; > + fds.fd =3D global_fds[lcore_id]; > + fds.events =3D POLLIN; > + > + ret =3D poll(&fds, 1, TIMEOUT); > + if (ret =3D=3D 0) { > + RTE_LOG(DEBUG, GUEST_CHANNEL, "Timeout occurs during > poll function.\n"); > + return -1; > + } else if (ret < 0) { > + RTE_LOG(ERR, GUEST_CHANNEL, "Error occurred during poll > function: %s\n", > + strerror(ret)); > + return -1; > + } > + You can keep this function simple by moving all the code above code to powe= r_guest_channel_read_msg(), like the way done in rte_power_guest_channel_se= nd_msg() and guest_channel_send_msg(). Thanks, Reshma