From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10076.outbound.protection.outlook.com [40.107.1.76]) by dpdk.org (Postfix) with ESMTP id 862851B2E5 for ; Wed, 17 Jan 2018 21:19:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=rGBWcD6XxYH8QmTd/23ACm3S3YzJLO2sB2S1FC5cBIM=; b=FuBnfa/3tma7jMfeO8h1dU/6wwClD7K5xUm+OJg983PT9DGEYe6aaN1L7T9W9jsw0DLSt5OyGLIIJcPsm+JbnktdWR9U8/v2WFItTOiczH6izOEv+GBfrtusZa4YktoVOdb1GGqet4FHPEkpo3Fi9Q6EnnrYr3cHICKNC8H9UTY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM6PR0502MB3799.eurprd05.prod.outlook.com (2603:10a6:209:a::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Wed, 17 Jan 2018 20:19:56 +0000 From: Matan Azrad To: Ferruh Yigit , Adrien Mazarguil , Gaetan Rivet Cc: Thomas Monjalon , dev@dpdk.org Date: Wed, 17 Jan 2018 20:19:15 +0000 Message-Id: <1516220357-13013-5-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1516220357-13013-1-git-send-email-matan@mellanox.com> References: <1515587465-9304-1-git-send-email-matan@mellanox.com> <1516220357-13013-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: HE1PR06CA0129.eurprd06.prod.outlook.com (2603:10a6:7:16::16) To AM6PR0502MB3799.eurprd05.prod.outlook.com (2603:10a6:209:a::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1039d97f-be4a-45c2-d183-08d55de7ad5f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:AM6PR0502MB3799; X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3799; 3:spB4Uf9Y23q5Rg/BOzxP1qBYPZuDrC7ovSlN5Y+P7JWQyZWvRhrdmHVpiraj1ZzqwR6TtIbgkDnOXDf2XRp7PeEhZPP20YbHsVGeur/KUe12ckAXniYs+TT7d/RotXMAk9uZ2eOZDKmmw0xX5BLrk5tu6+Xsj6R0DowHH6WP/tjLelRhC4DsqSnB2/345nyHqt2FVvqXnsxbnBPLCiC/Hy780Z/sgcOPxNTg6BI2Ycu5q/6MeBGmVXKX1YuCSLdw; 25:NiTpuk8xRwg0p5le4rTRqcQkxBldxGLNKvphASMyCp98pd8FAo5YNNYjMn04WNsdr/7Af2L0HIFcv+X2dgbm0Ky5DA1VcWq+I5VbTFTDndr8Xk+ub5y0XOjdWncXmG2NL6rMPHeuo2S5UrEIluhV6UzesFvMUUihNbx2DFCmiUnOazfRiXNr1fejaXOU2U4VctuB1UN4jKyjUf7bsrEx+QxUq0p7njZOdt9FirvGKFrDOGWHPbGaK1IzMPMo8ttQzrLilXZRa0QJkFQ4jjTxLegf1TuM8vmV+IRz8mmIF//1AagMmgF4Ca8jkio3ACMyz68HFUxNb4kG7Jc81hx5iQ==; 31:up0IAClWxz9vYc3amjAEiRkvnyqpV3YzCNldw/QTWEw2cmV9ucjwD30KwmJw3X15zQy8RMRbLewIfpAG9UkZbVOvg1uLrtgC1wR5ErX2MgsMqui6kUNoul/quGampbPY26krDpd1AEEfoM7me8Nus4Anfny/Oggly+5ddKb5PmYlhNLaftYlUQoDXO0eFKaQ1mlYoI73eLPLEWtXDf+sDis1WbwATxzO18mNjv7PKIw= X-MS-TrafficTypeDiagnostic: AM6PR0502MB3799: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3799; 20:CwAVVohjclQLGZnAVCT6uLT2GBJnFc3CCYcORVLOLA3w7KPa+w191nVIcTksNJ8+5BDjDGWzUzpX3uIKJiUsq+vaV8x7a6m+9D/kqIPECD7Q4gpUE1k/U5PY+bPJ5BpzxBNDlZ2LrzNc5eF3s3rOSXB89+/0psghGIs8FcgNntcXU0yZvOpWeCdkT3hSH+Nu67itpkLrBRRegfqgU1EdSyKSsH6P10odwvTRst1cXdo/VNRv8oULR4sunmy/lIwljsvgMibWoDmZs51SjxZnyM8agyh/KPNiRK2tLHbw4125n7OtLZl+1UB1sU8xEd5Pd3P0gxadRS956eZgJLs5L6dtYv2PjnK9UBiBkbvAm9jhz+dC9Y1q1SMeJGUHWLEOw8kg5VKIxMLNe1Van3ONAoyr19aXUEybBhUNVMbLCuHOZajR+DYP4O0oBCkAbQUrjLViKVb76CqELnLKhZCWQTncI7FhxoHiatHeKP233aPL+O2A1hOfvpGniNH5S6LF; 4:HTvKqO1/q3IYDzRFxSX/4sbmInONryGkSGxuAQaRNqX5hWJBn2rP8ckprPYAdmZYvWsMeLQrSGlURVrZhQcHtsRZV/BHWaPcuBxT286aLzwRqNIikCfz0c1FHeI/u04ynkyrrmvaTPBuj+kNTn2y5gC44h3MtTlVGHvkLUlZRX1nr53xk2Z1WU6gDRsawNE9CqV7WNFctb3gsCpxxVpns0ryphJ9okN7EV1J4kJ/jNN4atOjbaB7/iIllumcFDYHxhh1aUZ8YcOruQ+05pCar1JG5rkPT/MhsjRHlwh8cBgV4ad6sYzg2KiSRdFXKQ/0 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(20558992708506); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231023)(944501161)(6055026)(6041268)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM6PR0502MB3799; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM6PR0502MB3799; X-Forefront-PRVS: 0555EC8317 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(39380400002)(39860400002)(396003)(199004)(189003)(51416003)(6666003)(50226002)(53946003)(53936002)(68736007)(106356001)(55016002)(21086003)(47776003)(16526018)(2906002)(66066001)(105586002)(97736004)(4720700003)(2950100002)(59450400001)(478600001)(52116002)(305945005)(5890100001)(48376002)(50466002)(33026002)(5660300001)(76176011)(575784001)(69596002)(86362001)(3846002)(7696005)(7736002)(8936002)(81156014)(8676002)(110136005)(16586007)(25786009)(386003)(36756003)(6116002)(81166006)(316002)(26005)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0502MB3799; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR0502MB3799; 23:0RTPd+MuERHZTcHgXvZa4X3lfoDUuB6Jibhbofy?= =?us-ascii?Q?9s81QrM8qt3rCVfGScJNqox/0o09jLRyavh5LC1yjjH1gV4FeAJhsXVsZHY4?= =?us-ascii?Q?3AgnDQhrghpXn6DZPVqKmllYyZiTHYjlREIGOK6RfRSbhS8u0iZ/NjYVDieE?= =?us-ascii?Q?FxgbZwFlJpkc6ARu8K+YsGELZAsvk0IhmD/aqxLrbQyaSx1t2UYPJP+Kh9Z8?= =?us-ascii?Q?SPk7hkYFlp2pOkIRJx4gKB8InnTsg2jH44aQiNPW/hHyji0l5cP9c2T7JLBX?= =?us-ascii?Q?k2baZnPf8NALY6SlMnUxhreqQQDI2H2cCVBzeWlwaglNx6XbMAMrhM38nqTn?= =?us-ascii?Q?0K/UrNn642iwbTlsENFy6W5UkD0RfEs+WPbvyeZMHoVbh4CL4JpJFJ9/obVr?= =?us-ascii?Q?TDU56x7E1jLSbjY2HxL4sZwQDyk7Dgh0U1ST56pPC9kk0J6onvknO7jSM0re?= =?us-ascii?Q?3cz2vXbFyWSaO+gpz+IZlihXqQv2lDvXTzdGwBEMXPh0C4qzaLltQconocRn?= =?us-ascii?Q?9k00i1Q9R5OxRROUYxEd91zlirdX1e8APWR2416u/JhOPNVGOXHq41WvHTs8?= =?us-ascii?Q?eOPKcNDpL7rA1lRM7NwhcWFTk+mQkt0RjYi2CGSEfw5fU2XuDOxZ4TTdxZT9?= =?us-ascii?Q?OgFJ52x9s/o0eF7OxiYORy4LTfd0042Q2lD0vRl7CwCs/qrh6tZ/kEXFKVBq?= =?us-ascii?Q?64CE/nd/b4yEe+hEzIWyKe9TjeE0kMjD7qcqjuxt2B9zeQ0R9qWfPC/y+7ND?= =?us-ascii?Q?74MWtSPqurDoKzpFiACGNy6eVZJFlPgqea5YfeIVspeapBOMS15Oh/wtjnWd?= =?us-ascii?Q?dRd/dsODq+y6OgTyuomtSRmmddoGpPhMKmMYdtCkgQBVmwTIBAvTJ5StR+lV?= =?us-ascii?Q?gSNyfcUFaFRjd3btsjW5P1FmbPcbPd8ovDOKmdxahvj20w/ViKPcuz4MkSPp?= =?us-ascii?Q?+zu4mcnRZ4HX0ZzUvjCFgPUCTf0pBIQ3nYpbMbt2rFocM7WgevRNJdo97FDx?= =?us-ascii?Q?wPJFqBuNRIi9IO+78bMX1VcTtX00TF7GsHcjbqMOcx9gEK02m3VNQlPwnQTf?= =?us-ascii?Q?sr4W8KeeO17ZKoHv0fz1dSR0/xgxEsMVffm9rnoUZ4L01cpVdYMIXMEjvtii?= =?us-ascii?Q?K0P+3zRWPqwafjo9UHRYoq9XB2kJFffvoytucTOUss5S58E5+6u4+0ZIP8vv?= =?us-ascii?Q?pEYnO1avx6/ZUHUmkfFw/ijFhyLGxJHXpEmE20oLCJ4zX94A0tbRjOmAI96H?= =?us-ascii?Q?nWRe/lMwdYfj7kI8Hjmk/3hcf2O5Bf6mKyQBxOio0?= X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3799; 6:IsXS6hKadMuSBxfBCruxDLYkL1TxFjp5FW2EJxSb3Ms99+yVhjUgxoQVM1dt1iU/X96sdZYHjHeqQp+1RtR6zUKFH2CRikYgUhlvN63v3VRJfEFirADkIl/QNOr5hjdqonREv3p7+XCEsdJCjM33cXAUmdDJvee8PEVzwADIe3SuByvrdFMwS6tQDxwbT0/lIui4VbZW3LgOi/1stifouz4AqbeOcAmkT3ILXuMtIe1Iu0TKijikxvfNVF6SznMWwZ5qd0Dq9GmbJ/dRYEUE/yAUHhhgf8ZPIUFexIdSYMpX9shllqwtdHgJwUa33VYrnLOeMYgCvowC4/k0QMmnE5bF7kPPPvgHVnXN3YXRwp0=; 5:ytfx+wdxYQsPejmduLFfmkLjXEifb4optKVTH4h6XbyyRm4bNP7IV2Z6W9E1lKo53qajyvXaoQkcFFnOc7ZneeFOJNyyvw6OlKF37KCx/dAsQOiZLEWnpaosM6jFv1YFTF90qpAF6pRlp68wQ0rGYJ/JMKeSQl2CF2PI/IUc5fQ=; 24:qYB6NEPjBHJ4E33hkE9rxqbubqdHhgOVm1CqQifw/Y+B3rOanZAlOgTK/43IaeDsYSSVbdRXmjvM65elV3QwX262UrMJjc3BiqUJusATXDw=; 7:KPyxD0kh2g7dp+S9bwQD13rsV2bzzVT0kFFAM+vDfDfcsHRQPY3rJtCftFUKl5kFNx3Y2b58edLo/IU1cvnaVOZchp8I/jUnYew4ZfZP2GuhERVYpgiS0wDLfqMxrA2UhfmrGjs6lVOmNRKydg2gvqae6KobYZYiNd4Memvxfr/B4AMNAlYph13NqAYvn0itGP26zcHGLBKwW7Vb0sCOOFw+ZAFB7AV2Tq3NGueEKChtKtxFYfYQBjveXL56HXGE SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2018 20:19:56.0047 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1039d97f-be4a-45c2-d183-08d55de7ad5f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0502MB3799 Subject: [dpdk-dev] [PATCH v5 4/6] ethdev: adjust APIs removal error report 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: , X-List-Received-Date: Wed, 17 Jan 2018 20:19:59 -0000 rte_eth_dev_is_removed API was added to detect a device removal synchronously. When a device removal occurs during control command execution, many different errors can be reported to the user. Adjust all ethdev APIs error reports to return -EIO in case of device removal using rte_eth_dev_is_removed API. Signed-off-by: Matan Azrad Acked-by: Thomas Monjalon --- lib/librte_ether/rte_ethdev.c | 192 +++++++++++++++++++++++++++--------------- lib/librte_ether/rte_ethdev.h | 51 ++++++++++- 2 files changed, 170 insertions(+), 73 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index c93cec1..7044159 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -338,6 +338,16 @@ struct rte_eth_dev * return -ENODEV; } +static int +eth_err(uint16_t port_id, int ret) +{ + if (ret == 0) + return 0; + if (rte_eth_dev_is_removed(port_id)) + return -EIO; + return ret; +} + /* attach the new device, then store port_id of the device */ int rte_eth_dev_attach(const char *devargs, uint16_t *port_id) @@ -492,7 +502,8 @@ struct rte_eth_dev * return 0; } - return dev->dev_ops->rx_queue_start(dev, rx_queue_id); + return eth_err(port_id, dev->dev_ops->rx_queue_start(dev, + rx_queue_id)); } @@ -518,7 +529,7 @@ struct rte_eth_dev * return 0; } - return dev->dev_ops->rx_queue_stop(dev, rx_queue_id); + return eth_err(port_id, dev->dev_ops->rx_queue_stop(dev, rx_queue_id)); } @@ -544,7 +555,8 @@ struct rte_eth_dev * return 0; } - return dev->dev_ops->tx_queue_start(dev, tx_queue_id); + return eth_err(port_id, dev->dev_ops->tx_queue_start(dev, + tx_queue_id)); } @@ -570,7 +582,7 @@ struct rte_eth_dev * return 0; } - return dev->dev_ops->tx_queue_stop(dev, tx_queue_id); + return eth_err(port_id, dev->dev_ops->tx_queue_stop(dev, tx_queue_id)); } @@ -888,7 +900,7 @@ struct rte_eth_dev * port_id, diag); rte_eth_dev_rx_queue_config(dev, 0); rte_eth_dev_tx_queue_config(dev, 0); - return diag; + return eth_err(port_id, diag); } /* Initialize Rx profiling if enabled at compilation time. */ @@ -898,7 +910,7 @@ struct rte_eth_dev * port_id, diag); rte_eth_dev_rx_queue_config(dev, 0); rte_eth_dev_tx_queue_config(dev, 0); - return diag; + return eth_err(port_id, diag); } return 0; @@ -998,7 +1010,7 @@ struct rte_eth_dev * if (diag == 0) dev->data->dev_started = 1; else - return diag; + return eth_err(port_id, diag); rte_eth_dev_config_restore(port_id); @@ -1040,7 +1052,7 @@ struct rte_eth_dev * dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_set_link_up, -ENOTSUP); - return (*dev->dev_ops->dev_set_link_up)(dev); + return eth_err(port_id, (*dev->dev_ops->dev_set_link_up)(dev)); } int @@ -1053,7 +1065,7 @@ struct rte_eth_dev * dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_set_link_down, -ENOTSUP); - return (*dev->dev_ops->dev_set_link_down)(dev); + return eth_err(port_id, (*dev->dev_ops->dev_set_link_down)(dev)); } void @@ -1090,7 +1102,7 @@ struct rte_eth_dev * rte_eth_dev_stop(port_id); ret = dev->dev_ops->dev_reset(dev); - return ret; + return eth_err(port_id, ret); } int @@ -1214,7 +1226,7 @@ struct rte_eth_dev * dev->data->min_rx_buf_size = mbp_buf_size; } - return ret; + return eth_err(port_id, ret); } /** @@ -1333,8 +1345,8 @@ struct rte_eth_dev * &local_conf.offloads); } - return (*dev->dev_ops->tx_queue_setup)(dev, tx_queue_id, nb_tx_desc, - socket_id, &local_conf); + return eth_err(port_id, (*dev->dev_ops->tx_queue_setup)(dev, + tx_queue_id, nb_tx_desc, socket_id, &local_conf)); } void @@ -1390,14 +1402,16 @@ struct rte_eth_dev * rte_eth_tx_done_cleanup(uint16_t port_id, uint16_t queue_id, uint32_t free_cnt) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + int ret; /* Validate Input Data. Bail if not valid or not supported. */ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_done_cleanup, -ENOTSUP); /* Call driver to free pending mbufs. */ - return (*dev->dev_ops->tx_done_cleanup)(dev->data->tx_queues[queue_id], - free_cnt); + ret = (*dev->dev_ops->tx_done_cleanup)(dev->data->tx_queues[queue_id], + free_cnt); + return eth_err(port_id, ret); } void @@ -1534,7 +1548,7 @@ struct rte_eth_dev * RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_get, -ENOTSUP); stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed; - return (*dev->dev_ops->stats_get)(dev, stats); + return eth_err(port_id, (*dev->dev_ops->stats_get)(dev, stats)); } int @@ -1580,12 +1594,12 @@ struct rte_eth_dev * count = (*dev->dev_ops->xstats_get_names_by_id)(dev, NULL, NULL, 0); if (count < 0) - return count; + return eth_err(port_id, count); } if (dev->dev_ops->xstats_get_names != NULL) { count = (*dev->dev_ops->xstats_get_names)(dev, NULL, 0); if (count < 0) - return count; + return eth_err(port_id, count); } else count = 0; @@ -1765,8 +1779,12 @@ struct rte_eth_dev * if (ids && no_ext_stat_requested) { rte_eth_basic_stats_get_names(dev, xstats_names_copy); } else { - rte_eth_xstats_get_names(port_id, xstats_names_copy, + ret = rte_eth_xstats_get_names(port_id, xstats_names_copy, expected_entries); + if (ret < 0) { + free(xstats_names_copy); + return ret; + } } /* Filter stats */ @@ -1813,7 +1831,7 @@ struct rte_eth_dev * xstats_names + cnt_used_entries, size - cnt_used_entries); if (cnt_driver_entries < 0) - return cnt_driver_entries; + return eth_err(port_id, cnt_driver_entries); cnt_used_entries += cnt_driver_entries; } @@ -1829,8 +1847,12 @@ struct rte_eth_dev * unsigned int count = 0, i, q; uint64_t val, *stats_ptr; uint16_t nb_rxqs, nb_txqs; + int ret; + + ret = rte_eth_stats_get(port_id, ð_stats); + if (ret < 0) + return ret; - rte_eth_stats_get(port_id, ð_stats); dev = &rte_eth_devices[port_id]; nb_rxqs = RTE_MIN(dev->data->nb_rx_queues, RTE_ETHDEV_QUEUE_STAT_CNTRS); @@ -1883,7 +1905,10 @@ struct rte_eth_dev * int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); - expected_entries = get_xstats_count(port_id); + ret = get_xstats_count(port_id); + if (ret < 0) + return ret; + expected_entries = (uint16_t)ret; struct rte_eth_xstat xstats[expected_entries]; dev = &rte_eth_devices[port_id]; basic_count = get_xstats_basic_count(dev); @@ -1966,6 +1991,7 @@ struct rte_eth_dev * unsigned int count = 0, i; signed int xcount = 0; uint16_t nb_rxqs, nb_txqs; + int ret; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); @@ -1988,14 +2014,17 @@ struct rte_eth_dev * (n > count) ? n - count : 0); if (xcount < 0) - return xcount; + return eth_err(port_id, xcount); } if (n < count + xcount || xstats == NULL) return count + xcount; /* now fill the xstats structure */ - count = rte_eth_basic_stats_get(port_id, xstats); + ret = rte_eth_basic_stats_get(port_id, xstats); + if (ret < 0) + return ret; + count = ret; for (i = 0; i < count; i++) xstats[i].id = i; @@ -2045,8 +2074,8 @@ struct rte_eth_dev * rte_eth_dev_set_tx_queue_stats_mapping(uint16_t port_id, uint16_t tx_queue_id, uint8_t stat_idx) { - return set_queue_stats_mapping(port_id, tx_queue_id, stat_idx, - STAT_QMAP_TX); + return eth_err(port_id, set_queue_stats_mapping(port_id, tx_queue_id, + stat_idx, STAT_QMAP_TX)); } @@ -2054,8 +2083,8 @@ struct rte_eth_dev * rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, uint16_t rx_queue_id, uint8_t stat_idx) { - return set_queue_stats_mapping(port_id, rx_queue_id, stat_idx, - STAT_QMAP_RX); + return eth_err(port_id, set_queue_stats_mapping(port_id, rx_queue_id, + stat_idx, STAT_QMAP_RX)); } int @@ -2067,7 +2096,8 @@ struct rte_eth_dev * dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->fw_version_get, -ENOTSUP); - return (*dev->dev_ops->fw_version_get)(dev, fw_version, fw_size); + return eth_err(port_id, (*dev->dev_ops->fw_version_get)(dev, + fw_version, fw_size)); } void @@ -2157,7 +2187,7 @@ struct rte_eth_dev * if (!ret) dev->data->mtu = mtu; - return ret; + return eth_err(port_id, ret); } int @@ -2197,7 +2227,7 @@ struct rte_eth_dev * vfc->ids[vidx] &= ~(UINT64_C(1) << vbit); } - return ret; + return eth_err(port_id, ret); } int @@ -2230,7 +2260,8 @@ struct rte_eth_dev * dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->vlan_tpid_set, -ENOTSUP); - return (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, tpid); + return eth_err(port_id, (*dev->dev_ops->vlan_tpid_set)(dev, vlan_type, + tpid)); } int @@ -2308,7 +2339,7 @@ struct rte_eth_dev * &dev->data->dev_conf.rxmode); } - return ret; + return eth_err(port_id, ret); } int @@ -2343,9 +2374,8 @@ struct rte_eth_dev * 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->vlan_pvid_set, -ENOTSUP); - (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on); - return 0; + return eth_err(port_id, (*dev->dev_ops->vlan_pvid_set)(dev, pvid, on)); } int @@ -2357,7 +2387,7 @@ struct rte_eth_dev * dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->flow_ctrl_get, -ENOTSUP); memset(fc_conf, 0, sizeof(*fc_conf)); - return (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf); + return eth_err(port_id, (*dev->dev_ops->flow_ctrl_get)(dev, fc_conf)); } int @@ -2373,7 +2403,7 @@ struct rte_eth_dev * dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->flow_ctrl_set, -ENOTSUP); - return (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf); + return eth_err(port_id, (*dev->dev_ops->flow_ctrl_set)(dev, fc_conf)); } int @@ -2391,7 +2421,8 @@ struct rte_eth_dev * dev = &rte_eth_devices[port_id]; /* High water, low water validation are device specific */ if (*dev->dev_ops->priority_flow_ctrl_set) - return (*dev->dev_ops->priority_flow_ctrl_set)(dev, pfc_conf); + return eth_err(port_id, (*dev->dev_ops->priority_flow_ctrl_set) + (dev, pfc_conf)); return -ENOTSUP; } @@ -2466,7 +2497,8 @@ struct rte_eth_dev * return ret; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->reta_update, -ENOTSUP); - return (*dev->dev_ops->reta_update)(dev, reta_conf, reta_size); + return eth_err(port_id, (*dev->dev_ops->reta_update)(dev, reta_conf, + reta_size)); } int @@ -2486,7 +2518,8 @@ struct rte_eth_dev * dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->reta_query, -ENOTSUP); - return (*dev->dev_ops->reta_query)(dev, reta_conf, reta_size); + return eth_err(port_id, (*dev->dev_ops->reta_query)(dev, reta_conf, + reta_size)); } int @@ -2498,7 +2531,8 @@ struct rte_eth_dev * 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->rss_hash_update, -ENOTSUP); - return (*dev->dev_ops->rss_hash_update)(dev, rss_conf); + return eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev, + rss_conf)); } int @@ -2510,7 +2544,8 @@ struct rte_eth_dev * 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->rss_hash_conf_get, -ENOTSUP); - return (*dev->dev_ops->rss_hash_conf_get)(dev, rss_conf); + return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, + rss_conf)); } int @@ -2532,7 +2567,8 @@ struct rte_eth_dev * dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->udp_tunnel_port_add, -ENOTSUP); - return (*dev->dev_ops->udp_tunnel_port_add)(dev, udp_tunnel); + return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_add)(dev, + udp_tunnel)); } int @@ -2555,7 +2591,8 @@ struct rte_eth_dev * } RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->udp_tunnel_port_del, -ENOTSUP); - return (*dev->dev_ops->udp_tunnel_port_del)(dev, udp_tunnel); + return eth_err(port_id, (*dev->dev_ops->udp_tunnel_port_del)(dev, + udp_tunnel)); } int @@ -2566,7 +2603,7 @@ struct rte_eth_dev * 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_led_on, -ENOTSUP); - return (*dev->dev_ops->dev_led_on)(dev); + return eth_err(port_id, (*dev->dev_ops->dev_led_on)(dev)); } int @@ -2577,7 +2614,7 @@ struct rte_eth_dev * 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_led_off, -ENOTSUP); - return (*dev->dev_ops->dev_led_off)(dev); + return eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev)); } /* @@ -2653,7 +2690,7 @@ struct rte_eth_dev * dev->data->mac_pool_sel[index] |= (1ULL << pool); } - return ret; + return eth_err(port_id, ret); } int @@ -2779,7 +2816,7 @@ struct rte_eth_dev * &dev->data->hash_mac_addrs[index]); } - return ret; + return eth_err(port_id, ret); } int @@ -2792,7 +2829,8 @@ struct rte_eth_dev * dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->uc_all_hash_table_set, -ENOTSUP); - return (*dev->dev_ops->uc_all_hash_table_set)(dev, on); + return eth_err(port_id, (*dev->dev_ops->uc_all_hash_table_set)(dev, + on)); } int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, @@ -2822,7 +2860,8 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, } RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_queue_rate_limit, -ENOTSUP); - return (*dev->dev_ops->set_queue_rate_limit)(dev, queue_idx, tx_rate); + return eth_err(port_id, (*dev->dev_ops->set_queue_rate_limit)(dev, + queue_idx, tx_rate)); } int @@ -2860,7 +2899,8 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mirror_rule_set, -ENOTSUP); - return (*dev->dev_ops->mirror_rule_set)(dev, mirror_conf, rule_id, on); + return eth_err(port_id, (*dev->dev_ops->mirror_rule_set)(dev, + mirror_conf, rule_id, on)); } int @@ -2873,7 +2913,8 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->mirror_rule_reset, -ENOTSUP); - return (*dev->dev_ops->mirror_rule_reset)(dev, rule_id); + return eth_err(port_id, (*dev->dev_ops->mirror_rule_reset)(dev, + rule_id)); } RTE_INIT(eth_dev_init_cb_lists) @@ -3137,7 +3178,8 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_intr_enable, -ENOTSUP); - return (*dev->dev_ops->rx_queue_intr_enable)(dev, queue_id); + return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_enable)(dev, + queue_id)); } int @@ -3151,7 +3193,8 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_queue_intr_disable, -ENOTSUP); - return (*dev->dev_ops->rx_queue_intr_disable)(dev, queue_id); + return eth_err(port_id, (*dev->dev_ops->rx_queue_intr_disable)(dev, + queue_id)); } @@ -3179,7 +3222,8 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->filter_ctrl, -ENOTSUP); - return (*dev->dev_ops->filter_ctrl)(dev, filter_type, filter_op, arg); + return eth_err(port_id, (*dev->dev_ops->filter_ctrl)(dev, filter_type, + filter_op, arg)); } void * @@ -3429,7 +3473,8 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_mc_addr_list, -ENOTSUP); - return dev->dev_ops->set_mc_addr_list(dev, mc_addr_set, nb_mc_addr); + return eth_err(port_id, dev->dev_ops->set_mc_addr_list(dev, + mc_addr_set, nb_mc_addr)); } int @@ -3441,7 +3486,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->timesync_enable, -ENOTSUP); - return (*dev->dev_ops->timesync_enable)(dev); + return eth_err(port_id, (*dev->dev_ops->timesync_enable)(dev)); } int @@ -3453,7 +3498,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->timesync_disable, -ENOTSUP); - return (*dev->dev_ops->timesync_disable)(dev); + return eth_err(port_id, (*dev->dev_ops->timesync_disable)(dev)); } int @@ -3466,7 +3511,8 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->timesync_read_rx_timestamp, -ENOTSUP); - return (*dev->dev_ops->timesync_read_rx_timestamp)(dev, timestamp, flags); + return eth_err(port_id, (*dev->dev_ops->timesync_read_rx_timestamp) + (dev, timestamp, flags)); } int @@ -3479,7 +3525,8 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->timesync_read_tx_timestamp, -ENOTSUP); - return (*dev->dev_ops->timesync_read_tx_timestamp)(dev, timestamp); + return eth_err(port_id, (*dev->dev_ops->timesync_read_tx_timestamp) + (dev, timestamp)); } int @@ -3491,7 +3538,8 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->timesync_adjust_time, -ENOTSUP); - return (*dev->dev_ops->timesync_adjust_time)(dev, delta); + return eth_err(port_id, (*dev->dev_ops->timesync_adjust_time)(dev, + delta)); } int @@ -3503,7 +3551,8 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->timesync_read_time, -ENOTSUP); - return (*dev->dev_ops->timesync_read_time)(dev, timestamp); + return eth_err(port_id, (*dev->dev_ops->timesync_read_time)(dev, + timestamp)); } int @@ -3515,7 +3564,8 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->timesync_write_time, -ENOTSUP); - return (*dev->dev_ops->timesync_write_time)(dev, timestamp); + return eth_err(port_id, (*dev->dev_ops->timesync_write_time)(dev, + timestamp)); } int @@ -3527,7 +3577,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_reg, -ENOTSUP); - return (*dev->dev_ops->get_reg)(dev, info); + return eth_err(port_id, (*dev->dev_ops->get_reg)(dev, info)); } int @@ -3539,7 +3589,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_eeprom_length, -ENOTSUP); - return (*dev->dev_ops->get_eeprom_length)(dev); + return eth_err(port_id, (*dev->dev_ops->get_eeprom_length)(dev)); } int @@ -3551,7 +3601,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_eeprom, -ENOTSUP); - return (*dev->dev_ops->get_eeprom)(dev, info); + return eth_err(port_id, (*dev->dev_ops->get_eeprom)(dev, info)); } int @@ -3563,7 +3613,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_eeprom, -ENOTSUP); - return (*dev->dev_ops->set_eeprom)(dev, info); + return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); } int @@ -3578,7 +3628,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, memset(dcb_info, 0, sizeof(struct rte_eth_dcb_info)); RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_dcb_info, -ENOTSUP); - return (*dev->dev_ops->get_dcb_info)(dev, dcb_info); + return eth_err(port_id, (*dev->dev_ops->get_dcb_info)(dev, dcb_info)); } int @@ -3601,7 +3651,8 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->l2_tunnel_eth_type_conf, -ENOTSUP); - return (*dev->dev_ops->l2_tunnel_eth_type_conf)(dev, l2_tunnel); + return eth_err(port_id, (*dev->dev_ops->l2_tunnel_eth_type_conf)(dev, + l2_tunnel)); } int @@ -3632,7 +3683,8 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->l2_tunnel_offload_set, -ENOTSUP); - return (*dev->dev_ops->l2_tunnel_offload_set)(dev, l2_tunnel, mask, en); + return eth_err(port_id, (*dev->dev_ops->l2_tunnel_offload_set)(dev, + l2_tunnel, mask, en)); } static void diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index da0c5cf..9a2e1f6 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -2020,6 +2020,7 @@ int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue, * memory buffers to populate each descriptor of the receive ring. * @return * - 0: Success, receive queue correctly set up. + * - -EIO: if device is removed. * - -EINVAL: The size of network buffers which can be allocated from the * memory pool does not fit the various buffer sizes allowed by the * device controller. @@ -2120,6 +2121,7 @@ int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, * @return * - 0: Success, the receive queue is started. * - -EINVAL: The port_id or the queue_id out of range. + * - -EIO: if device is removed. * - -ENOTSUP: The function not supported in PMD driver. */ int rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id); @@ -2136,6 +2138,7 @@ int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, * @return * - 0: Success, the receive queue is stopped. * - -EINVAL: The port_id or the queue_id out of range. + * - -EIO: if device is removed. * - -ENOTSUP: The function not supported in PMD driver. */ int rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id); @@ -2153,6 +2156,7 @@ int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, * @return * - 0: Success, the transmit queue is started. * - -EINVAL: The port_id or the queue_id out of range. + * - -EIO: if device is removed. * - -ENOTSUP: The function not supported in PMD driver. */ int rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id); @@ -2169,6 +2173,7 @@ int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, * @return * - 0: Success, the transmit queue is stopped. * - -EINVAL: The port_id or the queue_id out of range. + * - -EIO: if device is removed. * - -ENOTSUP: The function not supported in PMD driver. */ int rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id); @@ -2270,7 +2275,7 @@ int rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, * - (-EINVAL) if port identifier is invalid. * - (-ENOTSUP) if hardware doesn't support this function. * - (-EPERM) if not ran from the primary process. - * - (-EIO) if re-initialisation failed. + * - (-EIO) if re-initialisation failed or device is removed. * - (-ENOMEM) if the reset failed due to OOM. * - (-EAGAIN) if the reset temporarily failed and should be retried later. */ @@ -2506,6 +2511,7 @@ int rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, * @return * 0 on success * -ENODEV for invalid port_id, + * -EIO if device is removed, * -EINVAL if the xstat_name doesn't exist in port_id */ int rte_eth_xstats_get_id_by_name(uint16_t port_id, const char *xstat_name, @@ -2597,6 +2603,7 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, * - (0) if successful. * - (-ENOTSUP) if operation is not supported. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. * - (>0) if *fw_size* is not enough to store firmware version, return * the size of the non truncated string. */ @@ -2668,6 +2675,7 @@ int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, * - (0) if successful. * - (-ENOTSUP) if operation is not supported. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. * - (-EINVAL) if *mtu* invalid. * - (-EBUSY) if operation is not allowed when the port is running */ @@ -2688,6 +2696,7 @@ int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, * - (0) if successful. * - (-ENOSUP) if hardware-assisted VLAN filtering not configured. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. * - (-ENOSYS) if VLAN filtering on *port_id* disabled. * - (-EINVAL) if *vlan_id* > 4095. */ @@ -2730,6 +2739,7 @@ int rte_eth_dev_set_vlan_strip_on_queue(uint16_t port_id, uint16_t rx_queue_id, * - (0) if successful. * - (-ENOSUP) if hardware-assisted VLAN TPID setup is not supported. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. */ int rte_eth_dev_set_vlan_ether_type(uint16_t port_id, enum rte_vlan_type vlan_type, @@ -2754,6 +2764,7 @@ int rte_eth_dev_set_vlan_ether_type(uint16_t port_id, * - (0) if successful. * - (-ENOSUP) if hardware-assisted VLAN filtering not configured. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. */ int rte_eth_dev_set_vlan_offload(uint16_t port_id, int offload_mask); @@ -3495,6 +3506,7 @@ struct rte_eth_dev_tx_buffer { * @return * Failure: < 0 * -ENODEV: Invalid interface + * -EIO: device is removed * -ENOTSUP: Driver does not support function * Success: >= 0 * 0-n: Number of packets freed. More packets may still remain in ring that @@ -3609,6 +3621,7 @@ int _rte_eth_dev_callback_process(struct rte_eth_dev *dev, * - (-ENOTSUP) if underlying hardware OR driver doesn't support * that operation. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. */ int rte_eth_dev_rx_intr_enable(uint16_t port_id, uint16_t queue_id); @@ -3630,6 +3643,7 @@ int _rte_eth_dev_callback_process(struct rte_eth_dev *dev, * - (-ENOTSUP) if underlying hardware OR driver doesn't support * that operation. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. */ int rte_eth_dev_rx_intr_disable(uint16_t port_id, uint16_t queue_id); @@ -3687,6 +3701,7 @@ int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, * - (-ENOTSUP) if underlying hardware OR driver doesn't support * that operation. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. */ int rte_eth_led_on(uint16_t port_id); @@ -3701,6 +3716,7 @@ int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, * - (-ENOTSUP) if underlying hardware OR driver doesn't support * that operation. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. */ int rte_eth_led_off(uint16_t port_id); @@ -3715,6 +3731,7 @@ int rte_eth_dev_rx_intr_ctl_q(uint16_t port_id, uint16_t queue_id, * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support flow control. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. */ int rte_eth_dev_flow_ctrl_get(uint16_t port_id, struct rte_eth_fc_conf *fc_conf); @@ -3731,7 +3748,7 @@ int rte_eth_dev_flow_ctrl_get(uint16_t port_id, * - (-ENOTSUP) if hardware doesn't support flow control mode. * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter - * - (-EIO) if flow control setup failure + * - (-EIO) if flow control setup failure or device is removed. */ int rte_eth_dev_flow_ctrl_set(uint16_t port_id, struct rte_eth_fc_conf *fc_conf); @@ -3749,7 +3766,7 @@ int rte_eth_dev_flow_ctrl_set(uint16_t port_id, * - (-ENOTSUP) if hardware doesn't support priority flow control mode. * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if bad parameter - * - (-EIO) if flow control setup failure + * - (-EIO) if flow control setup failure or device is removed. */ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, struct rte_eth_pfc_conf *pfc_conf); @@ -3769,6 +3786,7 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, * - (0) if successfully added or *mac_addr" was already added. * - (-ENOTSUP) if hardware doesn't support this feature. * - (-ENODEV) if *port* is invalid. + * - (-EIO) if device is removed. * - (-ENOSPC) if no more MAC addresses can be added. * - (-EINVAL) if MAC address is invalid. */ @@ -3820,6 +3838,7 @@ int rte_eth_dev_default_mac_addr_set(uint16_t port, * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. + * - (-EIO) if device is removed. */ int rte_eth_dev_rss_reta_update(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, @@ -3839,6 +3858,7 @@ int rte_eth_dev_rss_reta_update(uint16_t port, * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. + * - (-EIO) if device is removed. */ int rte_eth_dev_rss_reta_query(uint16_t port, struct rte_eth_rss_reta_entry64 *reta_conf, @@ -3860,6 +3880,7 @@ int rte_eth_dev_rss_reta_query(uint16_t port, * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. * - (-EINVAL) if bad parameter. */ int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr, @@ -3880,6 +3901,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr, * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. * - (-EINVAL) if bad parameter. */ int rte_eth_dev_uc_all_hash_table_set(uint16_t port, uint8_t on); @@ -3903,6 +3925,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port, struct ether_addr *addr, * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support this feature. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. * - (-EINVAL) if the mr_conf information is not correct. */ int rte_eth_mirror_rule_set(uint16_t port_id, @@ -3921,6 +3944,7 @@ int rte_eth_mirror_rule_set(uint16_t port_id, * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support this feature. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. * - (-EINVAL) if bad parameter. */ int rte_eth_mirror_rule_reset(uint16_t port_id, @@ -3939,6 +3963,7 @@ int rte_eth_mirror_rule_reset(uint16_t port_id, * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support this feature. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. * - (-EINVAL) if bad parameter. */ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, @@ -3954,6 +3979,7 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, * @return * - (0) if successful. * - (-ENODEV) if port identifier is invalid. + * - (-EIO) if device is removed. * - (-ENOTSUP) if hardware doesn't support. * - (-EINVAL) if bad parameter. */ @@ -3971,6 +3997,7 @@ int rte_eth_dev_rss_hash_update(uint16_t port_id, * @return * - (0) if successful. * - (-ENODEV) if port identifier is invalid. + * - (-EIO) if device is removed. * - (-ENOTSUP) if hardware doesn't support RSS. */ int @@ -3992,6 +4019,7 @@ int rte_eth_dev_rss_hash_update(uint16_t port_id, * @return * - (0) if successful. * - (-ENODEV) if port identifier is invalid. + * - (-EIO) if device is removed. * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int @@ -4014,6 +4042,7 @@ int rte_eth_dev_rss_hash_update(uint16_t port_id, * @return * - (0) if successful. * - (-ENODEV) if port identifier is invalid. + * - (-EIO) if device is removed. * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int @@ -4032,6 +4061,7 @@ int rte_eth_dev_rss_hash_update(uint16_t port_id, * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support this filter type. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. */ int rte_eth_dev_filter_supported(uint16_t port_id, enum rte_filter_type filter_type); @@ -4052,6 +4082,7 @@ int rte_eth_dev_filter_supported(uint16_t port_id, * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. * - others depends on the specific operations implementation. */ int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, @@ -4067,6 +4098,7 @@ int rte_eth_dev_filter_ctrl(uint16_t port_id, enum rte_filter_type filter_type, * @return * - (0) if successful. * - (-ENODEV) if port identifier is invalid. + * - (-EIO) if device is removed. * - (-ENOTSUP) if hardware doesn't support. */ int rte_eth_dev_get_dcb_info(uint16_t port_id, @@ -4274,6 +4306,7 @@ int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. * - others depends on the specific operations implementation. */ int rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info); @@ -4287,6 +4320,7 @@ int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, * - (>=0) EEPROM size if successful. * - (-ENOTSUP) if hardware doesn't support. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. * - others depends on the specific operations implementation. */ int rte_eth_dev_get_eeprom_length(uint16_t port_id); @@ -4303,6 +4337,7 @@ int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. * - others depends on the specific operations implementation. */ int rte_eth_dev_get_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info); @@ -4319,6 +4354,7 @@ int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, * - (0) if successful. * - (-ENOTSUP) if hardware doesn't support. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. * - others depends on the specific operations implementation. */ int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info); @@ -4337,6 +4373,7 @@ int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, * @return * - (0) if successful. * - (-ENODEV) if *port_id* invalid. + * - (-EIO) if device is removed. * - (-ENOTSUP) if PMD of *port_id* doesn't support multicast filtering. * - (-ENOSPC) if *port_id* has not enough multicast filtering resources. */ @@ -4353,6 +4390,7 @@ int rte_eth_dev_set_mc_addr_list(uint16_t port_id, * @return * - 0: Success. * - -ENODEV: The port ID is invalid. + * - -EIO: if device is removed. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ int rte_eth_timesync_enable(uint16_t port_id); @@ -4366,6 +4404,7 @@ int rte_eth_dev_set_mc_addr_list(uint16_t port_id, * @return * - 0: Success. * - -ENODEV: The port ID is invalid. + * - -EIO: if device is removed. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ int rte_eth_timesync_disable(uint16_t port_id); @@ -4385,6 +4424,7 @@ int rte_eth_dev_set_mc_addr_list(uint16_t port_id, * - 0: Success. * - -EINVAL: No timestamp is available. * - -ENODEV: The port ID is invalid. + * - -EIO: if device is removed. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ int rte_eth_timesync_read_rx_timestamp(uint16_t port_id, @@ -4402,6 +4442,7 @@ int rte_eth_timesync_read_rx_timestamp(uint16_t port_id, * - 0: Success. * - -EINVAL: No timestamp is available. * - -ENODEV: The port ID is invalid. + * - -EIO: if device is removed. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, @@ -4421,6 +4462,7 @@ int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, * @return * - 0: Success. * - -ENODEV: The port ID is invalid. + * - -EIO: if device is removed. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ int rte_eth_timesync_adjust_time(uint16_t port_id, int64_t delta); @@ -4456,6 +4498,7 @@ int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, * - 0: Success. * - -EINVAL: No timestamp is available. * - -ENODEV: The port ID is invalid. + * - -EIO: if device is removed. * - -ENOTSUP: The function is not supported by the Ethernet driver. */ int rte_eth_timesync_write_time(uint16_t port_id, const struct timespec *time); @@ -4496,6 +4539,7 @@ int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, * @return * - (0) if successful. * - (-ENODEV) if port identifier is invalid. + * - (-EIO) if device is removed. * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int @@ -4523,6 +4567,7 @@ int rte_eth_timesync_read_tx_timestamp(uint16_t port_id, * @return * - (0) if successful. * - (-ENODEV) if port identifier is invalid. + * - (-EIO) if device is removed. * - (-ENOTSUP) if hardware doesn't support tunnel type. */ int -- 1.8.3.1