DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ethdev: fix errno to have positive value
@ 2019-01-21 16:18 Andrew Rybchenko
  2019-01-22 16:03 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Rybchenko @ 2019-01-21 16:18 UTC (permalink / raw)
  To: Thomas Monjalon, Ferruh Yigit; +Cc: dev, stable

rte_errno should be set to positive value from errno.h plus
few RTE-specific values.

Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
Fixes: 439a90b5f2a7 ("ethdev: reorder inline functions")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 lib/librte_ethdev/rte_ethdev.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index 76266ad10..a3c864a13 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -4222,7 +4222,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
 	if (!rte_eth_dev_is_valid_port(port_id)) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX port_id=%u\n", port_id);
-		rte_errno = -EINVAL;
+		rte_errno = EINVAL;
 		return 0;
 	}
 #endif
@@ -4232,7 +4232,7 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 #ifdef RTE_LIBRTE_ETHDEV_DEBUG
 	if (queue_id >= dev->data->nb_tx_queues) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX queue_id=%u\n", queue_id);
-		rte_errno = -EINVAL;
+		rte_errno = EINVAL;
 		return 0;
 	}
 #endif
-- 
2.17.1

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] ethdev: fix errno to have positive value
  2019-01-21 16:18 [dpdk-dev] [PATCH] ethdev: fix errno to have positive value Andrew Rybchenko
@ 2019-01-22 16:03 ` Thomas Monjalon
  2019-01-23 11:49   ` Burakov, Anatoly
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Monjalon @ 2019-01-22 16:03 UTC (permalink / raw)
  To: Andrew Rybchenko; +Cc: stable, Ferruh Yigit, dev

21/01/2019 17:18, Andrew Rybchenko:
> rte_errno should be set to positive value from errno.h plus
> few RTE-specific values.
> 
> Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
> Fixes: 439a90b5f2a7 ("ethdev: reorder inline functions")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>

Applied, thanks

There are other occurrences in drivers:
	git grep 'rte_errno = -E'

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] ethdev: fix errno to have positive value
  2019-01-22 16:03 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
@ 2019-01-23 11:49   ` Burakov, Anatoly
  0 siblings, 0 replies; 3+ messages in thread
From: Burakov, Anatoly @ 2019-01-23 11:49 UTC (permalink / raw)
  To: Thomas Monjalon, Andrew Rybchenko; +Cc: stable, Ferruh Yigit, dev

On 22-Jan-19 4:03 PM, Thomas Monjalon wrote:
> 21/01/2019 17:18, Andrew Rybchenko:
>> rte_errno should be set to positive value from errno.h plus
>> few RTE-specific values.
>>
>> Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
>> Fixes: 439a90b5f2a7 ("ethdev: reorder inline functions")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> 
> Applied, thanks
> 
> There are other occurrences in drivers:
> 	git grep 'rte_errno = -E'
> 

There could also possibly be rte_errno = -value; type assignments. I 
imagine most of them are correct (since the value itself was negative in 
the first place, so additional '-' flips the sign again), but it doesn't 
hurt to check :)

-- 
Thanks,
Anatoly

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

end of thread, other threads:[~2019-01-23 11:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-21 16:18 [dpdk-dev] [PATCH] ethdev: fix errno to have positive value Andrew Rybchenko
2019-01-22 16:03 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2019-01-23 11:49   ` Burakov, Anatoly

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