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 48DA3324D for ; Tue, 19 Dec 2017 18:10:44 +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=jdvZfNibysz8j5hlJ++LK+vODnAOYsj1juSGgdbs3lK6Mhn1ES1SxL426rsmXYUYFWCbiq/hOjrYHNYos7rX19PXZ7kNAGwm/Kk32fR/t3tU9p03pYGXuHFVTNtG8DBLu74v6jh7RwjWOPQMpma8YMYf1nG6d0WO4k6dj1C4Gj8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM6PR0502MB3655.eurprd05.prod.outlook.com (2603:10a6:209:9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Tue, 19 Dec 2017 17:10:42 +0000 From: Matan Azrad To: Adrien Mazarguil , Thomas Monjalon , Gaetan Rivet Cc: dev@dpdk.org Date: Tue, 19 Dec 2017 17:10:11 +0000 Message-Id: <1513703415-29145-3-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1513703415-29145-1-git-send-email-matan@mellanox.com> References: <1513175370-16583-1-git-send-email-matan@mellanox.com> <1513703415-29145-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: DB3PR0202CA0017.eurprd02.prod.outlook.com (2603:10a6:8:1::30) To AM6PR0502MB3655.eurprd05.prod.outlook.com (2603:10a6:209:9::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ab477d8c-d693-4b89-2633-08d547036ffc X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307); SRVR:AM6PR0502MB3655; X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3655; 3:SFDzsO6flDlAthVpqWySc+N6N1c5FlRx0GE0pFNngjOHWiD3ZZ8ugKwJfxzXJKAX1OJNEFpaiWFviGGsmHR5oUbdmACmGBs6OUt2gD84q1fAukr++iIWmCCL8UBQOWvlBIEgT6gLqnaA9oK4INZPEx3gsly00jlBB7ecptD/CUsheD39rthabHReb5I3AlHrwl/sF7pBwXBh+hmOBYhre8myjt32+KfvMlt3SW2qacqHnoZ60wrEGSgZri6DO5Mv; 25:qs8276Wyzjp5vSvkYdO4tOCi1fOUTWFBK/Dk3QYtXgSKWRY7U6mT/0WfwkrYQArLy3l8hU/mT0BrSl/dH9FrztmAku3F9MWfnmtMBUgeCS7nJVSOoHWRwriycE2qTMrs++lmt4JmVCPtrp+xEshHoPckbkA84L1HKCWjsE1/EORZxb+qqpNErlkRJuEUzLproEi9uOMcDihQ6ekD98XeqpjpD5hRF2PvQq5rnGQTQbqMsT41IZ28qLI8lrDRnwwSrJ2CzdpQFH7SgZ7zCtgd1AQBOyKilWSmzOQBpdokUm7bFhB0kxRZ8N3XqhecBHhivWYjiyt/paYaHS2YRkS3kA==; 31:qUDcRsbrrznwt4i8GuBaZto+5skbhqKcOp0ZmusGtoGdsbHII0qLfA7njd211rnRy9xQzzXyI4J5DIXR22SxPo8k5UG/u4VT6hEYkadMnvDPitT6O4bmK8EtBIntneT9ySEWaaVJKzJoaU1tU/URwYEHycNF8c71rrkggA/hsvxrUdqYZhiXbbIs/Mbf1eTSEJPhuozHkZ4x4iR3XxIcUNUJ3A8DA5NbgUeWh5/HfsA= X-MS-TrafficTypeDiagnostic: AM6PR0502MB3655: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3655; 20:uY/usFZShFt+SGb/bNxOjGRiylwhMWPhBhsAoUF3YLGIpXV5E77Il3daIjx3PTtCwGGqC0OM5PodmtgmxSWpO19rB5EyIoDphIKXczFA/D/+AjMz1WewhOYChAM5phMfUsK9/i4ooUjPnxfixH/sMAdnlK/AvxcgEWBNuJCj62iXDRiM3QOu7f3UvSJuzMpVpjxjYjuZc1rqx/LqH4NdtmSnRTyfB5I33ys6SUc8bZ11Xn/vpckTulI7LgQNqNpRMv7TH6X1W6qOK2ogyX6kr2xJDocB0bBYBhBzUcc1MXTTpZejOJ9Jy45e0qoJ/du0zQY9I51F1UzwtTtcczXqjA5wuXQKIIVSWje5HuOF0XA3Wm7p1+Tx7APVlNKL8Uqbfwb+9TA42GUoXfQVZ+ypqYihmPLulFCd9V997I0ovhVEXvCUs2nNRRycJR/VTDdVj6K9Rzhspf1VjzCQL63eUQlWrLCbiV4FcrSNdL54zyfIUdECrzplqUQHsYEi0GYj; 4:wuNExVAbSpH73K2mEWBH9+leISJP1TYFzVzVIfAMcx/iBEr4zWo/ZoIsuGDTXQy0y5s+f3cg4ZOJk00/qBfwe90c3bVBMa85jQiu+p+oGKFErFQIOHXmjkxDi9eRkTe7kuI5Cu2ebjSHg8rX+a2gdnSQbG1BOYptdZHgR6/E0pJVJ3cpmFsUZ5IBPvH1wG+Gf2Z7VupkcKteyXySg3up0LhdXRE4xk9JEKu1WjPCNDEOGstuuAasGqUW7qT2gVIhbxTpkiM0N9xyrBy8CIOj1A== 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)(93006095)(93001095)(10201501046)(3002001)(3231023)(6055026)(6041248)(20161123558100)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM6PR0502MB3655; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM6PR0502MB3655; X-Forefront-PRVS: 052670E5A4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(346002)(39860400002)(376002)(366004)(189003)(199004)(52116002)(47776003)(81166006)(69596002)(66066001)(7696005)(305945005)(2906002)(5660300001)(7736002)(55016002)(478600001)(51416003)(4720700003)(33026002)(6666003)(386003)(2950100002)(16586007)(16526018)(110136005)(316002)(48376002)(8936002)(106356001)(105586002)(50226002)(50466002)(76176011)(36756003)(68736007)(21086003)(8676002)(81156014)(53936002)(3846002)(25786009)(97736004)(86362001)(4326008)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0502MB3655; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; AM6PR0502MB3655; 23:opsFchom4lQ0y4z3hT20tdKAeJi2a0HxZ4dd3O+?= =?us-ascii?Q?WJOoXDsqxqca/p2AI7joyLD6DooEKO232J3r6y+sxT3WA0J8tpx1qqqojoh4?= =?us-ascii?Q?xR1HH/lLAEWOlwg2eUq8QU6+n4KsC2OdNJx8T8uW/ToiSt2NjZ99QvrPddh3?= =?us-ascii?Q?GkWflSNZ4uYbFClgP4gaJtP9+ejI20fhAdHGJHMFR76vToL7CxGmoktF1vPM?= =?us-ascii?Q?74bLkMAVs1jaNfKi+WT71M0nW5CmBPGKLwfvK82XG5AjIQ3knEibluZnKcAM?= =?us-ascii?Q?Yfk603Hxotxf8Ao0PcZAMq3vuojE387EgBm/GKZ1AXIQc7G7Cgxtu2+sG+Ig?= =?us-ascii?Q?yzJN/PCqRJYPlc0s6zfmpOARiSm0eD11itIanfl21V7sfwFaCxwTpu/4j4ls?= =?us-ascii?Q?Hbv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XIBYm2hXcsA3kEaI+3D2Ohsu9k5a0gqmlG3p4jaxWqyHHbS6E2bwyCW6upzdQRqRUVzARfLDEKlYPQrZV3SEN19tJFf3voMuwLoZPkHpavHt32JzgXXTvzTwuA7qroksCiJCn89C1uv42TcVvi7M94gquWKEMVoJYSQoogqEkXlTUUZD3B5WhIoyt/Df3SJ0WdUv3t2NpFYiwG4fn77tIRaCHOjL0MQn4ytSsI=; 5:FTb/zm8LltQ9ewbYPg1zxC65vr/yRs0IjzdJ3G/rKX0jQX4wZOP9snkyG+zWMqlcDxf79WriMxODwHLBBkOqR8TNKnd/YkonuQEwDfwXNQvFcKtCG3WcLg/FgziO7dTv0hnXT8VuvZkO/XxG1a7/VXP/x3T1+8zdPK1Xqtm7gVw=; 24:RXSbIIhZIrgXBNs6bLnBx4qUGqwTeT0wm0Df5DK6Ul8RL2tqdBymzOSwr8LWBJgGyjsgt6dz07nkgkKo9vmNDzFAnjrY0QUIttR4xEJlLTo=; 7:Bspzua3n+sTNj9oTrs3PA1BH5OlunkteBzQiZ/OA+qPA+5x6Ff9YjSlVXJlDqua2K0QHrJcxsGiSRduaRb2bCfL6eHAPlxTJlOyL7i1Muf8+q3gZ/nomboYTNIADnYDQYTCv73TdFjXx7OCQxTMdF7wZXhufB5fQiiE56MrxX+eRKCl0BtWnRcD99owK6DMc7M4VpjxlJc1iXvWbdh+f/KiYAsHbpqZiuxngON2N+4tXFo7ml2xXGvE2WWsMOFMZ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 17:10:42.3937 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ab477d8c-d693-4b89-2633-08d547036ffc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0502MB3655 Subject: [dpdk-dev] [PATCH v3 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: Tue, 19 Dec 2017 17:10:44 -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