DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
To: dev@dpdk.org
Cc: jerin.jacob@caviumnetworks.com,
	Pavan Nikhilesh Bhagavatula <pbhagavatula@caviumnetworks.com>
Subject: [dpdk-dev]  [PATCH] eventdev: fix eventdev start return value
Date: Wed,  7 Jun 2017 16:05:19 +0530	[thread overview]
Message-ID: <1496831719-28146-1-git-send-email-pbhagavatula@caviumnetworks.com> (raw)

From: Pavan Nikhilesh Bhagavatula <pbhagavatula@caviumnetworks.com>

If eventdev has already started it should return -EBUSY instead of 0
when rte_event_dev_start is called.

Fixes: 4f0804bbdfb9 ("eventdev: implement the northbound APIs")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 lib/librte_eventdev/rte_eventdev.c | 2 +-
 lib/librte_eventdev/rte_eventdev.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index 20afc3f..61bb13f 100644
--- a/lib/librte_eventdev/rte_eventdev.c
+++ b/lib/librte_eventdev/rte_eventdev.c
@@ -1023,7 +1023,7 @@ rte_event_dev_start(uint8_t dev_id)
 	if (dev->data->dev_started != 0) {
 		RTE_EDEV_LOG_ERR("Device with dev_id=%" PRIu8 "already started",
 			dev_id);
-		return 0;
+		return -EBUSY;
 	}

 	diag = (*dev->dev_ops->dev_start)(dev);
diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
index a248fe9..c469b66 100644
--- a/lib/librte_eventdev/rte_eventdev.h
+++ b/lib/librte_eventdev/rte_eventdev.h
@@ -759,6 +759,7 @@ rte_event_port_count(uint8_t dev_id);
  *   - 0: Success, device started.
  *   - -ESTALE : Not all ports of the device are configured
  *   - -ENOLINK: Not all queues are linked, which could lead to deadlock.
+ *   - -EBUSY  : Device has already been started.
  */
 int
 rte_event_dev_start(uint8_t dev_id);
--
2.7.4

                 reply	other threads:[~2017-06-07 10:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1496831719-28146-1-git-send-email-pbhagavatula@caviumnetworks.com \
    --to=pbhagavatula@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=jerin.jacob@caviumnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).