From 8e0c8dcf3507ae812f1abcd5247617917f131dae Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Mon, 21 Jan 2019 16:18:35 +0000 Subject: [PATCH] ethdev: fix errno to have positive value 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 --- 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 76266ad10e..a3c864a134 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.20.1