From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10057.outbound.protection.outlook.com [40.107.1.57]) by dpdk.org (Postfix) with ESMTP id 259A91B2CC for ; Wed, 17 Jan 2018 21:19:55 +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=McxnfQjvw3se0ql+Du0bVPJZ1LVeHR6tAbZy5J8zfOgR+PsxGhWTrpzAVlDYozukzU4vFXx9khRddb4EbcbXNjf6Ik+hJa1BRZ4eqSOvIMpRYZewnmhXX423DE2tXhx3MQO635ByS/4JFKfY9oeJqkuAIziWCDTYKFZOWEbQczI= 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:53 +0000 From: Matan Azrad To: Ferruh Yigit , Adrien Mazarguil , Gaetan Rivet Cc: Thomas Monjalon , dev@dpdk.org Date: Wed, 17 Jan 2018 20:19:13 +0000 Message-Id: <1516220357-13013-3-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: 97da7c01-b4c4-4f3f-9498-08d55de7abbe 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:GJrnPwZYvrmA/nx10dA/DIQ0TMltGk+MtR7jXhUlCZ/oymmrwBiiVYUpj1Mm6kVtwZP2RKJP8W19lZXrkMBUqMRTy7CfzkHiZi4LU3q2vLVr1h25cfTRq5MqU/K3wLJTL/wQWS3ShfaFWIDn07mMQbHCWpi5Dt/WjxHfSYZSyQMYYO1U0CBeQKzF1N+eT8/2dGmJ3BVsotryUrPIsBvxsX0OXihTfPGlNWE/69JrWxCVTaw804hT8tXvQKAumf5X; 25:g165V85gJgS6U87O36QzASz2CeQnuUnfO+u9aIZj602Qq5yNhxKxui+zhJkA73ev3latXK2ndkddxQSpae5cNnGUgzEXD4Z1uXJsdNEapgktlqkFdNH9Id9gdFPxN0+uDlyYShkdFUDlg0DGg2+8CHsGQFRnxvuiuW52iR3RkQ7vgk6D5JLcoNEO3YTBYBmjXkxLWquJyGxC2zsGX4GcEn4Kaa1Ed6ViQMO9wisGzkbCIju9n+3DCKcsZDNG6ldbjzEJmuqW0Qhp3wXlawVFZoT1CdP89KQnzJAKcLcPoXxAQsU7pIQVDSmM7CNIS4LB2N1OobHyo5X0cPJnYUBDTQ==; 31:MvDGIYaKUABjeHtElKub+FMl0F+wdEkfoo2eJsid4LYbcliYZzs0M5qHsccPEj52/Y48+xTRY5uy3SpT0C/gKnk4XkARbayapscJbHtH6AyhTMjn3Xs1NMfr/U7euuR8aU5o5iNcoG2BxfS93xvc+lJL+0XQMmB4qTjEbmvVB+Y1+QFeJRD6LQtemTGj1NwcQkcl7ifos5TWDa3jxdGntynL7JY4pwaexNHC2EO7D4g= X-MS-TrafficTypeDiagnostic: AM6PR0502MB3799: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3799; 20:P0NTXQLBJ46R3l0MkvAg8EdMg/hmjnTieO6DMDJN1VtQMl9b4gtctHO85q16eoAXFZrzho3/JloK9WAnOQwzorqWweZlrp0smPqTYbIEwzx1uIMAopzqME0FZqMTFq0URe230I597jqBj3aKHqgqNYGTTg77rv/6z2vBFTQlmwuhkk3eUaXJM1sLfJu6n7qhnvPt0fiD97JR0fGQeXQycGpgSXNBB8Ikp6AdSF+VksciYp554/68yducGBsdjK6a77vX87WcZlQe1evWncsdqtEtMbPeQSbBa5H7XIjEwx5bJJ77toUjy9Y4zEa1nAnzmBO2IozGDO93gdliPCMGfh3tfq1RGt6k5tSOZn1DLzbc05zoHAJhBdCoTJ6P3GPNvwNaijGK+qikvpxW6A0J6PwHuQdWwleOceagCN7FcKYDVOtJfegNReKWkCSurTtWz7LVgzYbmSoUwaAkjrCB6Ld2irddpf19/QvCq+aVDhEmbE8vsnNmbmlYsv/12Xff; 4:3JuUiI8yf7cikAxUsyUE5sIJoOSlf63CceAVHqbLhUp/3HQxuWvVfQ6kxe5dLFlDrk8uSNNNF3URIwUvXHfnRgoyphtlVIdsB+7YflV+hdTOcnlaxavLlpJIyZg77ZkXDo7lEW5Fhvrp/pIJZsTrD+p8urINdru0pYKQufJurwU173fvVzenxSYslUQS4v+mFRyKz61GS0bThP2TYqACO6l/BZXegqqnwyvZ4OtzH6drT7KZGoJLlMI8/YjylJWqlAxP0Lrl/kbNQfd2qxlgIQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; 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)(53936002)(68736007)(106356001)(55016002)(21086003)(47776003)(16526018)(2906002)(66066001)(105586002)(97736004)(4720700003)(2950100002)(478600001)(52116002)(305945005)(48376002)(50466002)(33026002)(5660300001)(76176011)(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:z1G+S02b4VDpUV/5Lwf/JWJleDj/GltD+BTcQof?= =?us-ascii?Q?oON1/YHi9dV5h6a7xK1jIdmUlmQbnBes+9lgRnOawAd7xLga9F/qmMJwKHIJ?= =?us-ascii?Q?zl3XnVW7j2V6IgUwSN0UaGOap30ZzOKF47qcJSq+djU0kdvcQO5O1XswzAYs?= =?us-ascii?Q?1BuyEuYKLoXH+90lfxaOdgYlbsetC5w3AlmBD+swJ94hdtZrbRN+LRw8pcOj?= =?us-ascii?Q?VL1sGDx3jxzjx/ZA3nBKuuozkYNMV1X7bTJDUKZMOLx6vqs9w5nqG5Zvaz3e?= =?us-ascii?Q?pUKOwnqo+hrOQZjvIjN/v2j+kxEZQIksICQ8NnrpECimExTj8mhAVHMypc7z?= =?us-ascii?Q?Rp83SAJneYywWkxoD4zDuXx+LkQL3u5nEDshsQMyWsWxi3qL6vzNd+mOVUMj?= =?us-ascii?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l01F9meLiH2X2vf//xZ5Sy1tT2COAlqc9+1WXKEi+oF9PlK6ZvGIfRZ4d6mq0aF7+T72VSJS3GCa6wnJWGbybgdFOVB9pCUJUq50Vp3cjLuIWnLX97r8uFpAAKKSodIN6p7fdaHIEUEVvQsmPCmHje2eDEsZ5KwvW6qhKHvqHAaVV10845/06f4yNtYzEPuW1bfQtMy3GqIHDNUJ6h/4o3/6mZaPKbTI8ZuJV8f+un4K0DcO7ipwQk9m5RwgPWOwpmzG7wI8kFaOwfBIQDjow3778O5DQQNibPLoqRfV33o=; 5:SGkiGu1KEsinyqcsHTyiZde256JZsd+XLLN+zMuSWucbRd8q+lcFg0kB2u3D8+DsHTu17rlOnOgHs7sGGewRdIPhWM0y+W5iPdvoCvsTM9T6fz53dg9ClhaIQmiwTwcXUBuzljpyWUGGwm+idtt+moWHXbroAb6yF66/CG9z5K0=; 24:u8AqaZG1GonWTXjEdNv7SrZmDqifq4BNvzuPQo3Y1eVcaC0ZcPn0zTxyHsqzMzel0DJdO+6roFzY/2J1c2GVr/YBI1ijbmkm2qsOpXuDkBg=; 7:Xqc2jUd6w8VBNVN9iSQOzwbcs1xBEpIgFw8B9Dx2975NhhEDQ09t3pJ79Y6rBHBG1Rzk9TfEK+r2s/ub/sjlOAbkDKK40CI7FIDxE7gMPOxg0J+4ySzPn9KhyGVxcefn/r83MihL4+sZEgt7mMtNlJxWHyYiuhehpg9OXSWs1lOQalUAXGxbGbj9CYsb2kEyj2jAkbGmCp1oDG1uVueB5GLjVo7sCNy4n8Jdk5w9xFXtkGXn+K2IASxn6KoI/pE7 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2018 20:19:53.3796 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97da7c01-b4c4-4f3f-9498-08d55de7abbe 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 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: Wed, 17 Jan 2018 20:19:55 -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