From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20067.outbound.protection.outlook.com [40.107.2.67]) by dpdk.org (Postfix) with ESMTP id 2F4581B00C for ; Wed, 13 Dec 2017 15:29: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=oUaCj6TB0dwdVn/Y8CHph3TMoSfo/pU5aI2axUfnMvA=; b=UMmmjc0OhOsefFo/A1W5TsCImvJ4xiNEnejSX7aGS78muWrjQz7JvclNi2hbP462bbnTkv1YArwAymJAK4xfJ84IrHBieqH7BKKbmGQouNx8E2l8S7PKak7H1VJBZmHN75Vi6k87B0XBrCJ3RrHHOCCh3n9ZLg2+wPsaDeq3Ebo= 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:44 +0000 From: Matan Azrad To: Adrien Mazarguil , Thomas Monjalon , Gaetan Rivet Cc: dev@dpdk.org Date: Wed, 13 Dec 2017 14:29:28 +0000 Message-Id: <1513175370-16583-3-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: 38e8bc94-1947-4281-efa8-08d54235f4ef 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:I3gbp0/jmuGOVB1JHQLrY39KPVcnHRQnaKwApgN96vow97sflRcKCNh4SiDNqYeoK8KSNHw+Z+ImfNP5ACTMkGRmjml5HdndF5nyX8J7tA8uwRO7lVw7I3d4X+89BRRff7PTrMMGBGaaUij+P3FAmPth7dpPHdAFW6/EtlAnqbxkEraoGhNoCKarZuppGEc4ltLsooRURbkn4pSS6B3g2atoxy8992PwEpRv7KOohOhVrCbrIcfK4HVyI2XWtWbb; 25:4pm7e97s5TODL5npkvLAjmXp25EyRwBbRDAyRxivvRBlYgSZsGA5Ri7j2uXEKzkVFbR6tCLWkBma4niPy2LYf5vWMQNl2+5kYC0pgDwBCBq/rKIM+CUtlpaaI1vGvh9FBADkW52JdCNeryhjn2lJeu9JwaFRJTHof2f0yjq1ANLMLRSHUotrRYFCrFrFWEFBwqDxSCkSm8sIFMsJaQ7HtR40XnY2h2DHaPA42ffsNbNZBPuxXTXpVzqKGZqxNYy4DHZjeGv71j8sxiGLiwj5xwVrWzdeeRELbX0j34luwMdz7OiPfiEjUNeyvJgLzUWWOEjuksg537IEgtqyKLZoKA==; 31:FJvSpKHRd6Jq3Smc29vFqEacN47ebd97cimTo/opM1D4m+CP4t8TXSeEFhgLeCdIQ5BKE9SKhEL7ipDyxHlRHHanOBjiLNHEY4k2F7GSoW1qD7m4ync2xryl9ReS1Uqnr97b6GOO+Z2rmvy4l7doo+wtBPSv0WBFfvX3t0E+ZSIeKSwhdjM4Pf3SWQL7Ec0rGAUo58AveKW6aixoLlU/hTjN2zOF42Sag1gCJj2QuyY= X-MS-TrafficTypeDiagnostic: AM0PR0502MB3649: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM0PR0502MB3649; 20:UUEFDsW3mfn6dg9Eoa15kKFd+qGceZUUCsLswfwA9XtbIqqEGgSsRgWTrvh54BFOVcCuj6XbcVz5bIOhaQ6543rJti9wluwQkzvi8m1SRixM5H2S69pXM3EkkRB+PYPDcMIzruDM3+nStV49hGdzkcG6iEQ20MRK8roLPkIdlUJ8Ub5bi5KUNvkFMolGpLSJaGeQmwI55XcMTKPg32T9deBmgTNIZxwC9euMz1oFqgQOUICPG1xdyYL1tJsxGv6hBJ9r28KT4NfCGr1olEzvrTwQU5qP6/QGA1WJtQhwFmIT/5+7trF5ih+5EhtSlreCWkhyIwcVsO0k+EDIpc9dBawgrLJLTTe6wwl1tSArEhLkFbKXL455XB0vr+NBpXaSzkW9ELYiGJpjLA9jl6jFSFvVxfpssx/3eJneTRjTYX8RzcZTYMIvT7HPCnShihhEnlHB3vzelE8lnY0Preari8IvoaAV3u+PscnqdExNeDoqo42eIcqCzHuaTkZdF7hK; 4:15D8Wzsb+N4b9xeyP/CjoDrSsCR+2eKcjVJVgcebnqAA9Oz5d9hraIrgOgwLFAtIqL3HXFa2+vWM7axzcxvykA+Yo/iSx+cViGSlOMmsXP3uAdhtELdHU+truRVi/vBL9HeQMEYERJCeXxGC53Fp5Y0kXxCkxA9e9RiQgK0j6x4M+ZEh1yAB828j5Sx16e3Z13yLG7HRPq+apurBbA8P8JU1XOIgjr6LyWTKZVwCYtPPiY5f1zgiVxAHnzbN7OfGyjH0EqneTumcByLDbShuDQ== 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)(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:oFQPYuD1vdcZGEv6zvbbKQ/jBTcQvHW20CZsILX?= =?us-ascii?Q?d1Ilic5g/CX1VKGYRL4HaCf6p2LUNlIbgn089vSJ+2hqAu5AT2DKCnP06WH1?= =?us-ascii?Q?bBzoHQVjfErqQs5/kq/1QAVWODy/AtBbsqawq0vYw8d8XE044yJlrQoDorIg?= =?us-ascii?Q?jRz/zB60GC6M43DZCrHkR5Yz+2Q9yfZGP4MP35Bky2YtRB/vHciWqSg+zNTb?= =?us-ascii?Q?TD3XZcenTCfd/ePvDjIy1IKkdujQuulee+a5uuK9cSqhL2ZaqenJCx//RZo1?= =?us-ascii?Q?VNm96WqNnWOku64ElOkbOrdAuULTL6jiSMOlbta96egZoDo3tsWL+s+8PKU8?= =?us-ascii?Q?n98thMeSk++PF331MDheodCxHBEvMBC7CS68OeuBmdAvbtCdQTeRt25QX1M7?= =?us-ascii?Q?YGUE3a1cn87mnyWpcTHtPI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xmVdKwkbilQV5NfnjxrJ0cQ2laWeirkeYTP1Xjv92I+ErDlo9F5yMcJDSEz5+8MGQuTLkv4zv1lmPNaloOuhb4lr+nTEpDTxgeZkieVonCO2b3LJhI6xY5uNBtOJ5CF8tNqtzxWUaEM/6ze+mV587P87JQ0+wGQfGB6Y4Sh/RMfPMyDqS7H+Z0IaA=; 5:6hicDOoHV5/GDTaMqZrSYoF9PdUanK4kHQJxXoJ+1qI/F+NL6XUI/6X/UoBzuTncjThl46HpQUWZTp6kCVNrc5rLv1+Eumj9cypk0SE83as97gdk23Lzh7V7zmx44p7UEo/n4uDDVqsQp8qLRdBOnBDJU+W0YTJb3Hm2TVfHamk=; 24:CnGXpGCVuwH36UdaG0UTNBoZappWtd7iZ/RdMUAGDLqSq5cI65/+fMGAziCOdLUS0SraJmrKXRUeMPoO5ZVj8+mASElLpG2RW9AelvJ6zEI=; 7:qwjb5yVQZY48+q/0KeQ3WLw9tKMsSMSbjjcWq3hH3wnSrSPboxxjt1MsEKIYGrL1TSL2HXtlHtdNv6AvqyLnVIcbiSkSilmk+znE34zjP1HO/k14Kwut40CrpuWIpMDFDgfR64uZqygZssQZ0e+/aYd81ZvM5eLkVW4a35nws1FRyvGM31vaRpO1/vuzWWe+W5+0uKH+uHpA5M8uZTTNTsmQrJBTLyspAMyyNNzyvVqGFs1a3CZKRk6MQNuapbRJ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 14:29:44.4576 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 38e8bc94-1947-4281-efa8-08d54235f4ef 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 2/4] 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, 13 Dec 2017 14:29: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 f9e4f9d..3cde640 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 3aeef87..0eaba89 100644 --- a/drivers/net/mlx4/mlx4.h +++ b/drivers/net/mlx4/mlx4.h @@ -165,6 +165,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 2f69e7d..0d46f5a 100644 --- a/drivers/net/mlx4/mlx4_ethdev.c +++ b/drivers/net/mlx4/mlx4_ethdev.c @@ -1060,3 +1060,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