[dpdk-stable] patch 'eventdev: fix error sign' has been queued to LTS release 18.11.3

Kevin Traynor ktraynor at redhat.com
Tue Aug 27 11:30:09 CEST 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 09/03/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/954b835b66d84487496798022319edcf1e7e8bdf

Thanks.

Kevin Traynor

---
>From 954b835b66d84487496798022319edcf1e7e8bdf Mon Sep 17 00:00:00 2001
From: Dilshod Urazov <dilshod.urazov at oktetlabs.ru>
Date: Thu, 4 Jul 2019 11:03:30 +0100
Subject: [PATCH] eventdev: fix error sign

[ upstream commit 468d4c4e202f5653809231aa2d6d6935dd012da0 ]

Fixes: c9bf83947e2e ("eventdev: add eth Tx adapter APIs")
Fixes: 47d05b292820 ("eventdev: add timer adapter common code")
Fixes: 6750b21bd6af ("eventdev: add default software timer adapter")
Fixes: c75f7897ea35 ("eventdev: set error code in port link/unlink functions")
Fixes: 7d1acc9dde93 ("eventdev: introduce helper function for enqueue burst")
Fixes: 406aed4e0dd9 ("eventdev: add errno-style return values")
Fixes: cc7b73ea9e3b ("eventdev: add new software timer adapter")

Signed-off-by: Dilshod Urazov <dilshod.urazov at oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
Reviewed-by: David Marchand <david.marchand at redhat.com>
Acked-by: Jerin Jacob <jerinj at marvell.com>
---
 .../rte_event_eth_tx_adapter.h                |  8 +++---
 lib/librte_eventdev/rte_event_timer_adapter.c | 12 ++++-----
 lib/librte_eventdev/rte_eventdev.c            | 16 ++++++------
 lib/librte_eventdev/rte_eventdev.h            | 26 +++++++++----------
 4 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/lib/librte_eventdev/rte_event_eth_tx_adapter.h b/lib/librte_eventdev/rte_event_eth_tx_adapter.h
index 7a4a01fa7..4d8a018c0 100644
--- a/lib/librte_eventdev/rte_event_eth_tx_adapter.h
+++ b/lib/librte_eventdev/rte_event_eth_tx_adapter.h
@@ -376,8 +376,8 @@ rte_event_eth_tx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
  *   events at the end of ev[] are not consumed and the caller has to take care
  *   of them, and rte_errno is set accordingly. Possible errno values include:
- *   - -EINVAL  The port ID is invalid, device ID is invalid, an event's queue
+ *   - EINVAL   The port ID is invalid, device ID is invalid, an event's queue
  *              ID is invalid, or an event's sched type doesn't match the
  *              capabilities of the destination queue.
- *   - -ENOSPC  The event port was backpressured and unable to enqueue
+ *   - ENOSPC   The event port was backpressured and unable to enqueue
  *              one or more events. This error code is only applicable to
  *              closed systems.
@@ -394,10 +394,10 @@ rte_event_eth_tx_adapter_enqueue(uint8_t dev_id,
 	if (dev_id >= RTE_EVENT_MAX_DEVS ||
 		!rte_eventdevs[dev_id].attached) {
-		rte_errno = -EINVAL;
+		rte_errno = EINVAL;
 		return 0;
 	}
 
 	if (port_id >= dev->data->nb_ports) {
-		rte_errno = -EINVAL;
+		rte_errno = EINVAL;
 		return 0;
 	}
diff --git a/lib/librte_eventdev/rte_event_timer_adapter.c b/lib/librte_eventdev/rte_event_timer_adapter.c
index 79070d484..026d639bc 100644
--- a/lib/librte_eventdev/rte_event_timer_adapter.c
+++ b/lib/librte_eventdev/rte_event_timer_adapter.c
@@ -193,5 +193,5 @@ rte_event_timer_adapter_create_ext(
 						   &adapter->ops);
 	if (ret < 0) {
-		rte_errno = ret;
+		rte_errno = -ret;
 		goto free_memzone;
 	}
@@ -199,9 +199,9 @@ rte_event_timer_adapter_create_ext(
 	if (!(adapter->data->caps &
 	      RTE_EVENT_TIMER_ADAPTER_CAP_INTERNAL_PORT)) {
-		FUNC_PTR_OR_NULL_RET_WITH_ERRNO(conf_cb, -EINVAL);
+		FUNC_PTR_OR_NULL_RET_WITH_ERRNO(conf_cb, EINVAL);
 		ret = conf_cb(adapter->data->id, adapter->data->event_dev_id,
 			      &adapter->data->event_port_id, conf_arg);
 		if (ret < 0) {
-			rte_errno = ret;
+			rte_errno = -ret;
 			goto free_memzone;
 		}
@@ -215,8 +215,8 @@ rte_event_timer_adapter_create_ext(
 
 	/* Allow driver to do some setup */
-	FUNC_PTR_OR_NULL_RET_WITH_ERRNO(adapter->ops->init, -ENOTSUP);
+	FUNC_PTR_OR_NULL_RET_WITH_ERRNO(adapter->ops->init, ENOTSUP);
 	ret = adapter->ops->init(adapter);
 	if (ret < 0) {
-		rte_errno = ret;
+		rte_errno = -ret;
 		goto free_memzone;
 	}
@@ -494,5 +494,5 @@ event_buffer_flush(struct event_buffer *bufp, uint8_t dev_id, uint8_t port_id,
 	*nb_events_flushed = rte_event_enqueue_burst(dev_id, port_id,
 						     &events[tail_idx], n);
-	if (*nb_events_flushed != n && rte_errno == -EINVAL) {
+	if (*nb_events_flushed != n && rte_errno == EINVAL) {
 		EVTIM_LOG_ERR("failed to enqueue invalid event - dropping it");
 		(*nb_events_inv)++;
diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index ebaf3087d..677850cd0 100644
--- a/lib/librte_eventdev/rte_eventdev.c
+++ b/lib/librte_eventdev/rte_eventdev.c
@@ -889,10 +889,10 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,
 	int i, diag;
 
-	RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, -EINVAL, 0);
+	RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, EINVAL, 0);
 	dev = &rte_eventdevs[dev_id];
 
 	if (*dev->dev_ops->port_link == NULL) {
 		RTE_PMD_DEBUG_TRACE("Function not supported\n");
-		rte_errno = -ENOTSUP;
+		rte_errno = ENOTSUP;
 		return 0;
 	}
@@ -900,5 +900,5 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,
 	if (!is_valid_port(dev, port_id)) {
 		RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu8, port_id);
-		rte_errno = -EINVAL;
+		rte_errno = EINVAL;
 		return 0;
 	}
@@ -921,5 +921,5 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,
 	for (i = 0; i < nb_links; i++)
 		if (queues[i] >= dev->data->nb_queues) {
-			rte_errno = -EINVAL;
+			rte_errno = EINVAL;
 			return 0;
 		}
@@ -948,10 +948,10 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,
 	uint16_t *links_map;
 
-	RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, -EINVAL, 0);
+	RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, EINVAL, 0);
 	dev = &rte_eventdevs[dev_id];
 
 	if (*dev->dev_ops->port_unlink == NULL) {
 		RTE_PMD_DEBUG_TRACE("Function not supported\n");
-		rte_errno = -ENOTSUP;
+		rte_errno = ENOTSUP;
 		return 0;
 	}
@@ -959,5 +959,5 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,
 	if (!is_valid_port(dev, port_id)) {
 		RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu8, port_id);
-		rte_errno = -EINVAL;
+		rte_errno = EINVAL;
 		return 0;
 	}
@@ -988,5 +988,5 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,
 	for (i = 0; i < nb_unlinks; i++)
 		if (queues[i] >= dev->data->nb_queues) {
-			rte_errno = -EINVAL;
+			rte_errno = EINVAL;
 			return 0;
 		}
diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
index d593c5277..d755f194f 100644
--- a/lib/librte_eventdev/rte_eventdev.h
+++ b/lib/librte_eventdev/rte_eventdev.h
@@ -1322,10 +1322,10 @@ __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
 	if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
-		rte_errno = -EINVAL;
+		rte_errno = EINVAL;
 		return 0;
 	}
 
 	if (port_id >= dev->data->nb_ports) {
-		rte_errno = -EINVAL;
+		rte_errno = EINVAL;
 		return 0;
 	}
@@ -1376,8 +1376,8 @@ __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
  *   events at the end of ev[] are not consumed and the caller has to take care
  *   of them, and rte_errno is set accordingly. Possible errno values include:
- *   - -EINVAL  The port ID is invalid, device ID is invalid, an event's queue
+ *   - EINVAL   The port ID is invalid, device ID is invalid, an event's queue
  *              ID is invalid, or an event's sched type doesn't match the
  *              capabilities of the destination queue.
- *   - -ENOSPC  The event port was backpressured and unable to enqueue
+ *   - ENOSPC   The event port was backpressured and unable to enqueue
  *              one or more events. This error code is only applicable to
  *              closed systems.
@@ -1426,8 +1426,8 @@ rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
  *   events at the end of ev[] are not consumed and the caller has to take care
  *   of them, and rte_errno is set accordingly. Possible errno values include:
- *   - -EINVAL  The port ID is invalid, device ID is invalid, an event's queue
+ *   - EINVAL   The port ID is invalid, device ID is invalid, an event's queue
  *              ID is invalid, or an event's sched type doesn't match the
  *              capabilities of the destination queue.
- *   - -ENOSPC  The event port was backpressured and unable to enqueue
+ *   - ENOSPC   The event port was backpressured and unable to enqueue
  *              one or more events. This error code is only applicable to
  *              closed systems.
@@ -1477,8 +1477,8 @@ rte_event_enqueue_new_burst(uint8_t dev_id, uint8_t port_id,
  *   events at the end of ev[] are not consumed and the caller has to take care
  *   of them, and rte_errno is set accordingly. Possible errno values include:
- *   - -EINVAL  The port ID is invalid, device ID is invalid, an event's queue
+ *   - EINVAL   The port ID is invalid, device ID is invalid, an event's queue
  *              ID is invalid, or an event's sched type doesn't match the
  *              capabilities of the destination queue.
- *   - -ENOSPC  The event port was backpressured and unable to enqueue
+ *   - ENOSPC   The event port was backpressured and unable to enqueue
  *              one or more events. This error code is only applicable to
  *              closed systems.
@@ -1599,10 +1599,10 @@ rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[],
 #ifdef RTE_LIBRTE_EVENTDEV_DEBUG
 	if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) {
-		rte_errno = -EINVAL;
+		rte_errno = EINVAL;
 		return 0;
 	}
 
 	if (port_id >= dev->data->nb_ports) {
-		rte_errno = -EINVAL;
+		rte_errno = EINVAL;
 		return 0;
 	}
@@ -1677,7 +1677,7 @@ rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[],
  * If return value is less than *nb_links* then implementation shall update the
  * rte_errno accordingly, Possible rte_errno values are
- * (-EDQUOT) Quota exceeded(Application tried to link the queue configured with
+ * (EDQUOT) Quota exceeded(Application tried to link the queue configured with
  *  RTE_EVENT_QUEUE_CFG_SINGLE_LINK to more than one event ports)
- * (-EINVAL) Invalid parameter
+ * (EINVAL) Invalid parameter
  *
  */
@@ -1724,5 +1724,5 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,
  * If return value is less than *nb_unlinks* then implementation shall update
  * the rte_errno accordingly, Possible rte_errno values are
- * (-EINVAL) Invalid parameter
+ * (EINVAL) Invalid parameter
  */
 int
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-08-27 09:40:12.659393953 +0100
+++ 0032-eventdev-fix-error-sign.patch	2019-08-27 09:40:10.920144388 +0100
@@ -1 +1 @@
-From 468d4c4e202f5653809231aa2d6d6935dd012da0 Mon Sep 17 00:00:00 2001
+From 954b835b66d84487496798022319edcf1e7e8bdf Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 468d4c4e202f5653809231aa2d6d6935dd012da0 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
- lib/librte_eventdev/rte_event_timer_adapter.c | 18 ++++++-------
+ lib/librte_eventdev/rte_event_timer_adapter.c | 12 ++++-----
@@ -24 +25 @@
- 4 files changed, 34 insertions(+), 34 deletions(-)
+ 4 files changed, 31 insertions(+), 31 deletions(-)
@@ -27 +28 @@
-index 9bed12b3a..c848261c4 100644
+index 7a4a01fa7..4d8a018c0 100644
@@ -30 +31 @@
-@@ -333,8 +333,8 @@ rte_event_eth_tx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
+@@ -376,8 +376,8 @@ rte_event_eth_tx_adapter_event_port_get(uint8_t id, uint8_t *event_port_id);
@@ -41 +42 @@
-@@ -351,10 +351,10 @@ rte_event_eth_tx_adapter_enqueue(uint8_t dev_id,
+@@ -394,10 +394,10 @@ rte_event_eth_tx_adapter_enqueue(uint8_t dev_id,
@@ -55 +56 @@
-index 459bc476d..5ce399eca 100644
+index 79070d484..026d639bc 100644
@@ -88 +89,2 @@
-@@ -510,9 +510,9 @@ event_buffer_flush(struct event_buffer *bufp, uint8_t dev_id, uint8_t port_id,
+@@ -494,5 +494,5 @@ event_buffer_flush(struct event_buffer *bufp, uint8_t dev_id, uint8_t port_id,
+ 	*nb_events_flushed = rte_event_enqueue_burst(dev_id, port_id,
@@ -90,24 +92,4 @@
- 	if (*nb_events_flushed != n) {
--		if (rte_errno == -EINVAL) {
-+		if (rte_errno == EINVAL) {
- 			EVTIM_LOG_ERR("failed to enqueue invalid event - "
- 				      "dropping it");
- 			(*nb_events_inv)++;
--		} else if (rte_errno == -ENOSPC)
-+		} else if (rte_errno == ENOSPC)
- 			rte_pause();
- 	}
-@@ -833,5 +833,5 @@ swtim_init(struct rte_event_timer_adapter *adapter)
- 		if (ret != -EALREADY) {
- 			EVTIM_LOG_ERR("failed to initialize timer subsystem");
--			rte_errno = ret;
-+			rte_errno = -ret;
- 			goto free_mempool;
- 		}
-@@ -841,5 +841,5 @@ swtim_init(struct rte_event_timer_adapter *adapter)
- 	if (ret < 0) {
- 		EVTIM_LOG_ERR("failed to allocate timer data instance");
--		rte_errno = ret;
-+		rte_errno = -ret;
- 		goto free_mempool;
- 	}
+-	if (*nb_events_flushed != n && rte_errno == -EINVAL) {
++	if (*nb_events_flushed != n && rte_errno == EINVAL) {
+ 		EVTIM_LOG_ERR("failed to enqueue invalid event - dropping it");
+ 		(*nb_events_inv)++;
@@ -115 +97 @@
-index cc3199fb6..f44c869cb 100644
+index ebaf3087d..677850cd0 100644
@@ -118 +100 @@
-@@ -890,10 +890,10 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,
+@@ -889,10 +889,10 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,
@@ -126 +108 @@
- 		RTE_EDEV_LOG_ERR("Function not supported\n");
+ 		RTE_PMD_DEBUG_TRACE("Function not supported\n");
@@ -131 +113 @@
-@@ -901,5 +901,5 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,
+@@ -900,5 +900,5 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,
@@ -138 +120 @@
-@@ -922,5 +922,5 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,
+@@ -921,5 +921,5 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,
@@ -145 +127 @@
-@@ -949,10 +949,10 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,
+@@ -948,10 +948,10 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,
@@ -153 +135 @@
- 		RTE_EDEV_LOG_ERR("Function not supported");
+ 		RTE_PMD_DEBUG_TRACE("Function not supported\n");
@@ -158 +140 @@
-@@ -960,5 +960,5 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,
+@@ -959,5 +959,5 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,
@@ -165 +147 @@
-@@ -989,5 +989,5 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,
+@@ -988,5 +988,5 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,
@@ -173 +155 @@
-index 927f43c24..5044a13d0 100644
+index d593c5277..d755f194f 100644
@@ -176 +158 @@
-@@ -1319,10 +1319,10 @@ __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
+@@ -1322,10 +1322,10 @@ __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
@@ -189 +171 @@
-@@ -1373,8 +1373,8 @@ __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
+@@ -1376,8 +1376,8 @@ __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
@@ -200 +182 @@
-@@ -1423,8 +1423,8 @@ rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
+@@ -1426,8 +1426,8 @@ rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id,
@@ -211 +193 @@
-@@ -1474,8 +1474,8 @@ rte_event_enqueue_new_burst(uint8_t dev_id, uint8_t port_id,
+@@ -1477,8 +1477,8 @@ rte_event_enqueue_new_burst(uint8_t dev_id, uint8_t port_id,
@@ -222 +204 @@
-@@ -1596,10 +1596,10 @@ rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[],
+@@ -1599,10 +1599,10 @@ rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[],
@@ -235 +217 @@
-@@ -1674,7 +1674,7 @@ rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[],
+@@ -1677,7 +1677,7 @@ rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[],
@@ -245 +227 @@
-@@ -1721,5 +1721,5 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,
+@@ -1724,5 +1724,5 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,


More information about the stable mailing list