DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] power: update for error handling
@ 2019-03-28 15:55 Lukasz Krakowiak
  2019-03-28 15:55 ` Lukasz Krakowiak
  2019-03-28 17:02 ` Burakov, Anatoly
  0 siblings, 2 replies; 6+ messages in thread
From: Lukasz Krakowiak @ 2019-03-28 15:55 UTC (permalink / raw)
  To: david.hunt; +Cc: dev, Lukasz Krakowiak

Update for handling negative returned status from functions
call.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 examples/vm_power_manager/channel_manager.c | 4 ++--
 examples/vm_power_manager/channel_monitor.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
index de1a86891..09bfa5c0d 100644
--- a/examples/vm_power_manager/channel_manager.c
+++ b/examples/vm_power_manager/channel_manager.c
@@ -224,7 +224,7 @@ open_non_blocking_channel(struct channel_info *info)
 	struct timeval tv;
 
 	info->fd = socket(AF_UNIX, SOCK_STREAM, 0);
-	if (info->fd == -1) {
+	if (info->fd < 0) {
 		RTE_LOG(ERR, CHANNEL_MANAGER, "Error(%s) creating socket for '%s'\n",
 				strerror(errno),
 				info->channel_path);
@@ -285,7 +285,7 @@ open_host_channel(struct channel_info *info)
 	int flags;
 
 	info->fd = open(info->channel_path, O_RDWR | O_RSYNC);
-	if (info->fd == -1) {
+	if (info->fd < 0) {
 		RTE_LOG(ERR, CHANNEL_MANAGER, "Error(%s) opening fifo for '%s'\n",
 				strerror(errno),
 				info->channel_path);
diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
index 1a3a0fa76..22f2eb819 100644
--- a/examples/vm_power_manager/channel_monitor.c
+++ b/examples/vm_power_manager/channel_monitor.c
@@ -435,7 +435,7 @@ 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]) == -1) {
+			if (get_pfid(&policies[i]) < 0) {
 				updated = 1;
 				break;
 			}
@@ -449,7 +449,7 @@ 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]) == -1)
+				if (get_pfid(&policies[i]) < 0)
 					break;
 				core_share_status(i);
 				policies[i].enabled = 1;
@@ -756,7 +756,7 @@ read_binary_packet(struct channel_info *chan_info)
 				buffer, buffer_len);
 		if (n_bytes == buffer_len)
 			break;
-		if (n_bytes == -1) {
+		if (n_bytes < 0) {
 			err = errno;
 			RTE_LOG(DEBUG, CHANNEL_MONITOR,
 				"Received error on "
-- 
2.19.2.windows.1

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

* [dpdk-dev] [PATCH] power: update for error handling
  2019-03-28 15:55 [dpdk-dev] [PATCH] power: update for error handling Lukasz Krakowiak
@ 2019-03-28 15:55 ` Lukasz Krakowiak
  2019-03-28 17:02 ` Burakov, Anatoly
  1 sibling, 0 replies; 6+ messages in thread
From: Lukasz Krakowiak @ 2019-03-28 15:55 UTC (permalink / raw)
  To: david.hunt; +Cc: dev, Lukasz Krakowiak

Update for handling negative returned status from functions
call.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
---
 examples/vm_power_manager/channel_manager.c | 4 ++--
 examples/vm_power_manager/channel_monitor.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
index de1a86891..09bfa5c0d 100644
--- a/examples/vm_power_manager/channel_manager.c
+++ b/examples/vm_power_manager/channel_manager.c
@@ -224,7 +224,7 @@ open_non_blocking_channel(struct channel_info *info)
 	struct timeval tv;
 
 	info->fd = socket(AF_UNIX, SOCK_STREAM, 0);
-	if (info->fd == -1) {
+	if (info->fd < 0) {
 		RTE_LOG(ERR, CHANNEL_MANAGER, "Error(%s) creating socket for '%s'\n",
 				strerror(errno),
 				info->channel_path);
@@ -285,7 +285,7 @@ open_host_channel(struct channel_info *info)
 	int flags;
 
 	info->fd = open(info->channel_path, O_RDWR | O_RSYNC);
-	if (info->fd == -1) {
+	if (info->fd < 0) {
 		RTE_LOG(ERR, CHANNEL_MANAGER, "Error(%s) opening fifo for '%s'\n",
 				strerror(errno),
 				info->channel_path);
diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
index 1a3a0fa76..22f2eb819 100644
--- a/examples/vm_power_manager/channel_monitor.c
+++ b/examples/vm_power_manager/channel_monitor.c
@@ -435,7 +435,7 @@ 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]) == -1) {
+			if (get_pfid(&policies[i]) < 0) {
 				updated = 1;
 				break;
 			}
@@ -449,7 +449,7 @@ 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]) == -1)
+				if (get_pfid(&policies[i]) < 0)
 					break;
 				core_share_status(i);
 				policies[i].enabled = 1;
@@ -756,7 +756,7 @@ read_binary_packet(struct channel_info *chan_info)
 				buffer, buffer_len);
 		if (n_bytes == buffer_len)
 			break;
-		if (n_bytes == -1) {
+		if (n_bytes < 0) {
 			err = errno;
 			RTE_LOG(DEBUG, CHANNEL_MONITOR,
 				"Received error on "
-- 
2.19.2.windows.1


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

* Re: [dpdk-dev] [PATCH] power: update for error handling
  2019-03-28 15:55 [dpdk-dev] [PATCH] power: update for error handling Lukasz Krakowiak
  2019-03-28 15:55 ` Lukasz Krakowiak
@ 2019-03-28 17:02 ` Burakov, Anatoly
  2019-03-28 17:02   ` Burakov, Anatoly
  2019-03-29 14:32   ` Thomas Monjalon
  1 sibling, 2 replies; 6+ messages in thread
From: Burakov, Anatoly @ 2019-03-28 17:02 UTC (permalink / raw)
  To: Lukasz Krakowiak, david.hunt; +Cc: dev

On 28-Mar-19 3:55 PM, Lukasz Krakowiak wrote:
> Update for handling negative returned status from functions
> call.
> 
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---

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

-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH] power: update for error handling
  2019-03-28 17:02 ` Burakov, Anatoly
@ 2019-03-28 17:02   ` Burakov, Anatoly
  2019-03-29 14:32   ` Thomas Monjalon
  1 sibling, 0 replies; 6+ messages in thread
From: Burakov, Anatoly @ 2019-03-28 17:02 UTC (permalink / raw)
  To: Lukasz Krakowiak, david.hunt; +Cc: dev

On 28-Mar-19 3:55 PM, Lukasz Krakowiak wrote:
> Update for handling negative returned status from functions
> call.
> 
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> ---

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

-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH] power: update for error handling
  2019-03-28 17:02 ` Burakov, Anatoly
  2019-03-28 17:02   ` Burakov, Anatoly
@ 2019-03-29 14:32   ` Thomas Monjalon
  2019-03-29 14:32     ` Thomas Monjalon
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2019-03-29 14:32 UTC (permalink / raw)
  To: Lukasz Krakowiak; +Cc: dev, Burakov, Anatoly, david.hunt

28/03/2019 18:02, Burakov, Anatoly:
> On 28-Mar-19 3:55 PM, Lukasz Krakowiak wrote:
> > Update for handling negative returned status from functions
> > call.
> > 
> > Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks

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

* Re: [dpdk-dev] [PATCH] power: update for error handling
  2019-03-29 14:32   ` Thomas Monjalon
@ 2019-03-29 14:32     ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2019-03-29 14:32 UTC (permalink / raw)
  To: Lukasz Krakowiak; +Cc: dev, Burakov, Anatoly, david.hunt

28/03/2019 18:02, Burakov, Anatoly:
> On 28-Mar-19 3:55 PM, Lukasz Krakowiak wrote:
> > Update for handling negative returned status from functions
> > call.
> > 
> > Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks




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

end of thread, other threads:[~2019-03-29 14:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-28 15:55 [dpdk-dev] [PATCH] power: update for error handling Lukasz Krakowiak
2019-03-28 15:55 ` Lukasz Krakowiak
2019-03-28 17:02 ` Burakov, Anatoly
2019-03-28 17:02   ` Burakov, Anatoly
2019-03-29 14:32   ` Thomas Monjalon
2019-03-29 14:32     ` Thomas Monjalon

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).