From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10065.outbound.protection.outlook.com [40.107.1.65]) by dpdk.org (Postfix) with ESMTP id 503E11B2A2 for ; Thu, 18 Jan 2018 12:27:41 +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=sp2XrY4bNEuv6VPfmLRlQgMLc5LKzvlzRu8NOQ1opa22sAz47f9cttw5PVr80orx9VSPOer7h01CUE12KNEV4PxoMVzpraMAj1taR4Tt0Z6/OyCaVyrge2WhdaanUkztK2+/aNR1wvJybjDfMb1QxQFuGInilU9UAOy540yxsyc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM6PR0502MB3797.eurprd05.prod.outlook.com (2603:10a6:209:a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Thu, 18 Jan 2018 11:27:38 +0000 From: Matan Azrad To: Ferruh Yigit , Adrien Mazarguil , Gaetan Rivet Cc: Thomas Monjalon , dev@dpdk.org Date: Thu, 18 Jan 2018 11:27:10 +0000 Message-Id: <1516274834-19755-3-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1516274834-19755-1-git-send-email-matan@mellanox.com> References: <1516220357-13013-1-git-send-email-matan@mellanox.com> <1516274834-19755-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: HE1PR0102CA0042.eurprd01.prod.exchangelabs.com (2603:10a6:7:7d::19) To AM6PR0502MB3797.eurprd05.prod.outlook.com (2603:10a6:209:a::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c5d263e0-65d7-4fcd-1657-08d55e667bc4 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020); SRVR:AM6PR0502MB3797; X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3797; 3:W66Ngs0wl+Q9gCiwebzmFZY/XYaetw/nLsa8p/lFFih+R4xv9501+4VK6yG4aWa7LcOTWS4vFwTEkCLu8vN/H25iHl0HXwVQ+V849dllrM2de/c8JJYpba4bi+s7pIfceGfEPLF3BHQPuejmvEbNQiiHMVNcZtLiR17WHqWxBojBNiAHWrE7VAOpIWDvVAP9qZigYw2LFMSXaHTW6LJJUbjMDIGRDtDpGmJ0LGLIPriA/pPoat2A6gZ8VEerhgEe; 25:KofHO1N63m09RyRja8WEx050A8/kS03/+3OAAeQrLDMiGTJ9djhdnQgvkjmJewNvSl4J0zKpm1gj6wOgfQ4s71MZFKHibncG/1mGDHbdi0yaHHr191Ts+VIItfnENf62qBNugHYefB/nD+VL5mJ5Ic5d8t5cKnw4cnBgN4umY06laanjJg6Ys4E67ZEYICF43ld+48TWXyTxYPYkKr5fYvq67JdKU+Sh+9m4ejhjMtuo2enRTz4+JmXpBemFJ0dcR0TwMVSu3V9MoPmJbRRoLu7LznnTWPqoAJAXy603m+jyOqVY70cNtof15BWtTgtmkO5Y0nulZrvhSP8/LH13ZQ==; 31:eGEFKh2dTrjfXrViShhp14CRNGo8Ma8IDP0btvxlapW/QRcLVn9+kPPXgZbam5nIAkntacoU5U86pYgqvniY1gro/inFmRTHMgvcX1ILS6/YVo1V5m7kVHo1/DbWSNpm9ul7wqPXAwuQO94YHFMfVDJ0KBOthl3j4ROtaJnlzrItx5YJC3GXkkwGa+UA7cH/idSG9bTZqcM5oQ/mOfY1j7ltXB4wgLucGCyfhTX1bvI= X-MS-TrafficTypeDiagnostic: AM6PR0502MB3797: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3797; 20:46FbTKeRFNv14Az7csJ3/WCMUpUCUNNsCdKruAksOE6Zwjx/yd4Iwyr3pR8BKHfY/cVOhXmCXub7sAK+2uvyFjglPCqowCWQF98Z4+yn60MnKpdFzUk1wbLemxDJufZ4UE1VrK5Vffh3WJOrw8Bl1PXR0z9y8LA3fPz3RH2mJj2MWTrChhS6URBgSV8ENuduPgYfWsTdCsYyRADZdR7ktX6ysgeiX9H8VyDQ1rzKC6bV5T8U4eojHx70Efy3eJoaU3Yx2r4mvDCOuNiRUXAmoOgpgkqUFlpg/GeHt5W+xvDzq3IquNkN0qjwp3h+mrLFXXylYnoUyqtzj8EkPkl+M5IoigdsXoOv1++p8d53v9QG0sjzoOE20xJRUaahlTIv7zzMghkYMlVspsRmYaVjgT8sfQrMD8kNDu5ynOsK/mPVhovFaO4S/CYteFHSGvpx0Ve/lVSPQrxiNZGUE/8tgGMaMwo6EnKAFPxg8PfUUUYo8cTszlBNLEzC328Wy0ua; 4:asvF1lQXwbBPco4+7ciZVS7zxBqKlZkKf/76XCjuINz4U6eifjBEEai1N5VqpHL23Rqgq21GJInlyrOtb19WNi3SQJzHvMtpPg1oCW0LUqUY/2k/+jBLp8Evt3OnLRx9lUARnZuV4dZ4riymCEyeSA20dLkJAYszkGRM3d191Eo6cALeNqsQjFsv7r/pbGBJQQjIPo0qJ8kevfl96nt6TqPaCpE6M2uqieKyA/TqFrQ3VnrhnNN8RMNn4J4g06kVtdr/5In52Z23Z0SVEzFZww== 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)(3002001)(3231023)(2400060)(944501161)(10201501046)(6055026)(6041268)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:AM6PR0502MB3797; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM6PR0502MB3797; X-Forefront-PRVS: 05568D1FF7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(366004)(39860400002)(346002)(39380400002)(396003)(199004)(189003)(53936002)(6116002)(76176011)(386003)(4720700003)(26005)(7736002)(305945005)(50466002)(66066001)(2906002)(47776003)(16586007)(8676002)(110136005)(478600001)(316002)(25786009)(21086003)(2950100002)(48376002)(6666003)(51416003)(52116002)(7696005)(81156014)(8936002)(81166006)(4326008)(86362001)(16526018)(97736004)(68736007)(36756003)(50226002)(5660300001)(105586002)(69596002)(3846002)(106356001)(33026002)(55016002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0502MB3797; 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; AM6PR0502MB3797; 23:DqKSvj1WqkvGxZHd1wlujyq38GrbYleFFTlfYqK?= =?us-ascii?Q?+tea2Anzazd8UOJN8T6+ZaBQO/zZsgyla33Nk/epH3fs3tlwgl8tg16qewlm?= =?us-ascii?Q?nimQKWDug1blKvSqm0PmFuR+Rel8BFrTIpyKHMvjsTunUPFxFpmUKs2lTq+F?= =?us-ascii?Q?Vp24HqapYJI8VOgaOlXf4mBFnUu1RDQqZ1SKwghphxdjWU0XxaT/HOBm+J/Y?= =?us-ascii?Q?XJl0VBVqVnpxvcE1Yt0KqPNQKnd4v7b7xKvsDqMnnYZHsocHFMpoeKM8ASQg?= =?us-ascii?Q?CpQvT1tHV1IexLqYiThRE0zAWzbzzttbEPDoCUfy+tp3+yENAN4okLr6oN5t?= =?us-ascii?Q?OZ6mZ+tCcLHP3Ah7e1PPunLCNj++bgAm8+s+5QUj+inyGiW2IzS7eSSe90Oy?= =?us-ascii?Q?8+LK2dN/hGBp96BLF4i81omXY+FF80Tia/bJvg+27UdJjLN+LEagCK0PbcBw?= =?us-ascii?Q?WpuEvD3prCfTMD4JXLjseev0BeIBu77srY96v3hCmTHpQhua7HHThjrr0lfW?= =?us-ascii?Q?paMyyF7UnlO28uspSuZggZAkICZzDy4tvt1/Qi5V6yAdQO/pPuxCx+S60cNU?= =?us-ascii?Q?YJpZRNYBejXwAJt4E5z8sb0jJTfCvYwLEYsbeiTc081bmzHSeqIecP66HoZL?= =?us-ascii?Q?Jj3FerquKXTdwE9v09FENANF/mzQomlBDX+wJfqHAcGIfjCh1I/1gLMPnpFO?= =?us-ascii?Q?JILJw520HbrqebZmMvY/8bRAr54nQhX3M+L3bi+ijzJg+c/AtaYHiQDO5m+z?= =?us-ascii?Q?2RWfV6noIJm8RvMs+vC0G9evIN5MOxpiiVNa9oliG9+L4wgPdo3g0kLxD0GE?= =?us-ascii?Q?gW7ZlbMpGOOmWdHhLA1CqIKl5eMoXMmfgKHA6GOoHiE4VTPBWBUzxLLtR5P6?= =?us-ascii?Q?iahX4w52DfzMH5P172hCtlbL8VvyPxc4AJ8S4iFhtf82Aasc/5yYZOU2PIEe?= =?us-ascii?Q?t+Z4bR2/Aw/amtzNPVrZR0RPzSPmNcdItrOtYFldPyQ/mPkA8ofjW2K+EXQv?= =?us-ascii?Q?fF4RblHnrT8S/WiCeNCyu0rG5naG2dfWH1fzb/z6YLzMhD3K0SEhpZXn7A17?= =?us-ascii?Q?i8RFPj1PygIaGSZdT1LgkwMD8/MW386g+j0vhsr+Y8dz/hB684LjyVaFei2y?= =?us-ascii?Q?1nPWJEXSp7xnmucueL1jDRtCPU+qplIphRQP5KNzBUmDOrXPogWeMXQ=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3797; 6:X3HiGC67PmY4+iowf3C69sYo4WMi2b/HSRsFEpAOZ900v5dIBYzOUj0u783pcf0BtpZWLjmCGI8sHMHcI2nnt4TQSlZTGb5AP7zY4v3k/SD4WqUrD3MVmxtzdZRLcgtcBt4qR1sqKxsNZcJsVxO5ngkgQtyAQRD64yXzEV9bBHpWgCScsWyeQBfLNydDUAE+vS4HtNjbbSk7XeGkvj4r6VGVEFLPu5KbjcEn2lB+DzcR0z0sV+X7k2vt2fbgldohYT2CbbWGnQgejCPAK9NSsd0W2fqY3qIe5HtBToo0B8gBcAud13h5P2VkrXHvHrqHSGhBClRbki4TeN5oN05w4r+RjdsWNjFhw761gtZnzsA=; 5:Abq4PV20DnVu3lB7WCqHSY8BL6fXvsFr/4aSLvUoisd19NZFdgmHutzzNEpmA1ZBRCzXHCOU4ho3Ihk8lbVRRqRXB0sy/UiqZlB2eocL/dD/xFEx9NiuIbtxkLeKcP+777UuPTNt+milmZTBOZ6BI1a+zJoZpEVttiFlPzqOwpI=; 24:okR5dUBT9LEW81icMvyZF0Cn9HyRkCiIGXDCIbyhwTOMsTWU3vi2H3KjN4yg6g7iKr8dhfkuBziolBnAsO6KKti9MTa5dIIwg7/9RzG50VY=; 7:PU464/Pg+xOCazJUUT5dRo+Pw526yfUOcWIaDra4d2O3uD7heEH2vz+N59HpfATdm3G0qHdVE7JJqIG1B2gLlayeEj+6o43s03xXVqi8fOGHrFEUMqeX6/PDH7yv0nlqRSoJ4nEKR3P53pcCQvXG8tSylkP+V8Nlv8NKqwDbBFYJU1lymmsE+YJrtvv7uxWLTCBi5TJ7Bp++K4l23kPVKuX2dFX3qUqzkrVIxCDQ4ynzYayzkmhhcpS0aOeeliF0 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2018 11:27:38.9541 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5d263e0-65d7-4fcd-1657-08d55e667bc4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0502MB3797 Subject: [dpdk-dev] [PATCH v6 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: Thu, 18 Jan 2018 11:27:41 -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