From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40074.outbound.protection.outlook.com [40.107.4.74]) by dpdk.org (Postfix) with ESMTP id 11DD37D30 for ; Sat, 20 Jan 2018 22:12:46 +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=Q8zYCrN2lifqCnjuv1iy52xi1UAyTfGrhQTMpfhvqyw=; b=w90GbdIO7YOhow89iFPK28q5K7kzoTXNB2+6SfdXTXRkNo0p/Q0AmitZUFC9R5Wp78d1pZMrwHpacBRQ3sKhhoOZsc9X8JITmwEuw2PDnLTWRA/ZnQQbm55UbZPv5SUMfZjcUl03PEXKb9nEZyDfYA/W9Msbi+IDhRLoRw2+MVg= 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:44 +0000 From: Matan Azrad To: Ferruh Yigit , Adrien Mazarguil , Gaetan Rivet Cc: Thomas Monjalon , dev@dpdk.org Date: Sat, 20 Jan 2018 21:12:20 +0000 Message-Id: <1516482744-8415-3-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: 14c78853-dad9-43d5-0e6e-08d5604a8d18 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:cFsbUkQnMG8L641izhX0PGR1mRBPxLhpCIQtMm75LZrpBcyx1eMt9DNWRmB6xzWL9AVsfS+C6S+ZbC8wpdTHuuknm7L4FzxpgaclCc/C6LOzbnKs1D9K3QYVLJAFbIgRlnj2x2akM3AR9hFPq/nFfg8FS9B0uEeSx4JcjRCIXPU4PZHEjvPgsDwcIADpnvyYCzdqJ1gtNoSbFX5AZ3v4rSsUOwhobnIe8hUURAN3wkFkdzGXQtgtRN8MqYnp0bUX; 25:nBf/gNDHMV0+YSUvmivd/b3Hi1tBV27uzEfSOSQ4NSsb5eDxPT9dE++fx1i4G2EGNdbVKTWrWjycAQWD69AonSFRYfCNHimGvCw/d8nQw8rmb+lHQ8d1k2rLN7p3g/CfI51DibSs2xW4tcPuNp4dtpBZ+D7MYqF8wjJ6VGpNaB4ZhzWNo7INNXF71TIgir0U/TYK8XblN8Y6Fap/a026jO4Wd/upiOqnPuadld3FhrmLFA7qWOgYNFqhIPsCekSsCWrc+PcdUSXntgZvZSVUibEh9+Cm84GieOw5tbM9Gij5OG9HJX8+lV4cPHag1GNeUZvJ/ZFna1N0z7GJh49Qbw==; 31:lELGl2vjiEihmuQ9xwhVmFPm0NpUG3nCV6KKRd7D8xcIomZPITjniQ+F6q73rygt48eK5gT1QMFXhSgHwxuLoYAFLOqYc4VraPf/HLdLkyTJ0GcV6k3HLozy1+iVWGFmCaEtU1pnBA6X4F+yb2CJed5Iqcbd3OpzLlwBwKmhhLNOJObhbysvmgBUrrGVMjXte1/rQIVAiWUnuZvBsS6U2GYx0MUVyWJwBlUu85MxtOk= X-MS-TrafficTypeDiagnostic: HE1PR0502MB3804: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3804; 20:mo0i3p2Ni+Gw0yU1FlrFepqyZ9sFSyGwzsZ22zkc0GgCNg/R0XZciy+1BHexUlyEybjAb/Wt3Q2a6yku/dc2dfUz1xibihgl55EUMbI40x0XhzmhFk2m6g0WCZEGiRt+j+z1I6BiuP3cRU329ta5ZT7HSZ+DJeuBPpHCZqqj/5ynaYDXc5dJbvhKAyDUKHO7fdSqwnpNnkFWNdJUqDE6isA+y/2wzYEt3U2zTpOwlsMT6lqwtezvsnLNeahuzptKB19bCqqvKRMXfuRgGjmJswFJ5tB+KdYEo7tfA1csL31H5fGsPgmZ4GjZX1foZ4OLG6ByQpSOYii1nyULoIQEi8T0422sdiFtndU/qxYOTPe8t4XDeP+LG+h7J52PnYAuPw3D3hPHRyT/q8E22NoPrZjZG0MtEexJhsCZr4if9Y1fvFec+XFhNf8Dww6PVExxuNY/Q7hxcuiC+milvEm3Gl+MVfPsHXXqvrH8fI0jFn4d2fyIt8WrmTXjYD0Hv2Yx; 4:JTZxQo8Gr2qXGw523vynlZcHyRt9s6iwaPVfKRRsqOTuh+OZ8gq/DYNnN8XolnnVz7JNsc+qoR2FNMJJg/tSgvAN8IDpdF9Ob3DRmTRfbzK3CfqVUOGql+IcvOEXDdkxgYO/ShcvZnNR11dhVoVgUkgGglVWGKjBU6LGG5ColPRKl69XjNt4Ch2Gl7i5RXUlwi+6hv2AQKtx3jTFd4mdr6La/+2NTcAR2clxoStlkZmSsg67ggCdAnwb5D2ynImtngOqas/QAzM1yK/3MroYqw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; 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)(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)(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:Vmw8IPa1rohib0t8Mioexviq3/qHoQ05c5mRWr6?= =?us-ascii?Q?rbeXvweJbxRsnwQmGF8uilDhbzBmU30DIWO5h9pt9KqgNmV058eAI7IhTHaH?= =?us-ascii?Q?JZq3SfHPKJHb56B+wF/CotyGLJWkzmmGw7s46um+si/HWgW1slaVRf5lop7r?= =?us-ascii?Q?r4yH7XO1nh5Oy4sLQn0W9l9+eEY951chbDUsnB4EfknHVwYxuedOXI6kQQr9?= =?us-ascii?Q?qKWEyym37P729r8D1ku8HH4Kj2b4bO+pnaMZwA6nsN5bRsrUKzu093zJr4BK?= =?us-ascii?Q?JOdJqDiYOeU1Gdsuh4I8LnhkIQ7P6zS7+7AxCvr9C7McPRKlYdBRMHjY1Uhy?= =?us-ascii?Q?H2wEHGvC/Ey9e2Z/Ae5w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er+iGnlcQ3EsNEGQ84pe+h949Jy05dqTXnizlCdUqqezXjt1DVrK0kyPhZaFRwoQRnA/7aky5nNx3L3nDhia/ZGkWCoIem8Q/3Nvd7l3Q/GR6JYu0qEsJp8gNLnicgbOVH0xHMx7qPtzzfZ5zux/ZlYciVFJmRtHM+NAKOLl1PD1tz7PeQeHtq/hzMKZTIhtHJqtAjeRSqZuN4PmmrnOgWALysFtZwDgr7hpRG6G/SnL0elczwZ3l4VqpLal2nF5CoLMwXpkuOHxgsCGgifSpqy4qx2YZUNHinqTrhwdnI5NOcoQ2pbqWemP8DvA0c/wbYArWhbfv5+Mnl25S1j6fFYs=; 5:ct12WVPnaqJmh/CKOU3uU97DKGyholBbMS7NIxWtS6fSnXB6OBC/aYbJJ0zCwPooJiSF5evvHaOAo9vDtpHqiOyzpDp6WxrZzlsncInSE+OCztbxzICdzf9WCvt6EQmbPm0vQURjFFuE1zemM9Ak1if6znYauFpjjzOOeKYTSLM=; 24:iv7WnObJMFQRBn5v9IIeuS3RrCUcV+TZRsKKLSJEH9Lc35+8NiTl4obKwXGiRqf4Ctxtj5KR9AYTFlHqW3cCMeGjA/DfTVJS57io/PdqTE4=; 7:i0pgbici7y+rcAhOMdLdbmtE4G/3rizU3ANGlI1orK5rKH9fwq/xGpHcp4S45AgwiRADbTjHJ178flkZM4GN0B1ptOsGvE81e70/DqsJQguLe7adqyvYZTM/T3hmIYmhr+Cag++Mmf/Xr0j9oYUrq8MWMGPB12NoYRhwmOkTOzePzEzuI6M2etshj6eVcqi3RiNFMVHsKV4C94a0VagsJJlS1wO5UUUHKA1ySuaSLPLKMMUx+slZZD8W52k5Q4as SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2018 21:12:44.3491 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 14c78853-dad9-43d5-0e6e-08d5604a8d18 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 2/6] net/mlx4: support a device removal check operation 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:46 -0000 Add support to get removal status of mlx4 device. Signed-off-by: Matan Azrad --- drivers/net/mlx4/mlx4.c | 1 + drivers/net/mlx4/mlx4.h | 1 + drivers/net/mlx4/mlx4_ethdev.c | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 61c5bf4..703513e 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -256,6 +256,7 @@ struct mlx4_conf { .filter_ctrl = mlx4_filter_ctrl, .rx_queue_intr_enable = mlx4_rx_intr_enable, .rx_queue_intr_disable = mlx4_rx_intr_disable, + .is_removed = mlx4_is_removed, }; /** diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index 99dc335..2ab2988 100644 --- a/drivers/net/mlx4/mlx4.h +++ b/drivers/net/mlx4/mlx4.h @@ -171,6 +171,7 @@ int mlx4_flow_ctrl_get(struct rte_eth_dev *dev, int mlx4_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf); const uint32_t *mlx4_dev_supported_ptypes_get(struct rte_eth_dev *dev); +int mlx4_is_removed(struct rte_eth_dev *dev); /* mlx4_intr.c */ diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c index c80eab5..5318b56 100644 --- a/drivers/net/mlx4/mlx4_ethdev.c +++ b/drivers/net/mlx4/mlx4_ethdev.c @@ -1052,3 +1052,23 @@ enum rxmode_toggle { } return NULL; } + +/** + * Check if mlx4 device was removed. + * + * @param dev + * Pointer to Ethernet device structure. + * + * @return + * 1 when device is removed, otherwise 0. + */ +int +mlx4_is_removed(struct rte_eth_dev *dev) +{ + struct ibv_device_attr device_attr; + struct priv *priv = dev->data->dev_private; + + if (ibv_query_device(priv->ctx, &device_attr) == EIO) + return 1; + return 0; +} -- 1.8.3.1