From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40063.outbound.protection.outlook.com [40.107.4.63]) by dpdk.org (Postfix) with ESMTP id 088881B167 for ; Sat, 20 Jan 2018 22:12: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=i263nPOShYyB/iTnWdQbSmSjHnFDswg4hQ/Eph+Djzo=; b=XEJuGpCOo/aFjJkONSwkvYrqY88SgAjz3fTCmCwyYjJKpGTZcgSrSQSybDqmET1s/fpXdJbQN44ok9xiSE68AlF8tT3nG9bhnomoQTZ053NNbjO9znd8QLYaoTEZHMGGMTzBSDFmD6T2YKLOlTf/ESGNiSNB/5UIxa/sb5ZLY9Q= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR0502MB3804.eurprd05.prod.outlook.com (2603:10a6:7:86::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Sat, 20 Jan 2018 21:12:45 +0000 From: Matan Azrad To: Ferruh Yigit , Adrien Mazarguil , Gaetan Rivet Cc: Thomas Monjalon , dev@dpdk.org Date: Sat, 20 Jan 2018 21:12:21 +0000 Message-Id: <1516482744-8415-4-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1516482744-8415-1-git-send-email-matan@mellanox.com> References: <1516274834-19755-1-git-send-email-matan@mellanox.com> <1516482744-8415-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0502CA0035.eurprd05.prod.outlook.com (2603:10a6:803:1::48) To HE1PR0502MB3804.eurprd05.prod.outlook.com (2603:10a6:7:86::30) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: deaa1f02-96b0-4877-3fd9-08d5604a8dec X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020); SRVR:HE1PR0502MB3804; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3804; 3:dN6rGCnOmBxlRyTLBLMK3kBm/GaoW7fZVgEaWo6I4MzuTliUihwmOnGsiRVMxX50jC71cSrDMu/iHJCveUJ9Mdc8jmXGKkmd6J82Jpno8sotYZkHSH+zH/P6+VZfqDz4d+gDDfLHy8GF/tTnx9rGvHS1Q9Ntw57/xlcWtmTHQQhKicJbYznTyrMFtDVR4PWUGW5LSw3TZ+m+N5OZgFp+DF9Q/YhbirYwkrFO3sKkLk+0Mopy/TwmV2RkyAHTMPDG; 25:uOL/fn6uVXdWDPx83bddmCisXKye1lanyoLvoiRYHD8U5AN56Oah40X/MlGdb56Y/MhjBca6Ts8kzBZaz+8kYZ22FVoi+AYc951Ote3hBFf1oMM3Z1WPnvF9dwNhUOCGFMkkB74H75sggM+8mYJ2Z+wcEWjI8Gzprd55hGlSnPO6rraOt5vXS9j9904ZQFVIlgv26QGH1Po8Ot+yYAeN9q7d7Bz71rIB8mGEH8srZDVAVWAVXoA8Vs+rxAAvHotgBlAlbydvk9uweIfENRGUG5wecmVHlPoia71JOMravM2REDy3btf7NajTq8FuR1JwQuNCpXJoN5q+u6HNbDkdAw==; 31:9AXOWXV9DYlOO7bcOpThmh+mZLJ99wYjsbfZI210j4d3j0XcCowIE9l0Fk4COmtkhfM/PNLL8qoJ5JXH9nrv0d1V01lTAyDd2USGdvbUWWqIP5ZOqY2tMr2rw1aV0bTqPCfromrskjvSN0Uuwisc1fIA4DQzuSbm6eZM2+waBwaoaaxO/Qk0sYpT4FvglTWUuW+W6CMd6hFot9Km0ZZa7JWfojS37J83sXDFQfmUl6w= X-MS-TrafficTypeDiagnostic: HE1PR0502MB3804: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3804; 20:VafptCrURzx+tZtHC4nLQa8ZTr2FeNP8tqoU10b138Bb5FKcMI2Tp8pQFAhuZ+VcGsH4UIxXL83bo2MxmWeonhQTE/wfT7zsSlDRDb6vNVgUE9MwHyG0QIPTs020L2W0yt1W/BSR2BS7kq/tax9iNBE+cSkgosjZ6tdWrepf46QQnSACgLerCgb1GSxVpQSechZGU16lyu/Uj3CwJkay0nUuhFjb6K041rmw3E/yrxTtxpmcMedpr28aupo+IZfAO+2kms7Q6Cxyu6DKzGfRrIQX4e123z/UpCv1Hpq1+df1LwMXiPL1Lokin/YJVVLe55j6WwSoIdczV+Y1hmH11shr6zPJuHtpFriYP1tYIxhVK7/uYoX4TvSxfLsXs1LbvuWA9rojdvLoyPjM5E+9FBdSa0Po77HsXZvC+kWB1mpeFtqB+T1r3ytpMCY3oVSeGIvSXvJRlj1j6/cifGYgLTqQIGpCN7VF7gSMSulttSYK5D6wMV2WVoKwtjim2oM/; 4:Mabb2u/RLoL//2ImumhUEcnIoJQrJ8AKTnUbR3nQrGotVGlwMTcmML14LsXW+nQDh4CG/SalvHSMtNHa+Ow5MEytqjR5BnathDZSh5D4wnrFvtdJUI4qBt82dl0IoROZXhCK1C6K3EToF6BVr+8DuFHycI10hBRtcPqucyXbpPEMGrypFnsqTwWCFikJU+HGtJheW/HU87htfLClDJkExtEllzaHNp5BKQ6n7wVNtABAu/nzEb/r7z3MLAZHK6yz+wUTgQbyiK80iWq/FWcmYA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(3231023)(2400081)(944501161)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041288)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:HE1PR0502MB3804; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR0502MB3804; X-Forefront-PRVS: 0558D3C5AC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(366004)(346002)(396003)(39380400002)(39860400002)(199004)(189003)(36756003)(47776003)(2906002)(4326008)(5660300001)(6116002)(478600001)(25786009)(50226002)(81156014)(16526018)(316002)(16586007)(51416003)(7696005)(76176011)(3846002)(52116002)(110136005)(33026002)(81166006)(386003)(7736002)(106356001)(105586002)(8936002)(8676002)(305945005)(66066001)(97736004)(53936002)(26005)(86362001)(55016002)(4720700003)(21086003)(48376002)(68736007)(50466002)(6666003)(69596002)(2950100002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0502MB3804; 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; HE1PR0502MB3804; 23:78hMffCBk8GR8pyMivcPL9iSBeP10alll2Ftr5p?= =?us-ascii?Q?/MveM/T6vDe9sFyhlPy7+URNPkWGGZY3ww4yTAEbtbM2UI/gdXEKcXd8fDKm?= =?us-ascii?Q?3D1lcmzvo0Oeq2d/r7goZsmVk/IOjp4/cRwP1XRkrQE3t0QKeh2RxxRKANpN?= =?us-ascii?Q?DNgAHZ3af9awqXDPJrHZVsl6AbDwXJFdzBZpnUAr5qTyWnG8YKhg8Rbbnf03?= =?us-ascii?Q?WmRYUT2zrSFg/1UT1DCiPPo4VQ7lyAxzqF25qTZc7jAT9Hp2gQY7Ae6ufSQ6?= =?us-ascii?Q?/LJH8SrwjVOdqscbeCtwK8IN4C1skJrc+GN15OqjfBwS+15Y7ccY/MGxhra9?= =?us-ascii?Q?lq6vZEYHU6NT9FaWA8il2+xxXzMDZ1JOcsVYPsoOJUzDlIEWnNpcQkWNF/8W?= =?us-ascii?Q?kEbvmtPM12qOHf184vKC27K/AYyd2yF7ZMBjeFBEZlj3xa0Aqc267tCtUrEJ?= =?us-ascii?Q?0GmrQXhfq1qVK96FdKO+7j8IFKieJiOt4GecVy6HP9YWX06SbPm+7VaPvNXY?= =?us-ascii?Q?snnuDMjYlfm20/HIkfYizB3GvL1T+xN9ugXJoivSPeAPxxc12bwkvaQi6MM/?= =?us-ascii?Q?JIbAsbABybrJdd26g9fn82XNk7jZp0AysxMdTGnkvfcrbrEIBvZwrsS0/810?= =?us-ascii?Q?V8GdTQ7qWI/sMHXQLyjKJACyL45Cy/7CYpTOtHxpnLYBOGVhhSaDEBx/uo+b?= =?us-ascii?Q?eMVhSG4GFz/JQff8rkwIfu50/jkd7wKBoiD9sccr3lV85H6ZYPF/+4GIFFGH?= =?us-ascii?Q?g6WSmTRm5wvMUBLotqVoIUO4BekB0Yxkqnc3GSeY8hOD96M26YEreJacaeR/?= =?us-ascii?Q?tU8s2mf7M4md6YzUoXp+ByqsEaYlCpm99gTfE3tPzcXd8RVoWTDbSywaGwoa?= =?us-ascii?Q?PmB90oPGD1jktySMqj7/CTWdS3NHFU1TUlN3WEEyJfduviaqTF+JQbm9yVmw?= =?us-ascii?Q?S5xoinCvLYS4LvGszJ3G+kndh+YWdSkwpDo0kjz3ficX9WeoCY/gd9+Vf2QE?= =?us-ascii?Q?4yfEKbSbGFTZFHPEQzB8HB+HocV1RlPYilsuAlubDxJMvhwIAdxCugA07e2W?= =?us-ascii?Q?H9t38NpUSiza783daJqCyxLNXbYtM1cS5XSbmkxyaElGBiDmpid8wE4SDsrv?= =?us-ascii?Q?dpYTVrPj3cj36XL40naW2+Mo0V/9weSYS3Qylg2+IUqdb515kta5fuA=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0502MB3804; 6:8+/Vk/1At1dMvtzwAIzMnuTsIpifhbhV3JkxX3Zeax6l2P/5QGNamw/OUX+dL5GMXTSQsfJPO/y+xeo7FkYCft7wWPblb4WH+t6Zo9c8hTVpoYOWc2wDF47EcrdJAk6FI39K/uFZv+2x09d7VkqPHTrQo5t2Ux01Y0OWnFoEoR7xSAgO8OiNInBpw1bT3sXOxl/D/NjReDaYosV2Ap1imWf5pdOi+WvztaclA6HDwu6shv4uko9PsEy+yRAaHbvfvT+zBDRPyWrvj2J2/eqsdY2I9cSmzp+R29vQQiRd23u2Az/+C8mDAvKDRdHwGbSo/lx0ucybENWs3Y4bh2StHgHWldvAkA6Uy4evY2nbAbM=; 5:lI5F76ApzjROrlPPmBey0sCBkehgtyGEjfMV/1u1WlEwsxXQFFcFDs7dsJgzVMRKJ08ccxj5gFSrAKuj/ynhrsYUkH1EsWdh/ukMzCvHVmCoulUcHP5HZmGO/bPoghGh5SK+ktA01WlUE3hAUmk/7Uq0VyICv6dpOLV/d+EiOTE=; 24:QnCjzSLN4rj/w28PMOqhwAagTzyVfMtHtgKkan0AhgbgGqyVze3OzMbKrUj435An1V5hFboR6X/VvqwGZkc+qt6NKn5JORG98czbKHD6lJA=; 7:fUNq42WRVtpU6M1GXn/vJRmkEUmbcptmM4MEbJUouTevm0ok02FH8VYUW4JtXmM6Dd+CCRnqvxAD/B3/gIvmmrco1dvMT6M7iZyo8dijU0MBloPbnW7AlesVGUORUG8pbX4V1dokjUb1txcuxDy+qejwZ+QP50o89wlZYnYll1RYHkWgJ/Xj8Cnw0EktpqX9TC+b+ASGf6uSgfLU2FxTJR3C5IyanRhBJZ6TxR5R+POfjNdx6Jv/u4MNlt/rJ720 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2018 21:12:45.7553 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: deaa1f02-96b0-4877-3fd9-08d5604a8dec X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0502MB3804 Subject: [dpdk-dev] [PATCH v7 3/6] 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: Sat, 20 Jan 2018 21:12: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 1c95f35..c13a2d3 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -284,6 +284,7 @@ .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 = { @@ -331,6 +332,7 @@ .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 e740a4e..aaff180 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -237,6 +237,7 @@ int mlx5_ibv_device_to_pci_addr(const struct ibv_device *, void priv_dev_interrupt_handler_install(struct priv *, struct rte_eth_dev *); int mlx5_set_link_down(struct rte_eth_dev *dev); int mlx5_set_link_up(struct rte_eth_dev *dev); +int mlx5_is_removed(struct rte_eth_dev *dev); eth_tx_burst_t priv_select_tx_function(struct priv *, struct rte_eth_dev *); eth_rx_burst_t priv_select_rx_function(struct priv *, struct rte_eth_dev *); diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index 6f78adc..1c067ca 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -1453,3 +1453,23 @@ struct ethtool_link_settings { } return rx_pkt_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