From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 77E73A04B7; Tue, 13 Oct 2020 16:54:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C32381DA9F; Tue, 13 Oct 2020 16:54:02 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 4841F1DA9E for ; Tue, 13 Oct 2020 16:53:59 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.7.65.62]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id C30FD600BA; Tue, 13 Oct 2020 14:53:57 +0000 (UTC) Received: from us4-mdac16-23.ut7.mdlocal (unknown [10.7.65.247]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id BE7008009B; Tue, 13 Oct 2020 14:53:57 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.7.66.40]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 2D1A028004D; Tue, 13 Oct 2020 14:53:57 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 76DE2BC008A; Tue, 13 Oct 2020 14:53:56 +0000 (UTC) Received: from ukex01.SolarFlarecom.com (10.17.10.4) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 13 Oct 2020 15:53:52 +0100 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 13 Oct 2020 15:53:52 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 09DErqje022067; Tue, 13 Oct 2020 15:53:52 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 34ADA1613A9; Tue, 13 Oct 2020 15:53:52 +0100 (BST) From: Andrew Rybchenko To: CC: Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Date: Tue, 13 Oct 2020 15:53:38 +0100 Message-ID: <1602600818-7473-1-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25722.003 X-TM-AS-Result: No-9.138700-8.000000-10 X-TMASE-MatchedRID: udZcHG6m0rKET4K8ZrS4Y5xVZzZr7+O7S1zwNuiBtITfUZT83lbkEBUC x/X5xkUnLKAgJ8amZD63d+d3cNGxpm8BU9XGR8QhSszr2nuUNKySiza26cvwNFezEE205dNvbOS TqgrdBFl/ZFp3eSrTXBPF8Qn6QUl/j9BnDoGTohNQglbj46D9AjRVNTvIvcOTIFBEE5CFomJSXT dIhjp97f6VjvpTWdV8Kb3ja/ZhKyjdszRFwcTb59B5TKVn+YuXD0nd7Djfy0ng91xayX4L85keH B8L8esyFJ8WkcrE2FqKrvMV4jkF7IzQp7mciZRI5venhychcY3OaxVMGFqGSgv1OPvvDLzs1ZvM nRa3QPL8Sl9vOxiYxx3fcQAWUOWdpqDX27S3uVtPs79gcmEg0KIik2/euMx18CWGWvy/Nx3SJJc bp1Y+W9dZ7liVrTLgwZpk64uDBppzKfT2b6qrDp4CIKY/Hg3Am4n49vyf9XFKdDgyPBo71yq2rl 3dzGQ1UF3zbMFeS8hb+1gsHgVWn16IxGyZQDAtztMqLmtY+sloDqXpZNm4ZQ== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--9.138700-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25722.003 X-MDID: 1602600837-J30Pev8Z63jA X-PPE-DISP: 1602600837;J30Pev8Z63jA Subject: [dpdk-dev] [PATCH] ethdev: unify error code if port ID is invalid X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use ENODEV as the error code if specified port ID is invalid. Signed-off-by: Andrew Rybchenko --- lib/librte_ethdev/rte_ethdev.c | 44 ++++++++++++++++---------------- lib/librte_ethdev/rte_ethdev.h | 46 +++++++++++++++++++++++----------- 2 files changed, 54 insertions(+), 36 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 5b7979a3b8..1f862f918a 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -784,7 +784,7 @@ rte_eth_dev_get_name_by_port(uint16_t port_id, char *name) { char *tmp; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); if (name == NULL) { RTE_ETHDEV_LOG(ERR, "Null pointer is specified\n"); @@ -931,7 +931,7 @@ rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id) struct rte_eth_dev *dev; int ret; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; if (!dev->data->dev_started) { @@ -972,7 +972,7 @@ rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id) struct rte_eth_dev *dev; int ret; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -1006,7 +1006,7 @@ rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id) struct rte_eth_dev *dev; int ret; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; if (!dev->data->dev_started) { @@ -1045,7 +1045,7 @@ rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id) struct rte_eth_dev *dev; int ret; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -1278,7 +1278,7 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, int diag; int ret; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -1664,7 +1664,7 @@ rte_eth_dev_start(uint16_t port_id) int diag; int ret; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -1736,7 +1736,7 @@ rte_eth_dev_set_link_up(uint16_t port_id) { struct rte_eth_dev *dev; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -1749,7 +1749,7 @@ rte_eth_dev_set_link_down(uint16_t port_id) { struct rte_eth_dev *dev; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -1779,7 +1779,7 @@ rte_eth_dev_reset(uint16_t port_id) struct rte_eth_dev *dev; int ret; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_reset, -ENOTSUP); @@ -1826,7 +1826,7 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, struct rte_eth_rxconf local_conf; void **rxq; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; if (rx_queue_id >= dev->data->nb_rx_queues) { @@ -1981,7 +1981,7 @@ rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id, int i; int count; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; if (rx_queue_id >= dev->data->nb_rx_queues) { @@ -2052,7 +2052,7 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, void **txq; int ret; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; if (tx_queue_id >= dev->data->nb_tx_queues) { @@ -2153,7 +2153,7 @@ rte_eth_tx_hairpin_queue_setup(uint16_t port_id, uint16_t tx_queue_id, int count; int ret; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; if (tx_queue_id >= dev->data->nb_tx_queues) { RTE_ETHDEV_LOG(ERR, "Invalid TX queue_id=%u\n", tx_queue_id); @@ -2318,7 +2318,7 @@ rte_eth_promiscuous_get(uint16_t port_id) { struct rte_eth_dev *dev; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; return dev->data->promiscuous; @@ -2369,7 +2369,7 @@ rte_eth_allmulticast_get(uint16_t port_id) { struct rte_eth_dev *dev; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; return dev->data->all_multicast; @@ -2457,7 +2457,7 @@ rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats *stats) { struct rte_eth_dev *dev; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; memset(stats, 0, sizeof(*stats)); @@ -2508,7 +2508,7 @@ get_xstats_count(uint16_t port_id) struct rte_eth_dev *dev; int count; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; if (dev->dev_ops->xstats_get_names_by_id != NULL) { count = (*dev->dev_ops->xstats_get_names_by_id)(dev, NULL, @@ -2913,7 +2913,7 @@ rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, uint16_t nb_rxqs, nb_txqs; int ret; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; @@ -4715,7 +4715,7 @@ rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, return -ENOTSUP; #endif /* Check input parameters. */ - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); if (user_cb == NULL || queue_id >= rte_eth_devices[port_id].data->nb_rx_queues) return -EINVAL; @@ -4749,7 +4749,7 @@ rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, return -ENOTSUP; #endif /* Check input parameters. */ - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); if (user_cb == NULL || queue_id >= rte_eth_devices[port_id].data->nb_tx_queues) return -EINVAL; @@ -5209,7 +5209,7 @@ rte_eth_dev_hairpin_capability_get(uint16_t port_id, { struct rte_eth_dev *dev; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->hairpin_cap_get, -ENOTSUP); diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index f4cc5917b9..6adf5600ab 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -2033,6 +2033,7 @@ rte_eth_dev_is_removed(uint16_t port_id); * @return * - 0: Success, receive queue correctly set up. * - -EIO: if device is removed. + * - -ENODEV: if *port_id* is invalid. * - -EINVAL: The memory pool pointer is null or the size of network buffers * which can be allocated from this memory pool does not fit the various * buffer sizes allowed by the device controller. @@ -2067,6 +2068,7 @@ int rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, * * @return * - (0) if successful. + * - (-ENODEV) if *port_id* is invalid. * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. * - (-ENOMEM) if unable to allocate the resources. @@ -2148,6 +2150,7 @@ int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, * * @return * - (0) if successful. + * - (-ENODEV) if *port_id* is invalid. * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. * - (-ENOMEM) if unable to allocate the resources. @@ -2192,7 +2195,8 @@ int rte_eth_dev_is_valid_port(uint16_t port_id); * to rte_eth_dev_configure(). * @return * - 0: Success, the receive queue is started. - * - -EINVAL: The port_id or the queue_id out of range or belong to hairpin. + * - -ENODEV: if *port_id* is invalid. + * - -EINVAL: The queue_id out of range or belong to hairpin. * - -EIO: if device is removed. * - -ENOTSUP: The function not supported in PMD driver. */ @@ -2209,7 +2213,8 @@ int rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id); * to rte_eth_dev_configure(). * @return * - 0: Success, the receive queue is stopped. - * - -EINVAL: The port_id or the queue_id out of range or belong to hairpin. + * - -ENODEV: if *port_id* is invalid. + * - -EINVAL: The queue_id out of range or belong to hairpin. * - -EIO: if device is removed. * - -ENOTSUP: The function not supported in PMD driver. */ @@ -2227,7 +2232,8 @@ int rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id); * to rte_eth_dev_configure(). * @return * - 0: Success, the transmit queue is started. - * - -EINVAL: The port_id or the queue_id out of range or belong to hairpin. + * - -ENODEV: if *port_id* is invalid. + * - -EINVAL: The queue_id out of range or belong to hairpin. * - -EIO: if device is removed. * - -ENOTSUP: The function not supported in PMD driver. */ @@ -2244,7 +2250,8 @@ int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id); * to rte_eth_dev_configure(). * @return * - 0: Success, the transmit queue is stopped. - * - -EINVAL: The port_id or the queue_id out of range or belong to hairpin. + * - -ENODEV: if *port_id* is invalid. + * - -EINVAL: The queue_id out of range or belong to hairpin. * - -EIO: if device is removed. * - -ENOTSUP: The function not supported in PMD driver. */ @@ -2344,7 +2351,7 @@ void rte_eth_dev_close(uint16_t port_id); * * @return * - (0) if successful. - * - (-EINVAL) if port identifier is invalid. + * - (-ENODEV) if *port_id* is invalid. * - (-ENOTSUP) if hardware doesn't support this function. * - (-EPERM) if not ran from the primary process. * - (-EIO) if re-initialisation failed or device is removed. @@ -3618,6 +3625,7 @@ int rte_eth_dev_default_mac_addr_set(uint16_t port_id, * rte_eth_dev_info_get(). * @return * - (0) if successful. + * - (-ENODEV) if *port_id* is invalid. * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. * - (-EIO) if device is removed. @@ -3639,6 +3647,7 @@ int rte_eth_dev_rss_reta_update(uint16_t port_id, * rte_eth_dev_info_get(). * @return * - (0) if successful. + * - (-ENODEV) if *port_id* is invalid. * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. * - (-EIO) if device is removed. @@ -4002,8 +4011,9 @@ rte_eth_add_tx_callback(uint16_t port_id, uint16_t queue_id, * * @return * - 0: Success. Callback was removed. + * - -ENODEV: If *port_id* is invalid. * - -ENOTSUP: Callback support is not available. - * - -EINVAL: The port_id or the queue_id is out of range, or the callback + * - -EINVAL: The queue_id is out of range, or the callback * is NULL or not found for the port/queue. */ int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, @@ -4035,8 +4045,9 @@ int rte_eth_remove_rx_callback(uint16_t port_id, uint16_t queue_id, * * @return * - 0: Success. Callback was removed. + * - -ENODEV: If *port_id* is invalid. * - -ENOTSUP: Callback support is not available. - * - -EINVAL: The port_id or the queue_id is out of range, or the callback + * - -EINVAL: The queue_id is out of range, or the callback * is NULL or not found for the port/queue. */ int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, @@ -4056,8 +4067,9 @@ int rte_eth_remove_tx_callback(uint16_t port_id, uint16_t queue_id, * * @return * - 0: Success + * - -ENODEV: If *port_id* is invalid. * - -ENOTSUP: routine is not supported by the device PMD. - * - -EINVAL: The port_id or the queue_id is out of range, or the queue + * - -EINVAL: The queue_id is out of range, or the queue * is hairpin queue. */ int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, @@ -4077,8 +4089,9 @@ int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, * * @return * - 0: Success + * - -ENODEV: If *port_id* is invalid. * - -ENOTSUP: routine is not supported by the device PMD. - * - -EINVAL: The port_id or the queue_id is out of range, or the queue + * - -EINVAL: The queue_id is out of range, or the queue * is hairpin queue. */ int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, @@ -4098,8 +4111,9 @@ int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, * * @return * - 0: Success + * - -ENODEV: If *port_id* is invalid. * - -ENOTSUP: routine is not supported by the device PMD. - * - -EINVAL: The port_id or the queue_id is out of range. + * - -EINVAL: The queue_id is out of range. */ __rte_experimental int rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, @@ -4119,8 +4133,9 @@ int rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, * * @return * - 0: Success + * - -ENODEV: If *port_id* is invalid. * - -ENOTSUP: routine is not supported by the device PMD. - * - -EINVAL: The port_id or the queue_id is out of range. + * - -EINVAL: The queue_id is out of range. */ __rte_experimental int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, @@ -4509,6 +4524,7 @@ rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id); * Buffer of size RTE_ETH_NAME_MAX_LEN to store the name. * @return * - (0) if successful. +* - (-ENODEV) if *port_id* is invalid. * - (-EINVAL) on failure. */ int @@ -4710,7 +4726,8 @@ rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id, * The queue id on the specific port. * @return * The number of used descriptors in the specific queue, or: - * (-EINVAL) if *port_id* or *queue_id* is invalid + * - (-ENODEV) if *port_id* is invalid. + * (-EINVAL) if *queue_id* is invalid * (-ENOTSUP) if the device does not support this function */ static inline int @@ -4718,7 +4735,7 @@ rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id) { struct rte_eth_dev *dev; - RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_queue_count, -ENOTSUP); if (queue_id >= dev->data->nb_rx_queues || @@ -5017,6 +5034,7 @@ rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id, * meet devices requirements with rte_errno set appropriately: * - EINVAL: offload flags are not correctly set * - ENOTSUP: the offload feature is not supported by the hardware + * - ENODEV: if *port_id* is invalid (with debug enabled only) * */ @@ -5031,7 +5049,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 = ENODEV; return 0; } #endif -- 2.17.1