From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40059.outbound.protection.outlook.com [40.107.4.59]) by dpdk.org (Postfix) with ESMTP id B05BDA499 for ; Sat, 20 Jan 2018 22:12:49 +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=SWDAAbtj3Yb9kxarSWaNd0Y2INJyoh+V0H0dZ+4RR/M=; b=JlL/vcNlSn8pBX9yFGAKgvF5txmh0dCE7KxgvwSuTtaaW2Nw78XfcsOpyykQJQga3+ewFMseper8fI830weO8MwgVcqLyN8+h8lH6tHq8WLaAD6H2nFgyRvkVNg4EcsMySSTivdAe15mcuuCm+cpNHxbhoEaNV8qzMEg3ihsi0E= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR0502MB3804.eurprd05.prod.outlook.com (2603:10a6:7:86::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Sat, 20 Jan 2018 21:12:47 +0000 From: Matan Azrad To: Ferruh Yigit , Adrien Mazarguil , Gaetan Rivet Cc: Thomas Monjalon , dev@dpdk.org Date: Sat, 20 Jan 2018 21:12:22 +0000 Message-Id: <1516482744-8415-5-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1516482744-8415-1-git-send-email-matan@mellanox.com> References: <1516274834-19755-1-git-send-email-matan@mellanox.com> <1516482744-8415-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0502CA0035.eurprd05.prod.outlook.com (2603:10a6:803:1::48) To HE1PR0502MB3804.eurprd05.prod.outlook.com (2603:10a6:7:86::30) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 52d990a9-e23b-45eb-48c5-08d5604a8ed8 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020); SRVR:HE1PR0502MB3804; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3804; 3:KH19P9xnqovE+TbFKgYGI5TEBw0oyakAiecEWXCrZqG2I5CDVBpfgDZEZIrWo9qfHzoOGwxhpnP5XWrp4/IZIBK7suXDL5d3ecVXVkyS8v4h5FX5etWqyBdqQCgrVr4x0/TeGSd4vzN8ViluW81y/7bFtp/5h1k09VHhbznm1RO/EKio8mjoK7/a/BrY3vKZgwCb8SFWGfxy30/cJwaAT1u6eFLFrEkIm6oKANYUPEfZ46Bfj+IXtNTeezLH8HF4; 25:EZB3CpEONZMY0MIDOtJ/twiRbkhvbDP5PddoWltZyk7bsTfdBgyugmnyd5PyGeMWy1mfBasM4T798QLhK+XgRu9MOSUMGzRObDNohSiLOOQGkni0rWxpntvVZjLtIxE2ONFc88FStshiKLUJOLRxgmcU55OjknITFln9SsPuz9GIXTc+H2Dza9cbwjaJqjJJxrvPb1C/XBG31SPyLCftXEJYT/oUosEeRNXf8Yc3Uoiz9L9zu/bMFhee7VLcS7chy4P/OPY3vxfUEgKSQR3zT0iFMqUBSUyzBF/RZY3ysTycjoPuxUxO7Tvwl5pBi+V232f7q3/9sq5UJHv9rQKkAg==; 31:GRraZif1xsp9CaSAv98lNLlV/WY8YCbrWYDCt4HHjIf9THJ3jtC5upV6w99VZbjCsueS2eNO9ubB0jccYhCnUuSVKVbGk6DFkEmtLhf4JarIHpWVguQuDojUH03hLe1VvhsV8XT9fwmtR5IvDhjvYuR52lvi7RLfrZmbvlTDQBi0WdB4HdoOOJuLvk8+xZ2KFVAaQiAc6s766FTLjIzAkIWMo0twMkbRCpS/mA+eJSU= X-MS-TrafficTypeDiagnostic: HE1PR0502MB3804: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3804; 20:sd1rNVCc7GtYI5F7Tl9TJtmSsxkYA/63sYxizpYF4Q+GObRYV8hDoyt+D1/Jm/EsAodmOSXFm6y5/YgxA/BWL3M0HCxIWwNIMdRvWbcCfFRpg1Zj1CqSuyJ4wysQ/VIz2ZfH4LJELBbf9Lbg/wUNLEHvo9jWT0O1MRXrCWcZ3/jMehZKxJSpyrAe0fRNDsJKSsFFwfQ7IrDOqMyaeCkUqcidFNO4c/VRlBRtsPsuTAaepuz+EJ77O3JNzPwsdc3sici8VCyszON7ThGgL85roR32BJWL1fw/T0s+2wIdQ7Q939oUegbHg4qp+C1kP5CZqfFaxFZcRb9haSxtBqVFPQobLXGHddDiOpqIJ3OdA/smw/KkTDxYXG+kf+wubNv9LRqlfR5mtcacNEke7X/gc+6QRK7k19UzwGRIpNwfmi3W0DHjs/9qr+mixiegzrVOFuttdWXwyXV4pS4n0Qs/w3+xPSr2u2mHE9LBkST6tZMY/ogTZqId5s+3mO+3DSLi; 4:EgNi0lnHwvhRvUABxArrJX1oZprDOHCgb6W4qcjZRevNiAv4jmhtuM8yJ5L6Rr+6sACO1l0QPsG336Ps8mDadQXUtxReYMWek8yOWgfYk5IPasDbCRoAijno2ZgVSImHIX1Yd3Ur2PU7gawS/VS0aY/ufiAxjpWEJ3s7IlziUD9D94ZGMEE4Ckyo4UMWNED0TuNuaYXbGNCZ56BAvUCBe7r07CaD+AC1LeFNIn1i3Uvo334pgnpHK/z7B6yTPPM89+d3kUFYEbIexjkUJNaDdsv1IBOxyuVu5gKIDRhyGaMElkI4hFvx8onVrNzwrs+i X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(20558992708506); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(3231023)(2400081)(944501161)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041288)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:HE1PR0502MB3804; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR0502MB3804; X-Forefront-PRVS: 0558D3C5AC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(366004)(346002)(396003)(39380400002)(39860400002)(199004)(189003)(36756003)(47776003)(2906002)(4326008)(5660300001)(6116002)(478600001)(25786009)(50226002)(81156014)(59450400001)(16526018)(316002)(16586007)(51416003)(7696005)(76176011)(3846002)(52116002)(110136005)(33026002)(81166006)(386003)(7736002)(106356001)(105586002)(8936002)(8676002)(305945005)(66066001)(97736004)(53936002)(26005)(86362001)(55016002)(4720700003)(21086003)(48376002)(68736007)(5890100001)(53946003)(50466002)(6666003)(69596002)(2950100002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0502MB3804; 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; HE1PR0502MB3804; 23:wcYG/MDQlrG/x6lQYGBMAcYsNbfLW2OtRO/TOzW?= =?us-ascii?Q?TKROxdn6BQ9kZfao3F/0eWRRnAiv5qQfNiZr6Z7uBUnJxjwETaojOrAO6dIh?= =?us-ascii?Q?/VN+BaNiNjzNoaAXg8zwSIh8OrE3CuKlQ6hl1Mz0l0orjA0j93oxgdHEE/YL?= =?us-ascii?Q?j2Gly4W37rU4hkXeWGNk0ovcKi76JnX8W920UWpIMZc2te20CjaX+o0RQGOk?= =?us-ascii?Q?nTJ/elTPqjw19lbgpt4tESDHEdWfKIOyJwd5ZXmj++f5sJQn0mYvYaZRpwEy?= =?us-ascii?Q?UuUjgqvImqUSfTDS8lxp6WYwiVXmpHbCkvDXXmWVrQu2jnIVQatWbs++Imyo?= =?us-ascii?Q?P7gTWFvn9uiqTieg7xPZO1VEX9w501ZHF7MTvTDbxiE4I2+0Y3mFSzFpOmT2?= =?us-ascii?Q?xkeaRsaCef7x7NrHDx9aHuTarLvtnnWlqIv8j+TTImT7l2SEFs/iNcF1Q1LQ?= =?us-ascii?Q?g17JhPOyDjLjpBWm5oYpS2G3YwwtEyLL1QatSF7G071bHOsg/6tFnCqhoCsD?= =?us-ascii?Q?h6I78qlbl76vmmdHl4ygI3AGHhsZpAlpFFJrjgwDm9E5GF94i4dX2xtPwYAj?= =?us-ascii?Q?BNJ1ZRBuPl7GRnI1WrFsA9E/ntOaGEQrlUGjl+krq33au/qHrfBEihbffmeY?= =?us-ascii?Q?pACjT2WoyrIVbiiC/b7+yPM3vU80JomhrQFThwlYXbXKS9yxu351Y0981Ld6?= =?us-ascii?Q?EENLbJfDXi4aUmV9qtDe/6s+PEIKlhsbrgbNOGJV3J9rN+o8wtDKbnBSYBfD?= =?us-ascii?Q?t5G0xSZLji5tVM1NUJOAHeQUxn0YfpiYEC20O3dJzqQy0IhL03U6hmaYR4dC?= =?us-ascii?Q?lAXvVJ5jsBfzTAEJoB0JO+FtIPSYmpboweCZmwhyyll3iuBxjF9HHEzBYUa8?= =?us-ascii?Q?zqGqcQmB4zHVi2Ypag5RuBRcJo9meh6ynD8yxpv78a6yJ/vM/Rj3oQ9Qg7JB?= =?us-ascii?Q?sHWN+rJcyO+OdaIyumBquPBXGztHAfbzi0/Bv3XINfxQD1VRmuj5g+D/XCrx?= =?us-ascii?Q?kzPny6/lRli39ajPORTX/9G5kMQqo9SRjaTUdkMW1shSKB3HQxxOY4uk8E3Z?= =?us-ascii?Q?SozlP/Q9K9H546DWQBg9f0gy3qyABpffSKhh6wmqS7t5F73rGiOMk+gwFqU7?= =?us-ascii?Q?gThw4LyK+UZ5yxn13hPYy6XdYpHIBm2CCLcHhms2LYQmfRmbnodUztRL7sVb?= =?us-ascii?Q?O9+f/9wJwlnkDuZcd5EaD6PLq1Kj8L0RAiCTPpm91+OIXcvNN/KPkFFbKmQ?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3804; 6:iHajxGHfCJnzlwU2u978c/5Thp6selGE4u+UQArcCJ7+Ef30Zbxh+CYbvj3rL3GUXMktl4b0dQwZAZrXiJUXFTQuPCi9xI1PrXLr5keCxXtOc+kAoGHsIYIQLFqcHeoL27yAJWQZfRUm5PZIpJsKJYD8PwyT0T8qwhOiexiaLpTfDVtSqRKE89ENILco+AsfBur4nT0/KCTGFke9WUjoaLrVDcK1ac2KmptdFsAkPtDihs76CIkfMnx0Yj//6crQgX+tcUL3qgmHgicX45fklI2IEk5X7J3fFm4jTydD23aNmFFZk4yxeZWtGD5DeMMv3YuPKD6cDPsLi4xLfFx4jwIYapRTCUNRushgpAEYeKI=; 5:vNs8/YtHY7kCkCMXJ1AHTT51n1ED/EC1EPPeH5/1d/ZAXVFIP/xE7RuuSsKo+h4b96GqAaj6Jqi/8xiYnm3cADM4DD4n6rjBbb+rlaOQrNtln2DwWgBhbBkrW1/er43DSo0eH4Ze/k87KckYAMafV0JUOY6GceHOIq8Y2xlQ7zM=; 24:yal6K/QIu4jSD/sP8oCZFmLO4yygALGFNSMqd3osSHIhFYqNoPpaqpGy/6QHNaWnvPIzbMqytk8MUmYxcV6t0HNjz4jR74hSqs+Bl35aoSo=; 7:spOZDj3P/04E0bC35Xvy5qk6jKCOhIPTMmxFEsh0D2OvBT9PhRmFdlFLajKz68+KkfAhUQGmckv6J3mBgkMTS1Yrglf54ESATzDpgNvL6meJi5n1HjOSJWY1pXj7AoDqSrWVionBKVXaFIyShN3fOL9APQlGm337zPrjIb5scBMN8MosTfkjPDIN+6sjMzPEBFcEDBoDsoCvWPk58nmsIWKm2mCnTtiZOqqDj958frJsSdmj68v7yDTP4xDqkTwd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2018 21:12:47.1928 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52d990a9-e23b-45eb-48c5-08d5604a8ed8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0502MB3804 Subject: [dpdk-dev] [PATCH v7 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: Sat, 20 Jan 2018 21:12:50 -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 fd70d10..c4ff1b0 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 @@ -1215,7 +1227,7 @@ struct rte_eth_dev * dev->data->min_rx_buf_size = mbp_buf_size; } - return ret; + return eth_err(port_id, ret); } /** @@ -1334,8 +1346,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 @@ -1391,14 +1403,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 @@ -1535,7 +1549,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 @@ -1581,12 +1595,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; @@ -1766,8 +1780,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 */ @@ -1814,7 +1832,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; } @@ -1830,8 +1848,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); @@ -1884,7 +1906,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); @@ -1967,6 +1992,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); @@ -1989,14 +2015,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; @@ -2046,8 +2075,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)); } @@ -2055,8 +2084,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 @@ -2068,7 +2097,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 @@ -2158,7 +2188,7 @@ struct rte_eth_dev * if (!ret) dev->data->mtu = mtu; - return ret; + return eth_err(port_id, ret); } int @@ -2198,7 +2228,7 @@ struct rte_eth_dev * vfc->ids[vidx] &= ~(UINT64_C(1) << vbit); } - return ret; + return eth_err(port_id, ret); } int @@ -2231,7 +2261,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 @@ -2309,7 +2340,7 @@ struct rte_eth_dev * &dev->data->dev_conf.rxmode); } - return ret; + return eth_err(port_id, ret); } int @@ -2344,9 +2375,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 @@ -2358,7 +2388,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 @@ -2374,7 +2404,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 @@ -2392,7 +2422,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; } @@ -2467,7 +2498,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 @@ -2487,7 +2519,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 @@ -2499,7 +2532,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 @@ -2511,7 +2545,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 @@ -2533,7 +2568,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 @@ -2556,7 +2592,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 @@ -2567,7 +2604,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 @@ -2578,7 +2615,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)); } /* @@ -2654,7 +2691,7 @@ struct rte_eth_dev * dev->data->mac_pool_sel[index] |= (1ULL << pool); } - return ret; + return eth_err(port_id, ret); } int @@ -2780,7 +2817,7 @@ struct rte_eth_dev * &dev->data->hash_mac_addrs[index]); } - return ret; + return eth_err(port_id, ret); } int @@ -2793,7 +2830,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, @@ -2823,7 +2861,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 @@ -2861,7 +2900,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 @@ -2874,7 +2914,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) @@ -3138,7 +3179,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 @@ -3152,7 +3194,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)); } @@ -3180,7 +3223,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 * @@ -3430,7 +3474,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 @@ -3442,7 +3487,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 @@ -3454,7 +3499,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 @@ -3467,7 +3512,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 @@ -3480,7 +3526,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 @@ -3492,7 +3539,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 @@ -3504,7 +3552,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 @@ -3516,7 +3565,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 @@ -3528,7 +3578,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 @@ -3540,7 +3590,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 @@ -3552,7 +3602,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 @@ -3564,7 +3614,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 @@ -3579,7 +3629,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 @@ -3602,7 +3652,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 @@ -3633,7 +3684,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 ed31a10..084eeeb 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -2023,6 +2023,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. @@ -2123,6 +2124,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); @@ -2139,6 +2141,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); @@ -2156,6 +2159,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); @@ -2172,6 +2176,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); @@ -2273,7 +2278,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. */ @@ -2509,6 +2514,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, @@ -2600,6 +2606,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. */ @@ -2671,6 +2678,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 */ @@ -2691,6 +2699,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. */ @@ -2733,6 +2742,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, @@ -2757,6 +2767,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); @@ -3498,6 +3509,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 @@ -3612,6 +3624,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); @@ -3633,6 +3646,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); @@ -3690,6 +3704,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); @@ -3704,6 +3719,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); @@ -3718,6 +3734,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); @@ -3734,7 +3751,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); @@ -3752,7 +3769,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); @@ -3772,6 +3789,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. */ @@ -3823,6 +3841,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, @@ -3842,6 +3861,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, @@ -3863,6 +3883,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, @@ -3883,6 +3904,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); @@ -3906,6 +3928,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, @@ -3924,6 +3947,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, @@ -3942,6 +3966,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, @@ -3957,6 +3982,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. */ @@ -3974,6 +4000,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 @@ -3995,6 +4022,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 @@ -4017,6 +4045,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 @@ -4035,6 +4064,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); @@ -4055,6 +4085,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, @@ -4070,6 +4101,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, @@ -4277,6 +4309,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); @@ -4290,6 +4323,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); @@ -4306,6 +4340,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); @@ -4322,6 +4357,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); @@ -4340,6 +4376,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. */ @@ -4356,6 +4393,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); @@ -4369,6 +4407,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); @@ -4388,6 +4427,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, @@ -4405,6 +4445,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, @@ -4424,6 +4465,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); @@ -4459,6 +4501,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); @@ -4499,6 +4542,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 @@ -4526,6 +4570,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