From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0085.outbound.protection.outlook.com [104.47.1.85]) by dpdk.org (Postfix) with ESMTP id 488961B1DA for ; Wed, 10 Jan 2018 13:31:28 +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=rMgaRhgb/yb7kptw2VclwwVNLv2UMleRHxYfAUMb38AZzrlJHO4dvc3gidNW744SMh9q1K+t4JbWta7nknfdVkxJVlRZQi62BiphLkw5i4tGi4F71+M8SuL0RFxSqJnJiErMV1XXQN0NKxrqc51CYTBDBIEI3Aj/jqas4r/+PfA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM0PR0502MB3796.eurprd05.prod.outlook.com (2603:10a6:208:1e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 12:31:26 +0000 From: Matan Azrad To: Thomas Monjalon , Gaetan Rivet Cc: dev@dpdk.org Date: Wed, 10 Jan 2018 12:31:01 +0000 Message-Id: <1515587465-9304-3-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1515587465-9304-1-git-send-email-matan@mellanox.com> References: <1513703415-29145-1-git-send-email-matan@mellanox.com> <1515587465-9304-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: AM0PR0102CA0064.eurprd01.prod.exchangelabs.com (2603:10a6:208::41) To AM0PR0502MB3796.eurprd05.prod.outlook.com (2603:10a6:208:1e::30) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9b82274d-0f3f-4cc6-8e3e-08d5582611bd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:AM0PR0502MB3796; X-Microsoft-Exchange-Diagnostics: 1; AM0PR0502MB3796; 3:r4te2J7MWgdaJceui5Un+FP4RiVsZyqc82KNwccFaJwhc95Jd4QBTD8/ail4cgxPjz35CI72Ed4s04zTdTu7knajgix7XfKXadm0yBPVE1QONEKehRr4+/D6WYcmpGfaDZ8XyioG/C60fX2r4RdVixcgejqCmYYrNrz02MfeJAYGIk/OL0GyRHTHakN97eMnaYFAYY8364Ouj0zUyDKK83TxaYJSEmCCeCfr6cGKSJ8tmtkZx3rBmsDkyzKkg1or; 25:kmGKiP1EfAIfkaR0NG0g/ij7217ORIfZIzbVbc825G/5m1k4BdnPTCQ0RIYASuGQ8hGyUMIR9LBOPwdtrp2vBLJzsB1S58+YKNXR3uJEWivAVT7I+WU6avmUJm58yS0UcEldeVIEyCiyU/rgFi1rs1Osvobpc689hWCECSvCxfUiPiMonw84pvaJRHS06Lh4I/fjdKFp10FCRR08F4QzRUmrDEk6iAWCQj3b4y6hWN2lSPTZViY/9S7oaD9Byb9pDpoGxXah9eOYlWws83Q53A/8BR/ShjSNCIjV0NvCo/KVsYddOBoyKEj5JPSN8RwvFT/DEYVOCUlZpNGygNo61w==; 31:NnQUF9+lvDbfaNjRuYoRhD4E38AKgugDeSBc9oTiNY4H2gMyRe3uatErM9b0Gh97Kyrq3bv7FQLWnVEYadwWMu/tS3/rrptwnpocTvNRlX1aPxp0y5oK6vJ8srwWUTyUof3vK6Iq4mgNaOVsbhytdt5pbcA92dFsC57CgVTzyZriUHgPtXr6zs2UluSJzgzQYDsy7wk97TJfzlTSW2NGoL54zCBKN0Vrl5AvjPuXc68= X-MS-TrafficTypeDiagnostic: AM0PR0502MB3796: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM0PR0502MB3796; 20:ZPBn+UxK+NO9FzkhEHAaObZ9GKsm9fz5lrLUIGhXU/T3qByyYlWSixWxPOhhX8Hps29UupsQkIPR0ie1d8kgjjJ/ObD6qqw8MSHkTG7+KJL4Q0N8tSPd6zmD3HubhsdIq/a0YHswYMR13tWapVfJTVPGrScJwcFlmJ9bgTnHzpRNDme4jwUt8FrKG9mIOncFvhkJl1Ax8AnhoDIk6F8QeLw6hdgBwsdiqgHNwggWdEhI134GhF3LKRgTTW5D1gpAlPvn2sn61PwpQe72O8/uQFMu2ZWF+VDujdrXG2okyPGq5FQ5ejJS7TCwBDptP9+M3qj2Ye7DNjmrwl7kS839suUkbCrfdyjyRLTu/W5joud1g/93n8pESdyMJu3DrnL0aifBrZsYLtKGnVuiNtkssLj9jV9H5csWVDrv5JSsFE5fbTAKa0cuiMOJbp7YlMbY01FCiAonaD3qMXFj1cV4NeRmGw63AwkKKfguPcKqOO81da+Po2GPr0x/6DR4veki; 4:a/gD85z8tn2EAIJfpnSq1Bc8uV2wLIqpyDBlhmZkp3j8tnAcSMkE7Tg0UgC3KLNrOd3SKg176W3HQSu2I8Z0zVzwdNUwCebYFHbDqhR8cx+SDVrLJ0HsJyhSyFjg7PYKVolPPrzs+rm4toKGYBQMvMSblLF8tzQoQgcfVeprlntwng/RR11I+U/cgMcjevaVRjumC0rzLfpLnbOcfXztJtJqLNpuMGh8FgzQeNihRMBBeA5hOsvB5O7LftXUIUplZE86gPtNzIQzOjhU0RVqgQ== 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)(93006095)(93001095)(3231023)(944501075)(10201501046)(3002001)(6055026)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:AM0PR0502MB3796; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM0PR0502MB3796; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(346002)(396003)(376002)(39860400002)(366004)(39380400002)(199004)(189003)(55016002)(68736007)(21086003)(25786009)(6666003)(2950100002)(4720700003)(6116002)(3846002)(4326008)(81166006)(8936002)(86362001)(50226002)(97736004)(69596002)(53936002)(16586007)(105586002)(16526018)(305945005)(7736002)(48376002)(316002)(8676002)(81156014)(36756003)(110136005)(5660300001)(50466002)(106356001)(66066001)(51416003)(33026002)(52116002)(478600001)(7696005)(386003)(76176011)(47776003)(2906002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3796; 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; AM0PR0502MB3796; 23:LvjbtkHlO/rXjyJpFY6LmOZHC91/L/Hye0We0uz?= =?us-ascii?Q?JPm+KYRTC8Q4P/1Y7yg1QOTXgS1sw7iIdRshtK7Gclg30MNide1PGzagHps6?= =?us-ascii?Q?nuvJ4ckOjCQ7HM3PmlZbmAXAbBKhBMQIsJpXiAL7hUhbGqhTKi1S7xiKJ6Ko?= =?us-ascii?Q?TE7ZvQ3JwI00bB53dHaxC89jcn0Y6Lu2rf8SJP+xPLn53i7Wp6F+zCAw5QK0?= =?us-ascii?Q?0VSTe0ZgtxJ2MZxOucmNujdkMaPIrLvACJuOzX1/L/Sk5SGjlA+RhSJn8y7d?= =?us-ascii?Q?SJt1zW6/Ud6xPKDDkfPxMQ8TgJuRdi3rg0C3QlGgAXoJ40SUF+vZQYMjO0wY?= =?us-ascii?Q?asHS1fZxR77qw4qh9nA+T49683QFc//5XHaoej18foqLt+GrII6QGUr3CR0M?= =?us-ascii?Q?1K9ybNBLSIy9kbtABkwzRrt52ynk245tqmLEOSad1ovalN7Da2tNMIiUrqop?= =?us-ascii?Q?TDivXA1niFRv6KjvpFbtBmgX4lNdvAhUxxZQOYwW1tggdVjJKkaKBOqGRIfI?= =?us-ascii?Q?o1Wr8HsMBClWpVKExYPvONH6YpWYi8cYHdMZdb6cgnBcJkuaKXh8NmqGAuAF?= =?us-ascii?Q?fppFytTFveIGcSscTiNQqt/46v9brCyV4teHDLVaIxecTa2U4u+4dPtxCfDR?= =?us-ascii?Q?/5VmmZnwCS70W2QkpPGsyxky02fh5rt8r14ZBQ+AuxFPBAx8Q/hold4wsQfS?= =?us-ascii?Q?igy/1eRyGVy17udqR6LNVA9ArtxcmZH1Rn+YfE2t2EZbi2Vogr60zOxpg0hI?= =?us-ascii?Q?lvuWfupFae63OKqGsqoABqBCfOWyChyS7OJUGWYw9tuB/BPXx2pbqRZchIBf?= =?us-ascii?Q?N1haY5avBY04fKxTiSNjKZYfLuZou48EywsoFeyWGM9Xfb8NcVT88mu8pHvq?= =?us-ascii?Q?TczVgjFp6JU5IVO5M7MPtjlon2F2zEdofLtynwt/dsNcr6jGwmkK2MfPqHvK?= =?us-ascii?Q?2ALyDOx3axDrULjAv+Ky+mvJ3IR26ggd+AFufVYdYbJYAb+EbZ4uPCkC5ahT?= =?us-ascii?Q?OaVsnxQIitD/+nXi5iibA5H5STtZIbG2kT4m1t15VKFkjs+O41HRsEtBeFx8?= =?us-ascii?Q?tWcat+Wob6d6J60My1YF1NueMF/DdmQ+8SFNj5BCT80YTRc37BqyFLBhPB6h?= =?us-ascii?Q?mAvehfDqkIFriZTBi1HMmOZVZrA5iHKAco84oK33yeHjMNYXO8shj7CF/fU6?= =?us-ascii?Q?GhQ0csnlR4eIZuRqh1rN5hMaObvtjQDaYhzs6rMf6UnIRsj8jcQZFSTDuXb8?= =?us-ascii?Q?JRwj429ulbf6zF+x+4Sg=3D?= X-Microsoft-Exchange-Diagnostics: 1; AM0PR0502MB3796; 6:k+k3KDyo1PJSWZsLbgaxqjABtqx+7qYT+t1of72bh9Qau4m+63J4sgvL0c4R4kjxJ2I+8axIV6CxSeb5tAMua1GQHDqfW1FfWRFCUiGY58RzQWxS89f+WfDLTURQgEFlnpD6lyTM6uyZjulalnqoQ9vIETKONF/Onckk4JA1/mPyDEfns+jcPlK9IjamugeHxhiplF9BILEtZT5X/bLskKmNamFvcaWUFBE1GG1AkUlMwp5aj2+nd8AwbtzvCibZgb2MZlISWBHKL7qOxmGr/P/ylP3J64sPeBrRVQEF5PugQsocOuDkWqFneE8sA4A4t6RJyTM6wqCd1uq5E1gGQTVYY8QOrMoGGaFfCSv0/5w=; 5:7i3KORnf2lIL1Z2wi7TfXYMWjGfHePdJvd3ppBzySG4xLy1DMRaxJ4SOtGlfO4ihrrEWo4/TfKEp/l7d93wh2OxgKoOJWFiYFN5xBigx7DvOAHcG0K+zgPRoX7DwEFinHNlOdKhMzgoAj42PJTdvH9r2LbsEs6C91Os44QOfd3g=; 24:yt0xtWCc8eUczQi5xP+IilpETFDm+ahdDHa1ZMw4Zf4+X1yyql8SAvynkBiA0oW/swUQzyXsSCqVScElqqWYPM4y9xCaex/oCdVwDA/UPO0=; 7:75+LsUizY4mEVdlr/T/OZrg13bcmlIGP9QDFFKZVV4BpoZPt1vNVDOqI1lmGSjgl73m/z+6yi9jj1FTyQx1lakOTc5hcMZxUfHb/isWrgzn/U+fPRYIvL1SIq3b0xZWalvC0AdIqCqJSsfF/dV+dpfZFBF2Xic9fAzCEgKYHpw+1LsrcQ/EkRoLLnufS01u0fi1rhVxJ4zxcHiwnYqamVsiZJxyIvZAGFsaZM7uMREhzViEMYy85OtIjzRjNrk6/ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 12:31:26.8523 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9b82274d-0f3f-4cc6-8e3e-08d5582611bd X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3796 Subject: [dpdk-dev] [PATCH v4 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, 10 Jan 2018 12:31:28 -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