From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20049.outbound.protection.outlook.com [40.107.2.49]) by dpdk.org (Postfix) with ESMTP id 125371B018 for ; Wed, 13 Dec 2017 15:29:47 +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=nAU6n1nVv3eLJZ6X1MM3RLxwvw88znM33VxZHPZNpFE=; b=ggnwwukiSeQ3Lp4llcKyDui7KilqR08+WEs3y4hRjRL1jcmEYO8Tv0P+BeH2afL8dIwxy8YpgYk3plqzpUxuR4P6xpuFuY3Y9gHBOHXjw3uXJt6nBh71vJif8Iuf1VJcZnEqccHY7Yl72CjHEUth3wKzCQpFsjjbnKAbfrUFA2k= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM0PR0502MB3649.eurprd05.prod.outlook.com (2603:10a6:208:1d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 14:29:45 +0000 From: Matan Azrad To: Adrien Mazarguil , Thomas Monjalon , Gaetan Rivet Cc: dev@dpdk.org Date: Wed, 13 Dec 2017 14:29:29 +0000 Message-Id: <1513175370-16583-4-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1513175370-16583-1-git-send-email-matan@mellanox.com> References: <1509637324-13525-1-git-send-email-matan@mellanox.com> <1513175370-16583-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: DB6PR0301CA0049.eurprd03.prod.outlook.com (2603:10a6:4:54::17) To AM0PR0502MB3649.eurprd05.prod.outlook.com (2603:10a6:208:1d::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 86e4e5c4-bf08-4967-70f7-08d54235f5b3 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(48565401081)(2017052603307); SRVR:AM0PR0502MB3649; X-Microsoft-Exchange-Diagnostics: 1; AM0PR0502MB3649; 3:0kE8xa5pCFFGc8o/ucNWfBSRouwgqB4NqmraZX8ZrG1wVUfL7IBobpjaFeIIPnClpLlBVGzvfBirJOEFPovQJvYrAecxIDMGMoxYBkeQv3NGAb1v9IdbMnNEph8n6OS9BOZtTNIhw7KqbJO4yMcb3icYQHdAfd6gH7zed/Rl1Pshd3VomfvhfoXmq4V/tEE+pU/ejApqSYuHOkcBNWsKawnR8JJKyl0KcJvPKoU1k7CM2WSY2nVB7JoNDfgW07f8; 25:odQuNavLwp2tdRTroacGh9bwYM10EJuQC3dfugxHVDRWvpOnb860MpbaPaZymSRiSniesBS4KCCao53Vx1HBfXV11Sk/0MZqavhlq6XcoiUg+G/mo7+3LvSZKVoy7fyFJRvwJEby5alEAph1ZOhhKWrt1+gZbeZPOhaUyqDTaroadiE70UbRBvX5SUhOXPqRfNVH3PNUjbQ5Ipb46s71ZmSZ0114EpBgbSYFvjz63J5+/RmKWmS2Z97ROjog4lCVyIk4UAVJh2BVCbjVhxMntPiKVedTNcsFuGPmB4tUo/0tQDBR1TiyBmWjCzikKX3nLRx4rAr1It6c6z1VylDiOA==; 31:ljnf227XrtdJD4l8Pg+29wsTuUAm9mHeb9gmzFljEN2g6O4xNtncGIGvL6iuy7s5asMepDZVcfxDZ0eE2NelNW01t2AK2ds6hJUjRd2deNTH0LM8hBsHZ6VTSm8XWlwC9zRTZmvCcOLZ2e5qKgrO5gXU3Gf6qS5KQXdGe9RlIshAkGUzb0JrkCtJa9GHmy7okeCTGoAJKbQSSdeGR04YbMd3oBUT6y5LkMjmOoMYdqc= X-MS-TrafficTypeDiagnostic: AM0PR0502MB3649: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM0PR0502MB3649; 20:oP9dP4r87rgA5W9b26ulhXrj+f1JrJ7v3tZ8gacxos2S/LWY6/1LkzLF/j50psrAeduo4vFPx2blRhqHeEd+vIT6OVRlsPV+2jD5tucNrfxNSqwvy4mVSF5C4FcPH8rQ8fmB4Paq+NOeuhTBJ98xGBuyej0usoL/M2mqt3ROqQgSZfPzQy7yPVxj5OP2bUXJ9JWraZlv9iC6boMPWzewscneE9kYjr67rKx3vAi83s7HEwi14bltlTQux/+1gEeDpsw0iX0ntD/161yUPZ7lYpaR5WBbVHXkddXWU8hXA7nxbX0xT1zJS1lPXdDM3fkgTdQIQN908mV9jrDaJYyFoY+HDkUc7/hBTb9GhjcJZXuF62C7sBSXDSbT8Uqv/6604tfIvRnjki13bCJqNd25gUBorTuaT3Bnq0dgGnKrUbb54JVecre4+k8nyKA3I233xWXJfHNlCAyMhIqp0XVnlmhIEGDcJN1IF6oiZt0dVxN0dOCstvRSenoukoOF6zhO; 4:MGzO3SCioYbHnwd9sx0ZTZJAsLBP+pmoLLSrAwHwxv22Ju8ozkZU8RTEVlLehOz3QNDMwT+1IPla4bNErMgrGobuyVwQNumDK4XxQS9193uzbaBviaRP1G+s/jCE3tpZKrHsJKekn1javiwVnMbsCTo/2ZtAXo3i+T//svDcCP5NkQKMFslqzwF7Rq1BjArcABISB0onDrw8Lh03rkNNs4QKBnSxYJwqWHBVbP6jM1dOKY7uTVsYxb5XGurvwUt6LG+yLNaWsmM8tj/eT2OOWg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3231023)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123560025)(20161123558100)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM0PR0502MB3649; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM0PR0502MB3649; X-Forefront-PRVS: 052017CAF1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(376002)(346002)(199004)(189003)(8936002)(305945005)(16526018)(51416003)(7696005)(106356001)(68736007)(52116002)(4326008)(81156014)(3846002)(16586007)(81166006)(36756003)(6116002)(97736004)(316002)(76176011)(8676002)(86362001)(5660300001)(33026002)(66066001)(575784001)(7736002)(4720700003)(53936002)(47776003)(478600001)(2906002)(69596002)(6666003)(25786009)(110136005)(55016002)(50226002)(48376002)(2950100002)(50466002)(21086003)(386003)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3649; 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; AM0PR0502MB3649; 23:5AveUyqRMpAl85a5xGQ71czHWA9IPjFhPt9eE1p?= =?us-ascii?Q?1nA9MfSrC0zd7WJSoQrdmspeQSjYfgku1dPWJ9TRonku5cy/rCVfSkAz0QmU?= =?us-ascii?Q?TSBgFCaP0CZumjAkT6JHOw+o1GSuHDSpykD3zA+cgrZgMGRBr5vK2/uNOQzR?= =?us-ascii?Q?cryHCqG2+lvL/JnHhapw0sGU/kzj2Z5wDoPyFJXlxDvZtqV8LFQdXE19qGWb?= =?us-ascii?Q?kvAVsZ2Pa/JvbTiYWrcCjeaQQyYgNLanL5LZRQ+s3Cf4COy3ZOff88f/S8s1?= =?us-ascii?Q?Tv1vLVa9h/xQulwDOShYvn0nReluR0/rA2BrrdwNENurMrKxGjs2Tef9pZM1?= =?us-ascii?Q?2y1rT1pO+u/4UC5aaQStVt5mKG5g0mEMxt4JdLfO81fjHwBb+4zRcicYQyyZ?= =?us-ascii?Q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Vj4g/33wuVF/ai+4uoK7y0Yy4lKaG+2fhPbuQXRfuaft/H3UmojvxQ7JZkE3LvQ7vrcFQoCQuqCD98bJkq6mi9QKw9YdVTHwe8YVTYKL5hewob1GXSl4ydx8vEL8IC25YXONHulDBhmk4pijk1/LCXH3+gS0pDBpFEkYlLWJp71m8eeVo7PjL4wgUBgwdnR6saLEGP+WER8lXCFf67gIOz2S50UJf8zXP931whZCx1yJI=; 5:iXgh8cWiZ2/X1c0UjrHJ+0Gi/C/XrBJoUSTY8udU3NlOp8RW0mWNHR/S1Qg3Ks13NzLfsd+aoShvGHWqA4iz5UDypahio/B7/RNUTnolt8JuZJG3zc9d8MpB9hcQSwOe8t4B47PwwwBayx9XIOF4yMaMenCYhShuvHrkW52dAMY=; 24:cPKF4dIa2YadN8TmyVj29Hk4CfB4fgShszxEJ7iFi4BEWpS+vqU2LrJYqNJLAfyv/IvX8PhIaOst58CJS7u1XfIeXzU3/z7SlmuKNTYO3Vw=; 7:K7JCofepRTPls9zyxTu8A1MwanDSLcaQi6qYf1nkNZ1ZoWun2i91cF37VO/zQp+6o9wFZrLv0eigY8OycxYnqLvzbm+kpDwyA9twM8BB7g9qKbtUE5PKr5GduFuIjqZmW0OzrInqFHDJTDAp1JL5HJM8FaxorqrjgCQY93lnukOAyJ7KKrp6OgyvorCq17VLZq2H83F5HvjsBb/PqxWb07Q3wA+ssfQh/cyG+rQdnE6DheZX07if+ZPd67Gl9/fn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 14:29:45.7389 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 86e4e5c4-bf08-4967-70f7-08d54235f5b3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3649 Subject: [dpdk-dev] [PATCH v2 3/4] net/mlx5: 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, 13 Dec 2017 14:29:48 -0000 Add support to get removal status of mlx5 device. It is not supported in secondary process. Signed-off-by: Matan Azrad --- drivers/net/mlx5/mlx5.c | 2 ++ drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_ethdev.c | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 0548d17..e0b781b 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -303,6 +303,7 @@ struct mlx5_args { .tx_descriptor_status = mlx5_tx_descriptor_status, .rx_queue_intr_enable = mlx5_rx_intr_enable, .rx_queue_intr_disable = mlx5_rx_intr_disable, + .is_removed = mlx5_is_removed, }; static const struct eth_dev_ops mlx5_dev_sec_ops = { @@ -350,6 +351,7 @@ struct mlx5_args { .tx_descriptor_status = mlx5_tx_descriptor_status, .rx_queue_intr_enable = mlx5_rx_intr_enable, .rx_queue_intr_disable = mlx5_rx_intr_disable, + .is_removed = mlx5_is_removed, }; static struct { diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index e6a69b8..2ec7ae7 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -208,6 +208,7 @@ int mlx5_ibv_device_to_pci_addr(const struct ibv_device *, int mlx5_set_link_up(struct rte_eth_dev *dev); void priv_dev_select_tx_function(struct priv *priv, struct rte_eth_dev *dev); void priv_dev_select_rx_function(struct priv *priv, struct rte_eth_dev *dev); +int mlx5_is_removed(struct rte_eth_dev *dev); /* mlx5_mac.c */ diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index a3cef68..5cf0849 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -1474,3 +1474,23 @@ struct priv * dev->rx_pkt_burst = mlx5_rx_burst; } } + +/** + * Check if mlx5 device was removed. + * + * @param dev + * Pointer to Ethernet device structure. + * + * @return + * 1 when device is removed, otherwise 0. + */ +int +mlx5_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