From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0058.outbound.protection.outlook.com [104.47.1.58]) by dpdk.org (Postfix) with ESMTP id A1A201B00F for ; Tue, 19 Dec 2017 18:10:45 +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=nAU6n1nVv3eLJZ6X1MM3RLxwvw88znM33VxZHPZNpFE=; b=caHwCyd48jEOjLRxHHrtPenqftS1oZOXOHrpVLLwqSzxDKACNuY126xKbblgjY6rkPW032Lm80plZZ+xyvUltSaFoUs9sya3d0tqS4KOhkoPpRr3lfTh4i8rNTdI0quEZZ2rXxT5E1+TxHsGfMPTumIGZb+O/tRztBL+Q32POMY= 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:43 +0000 From: Matan Azrad To: Adrien Mazarguil , Thomas Monjalon , Gaetan Rivet Cc: dev@dpdk.org Date: Tue, 19 Dec 2017 17:10:12 +0000 Message-Id: <1513703415-29145-4-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: a65aa0c6-adcc-43e7-0a24-08d5470370c2 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:skiRNJDMvz3UUN0Ij2f8R2LQT+NBxCbFSOgCfOreSNxmlGP4kPPuJGKPK3THYt04RmHFJSm0zOYZJ3iEt3yImsaOaBm2dlExaAwkpWI4Q0kRL+of2WVizgP4RUxTYCuHOE3NigkzY57WQFBDHywasDRH3TZJDOHL5unUlbs4mcUM4GZJZUXrE+2lS4ioDcYxHPeuk8GtVWbgRMe/7rv0ol2ICPp4/Ci8jUCIRGuf5ccxEFvS7g4QF+1IwaSjYzvw; 25:wxVQpcV9dzoYg28QlhGP/VrhdsJ1w6bwRP7NGRluFprr8ht+DYu3x7fIa0Wpot/ba87sNEvg7VNgNidV48QCn+hghMQMfhSTNQVApVVOuF7/dgLiuG5brzf/r6yV0ibrJ+cY4K2Gvqv+C5xnMRE7KsaA11ZxksRjPOJ4DgD8ekKn3aEH5iiiBldCRSahC++BnUHOPJADA3Ksk0fwPX0RFaIhgtRidZ1eHPt/9G2S7aZiR/LtmyRP2/ygubMJvDgsvImbulk0FicKSCbxdYEq3bB04z0fAFj85b9g3hSi8NJLb32IHcofp85E6C42S5A5yNunALfMJTqeTXqBqAMirw==; 31:VsPNvO5dUE4wwW+FKeGKWsahM5NZr4TdSw6FXz1FQAzMUJHG6LoFhiyMVvgm8ghYrcW2NN1bLjRdGSFoGb/Z5wFE8SVzDYSofy1tvCZXs/L1mGj/I9b+2YJ+IpF7MuzSJveTGhyskye4rImW/vWxYLpQdEjKlm3NDbILfJkeNOVuHhg6YIVFg93OlR2vwQwAAmI/cbMBNKixRiL/G/jaJq7lS0lH9hHVJ5vEcR+BesA= X-MS-TrafficTypeDiagnostic: AM6PR0502MB3655: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3655; 20:f5F72G2QMhNGL44EL/UT/3GuNVLY7SrNtprGDU82gPn9LUxX5Smn1dGx9M+1PbBP7UetNjoKy8r9fnmXKtqRunMEtXAGbT1frRw1bGyG2ZejXuTEO0QK9ufNxbyRM8JTUKGyzePOXJKqTNoQTgj/z9ftpRpvVM43J4MS3RIGpaJ3poGpjVD+mPxIRGGWpYrN0f5TM+IoKq/XDqKVVRqJxbDzeMQvKi8OBoIzxIJvXk0gzwiio4uVCm+G+mTQiApkNsqDs+u3qbH5ebzI/zzQh6wETCbEzslnR+cbPZXl/VVA2vzmMQMTXagby1FD6xEMZOvlXH5Z2vGQDhIUlY5XoK3Pfefb6Txd6EZHeTRVA9c3YFoTYg8APndP+j7NI7uDNC9wP1FfZMWWVQWLi7KwYwt6xFfKyOnGzt3Z6j2jYy9QQ6XWPTwPaeT478gGX9oldCGdB2F/dvbYc5N8gyxl2WQPX9oUEWPzqGeE81b0llbv/7F99ziziy6HPZEa/2he; 4:O7lj01tLyDIrvZmfuCtRDYo5E1WW6anZnUW3LC4BHuOsI68k8WTY/1gr1orAiFOT1IIIfgIGfZWqt3ycgQN5/8YQBSqdI9mJ+4ZjA3EqfGh/uMUIFUCvbKWwYvPwO30NnhfRvtATTqhDIG+isFbcndYwu6aHY3ZX3pGt6BKFps1x/6oEeblXdkMFO6CeCBncahnWalLejdU1Pvn0+m0TLPYctM+t6LAf8+fhynXLZV06aI7m1FAkhRJb6h1Za6+sk7h098jAUgdhxSZ5yKKWtw== 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)(575784001)(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:N0P/doFupj+IZPbqirTXh/7WvBtatbyb3PLDIIO?= =?us-ascii?Q?kLpXcw4U7GKCuPNmYAOtT4+gUk/u57LVaMhmjfxQCekta8AP0bWi7k5vTBIX?= =?us-ascii?Q?ss1sWNDDgyLMSLiqK2hi6sf7mRjkvl0Dnoo4BxnmhMEhE+T/SebIg9nOObRf?= =?us-ascii?Q?KQiVjBevhQdyxCjor/87PM+XsBdZguAWrr+wcQQWqBnhSpQJ2qemzuTiHG5G?= =?us-ascii?Q?Z9gcX53NA/kgR3bYwkOQv6rxTiGWJVNUQCPZ2KFKU3Gq45AEjRkCDmfxmP3Z?= =?us-ascii?Q?a6vPlHT+f0If0u5cz+AXhG1aCnN3MfkkMpVZjmc2dGa+/IJo4wcFVbboNzF9?= =?us-ascii?Q?17aVyYQM6PeL5Re57K04iw2xU8kvyJaIxPc8PA4E1nm5NXhQcTdxmWeNlWVU?= =?us-ascii?Q?miQAv3Vozj3d45v4dQjyUc9TSj3La9udVPgJPib7dV8swD+suU84bP3572A2?= =?us-ascii?Q?oj9l07Kwe50ogStzi0R/b7VOhnFekUesAIiy8AplbE13rw/2QKry+m7YL4Dr?= =?us-ascii?Q?63VIPf/y7nn/2XRlIpVXMiWwMToYMOEwxK7ZTiqbq58lb1m8jKUoXcw8LBNe?= =?us-ascii?Q?cxQaVN61pkbxLFFqySShbzIk8NZRPXzp1i+OoGPIGI2F1g+5s9AzlZMFAJAR?= =?us-ascii?Q?V7g+7J2dE3UqW8RssqHah8GgKDxU2kcNKqixy8bNltoq7pkm5aljbzQX0HAG?= =?us-ascii?Q?jMA5YElCLLJAB/YK5Drs9YtyecBpFM1nB8G1o54wc0AMhd3qGsM6QOpGfyN8?= =?us-ascii?Q?C/UORJ2LTgHgCJ60HjykIPe0K6CRuCi4zlIad6qdVmGg3lNlW121pEo//aUF?= =?us-ascii?Q?rqS1B86BkfHI2dbiLoSIJDxbqV4WetcR7x9NhEuCDQGXW7Pg4g6QI2zJJR/1?= =?us-ascii?Q?575+M9e6XNFGePeM0lZDKPDCmfAhdVhtPem0hX44itMXa29rMuUCTcMvnN4Y?= =?us-ascii?Q?z7ICHLumtZmL/RCkA4TdAJ0xGduQ3H6VdfmgHlcZhotQdhMITejPqSXt5wcG?= =?us-ascii?Q?nw+xashPzCRAF6U304CR/850uhhhJ3dqXe2GkTkT7pf0usjkHm4fSSAF+ivY?= =?us-ascii?Q?rBfaL1qe/psEuqLXQ+zzjjDcUlF05lZdUmTAJj8beHO1RiJaLm8fZxenLWVC?= =?us-ascii?Q?cE9qjvaDK5UgjquFzbBLMmE8at20ROJ5L?= X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3655; 6:aqGPtqEI2Q9RGaFS+bvgGzeJvUqF7xjkttUVFBbEApawMXicI6Mg2YezLsCpGuo3rfNtB8eZRF4pFSqOWznYVbrtf7W4LjwLVmkYbxrS2ubBQp6DOac0ds2VaH60hlF5yb28M1kOTEuOcjoFbXY8e/vhzjuOYEpXLCz9n51HjZakoX5Fc82t9iYI4R1na05QaBajr0EEWaPsPEWzf5mwaxJSbZDHXDNcwPYBynXaymWty7keWjHOjZZW3kQ2XV9i2CYdOBovun8naEktspSAi59cAQBaNGVyDOgwVw3SNqtUxHQf98BR9JGSBgpHWXRYie2af5cw5DunoVVmoPNK0qY/u9UoTrzZ5YRFj/9QRG8=; 5:tLuYRkdA7lktjTBgcAl1b+OcPWGOyXI4GtMMtnkCZJWUALYVlJKShKTHjGtj5MqyHJNUjpPEXORi1PRr6Fg2llFaHFrbi3bKt5hOeQuDMTFevFHXqfSPEfAbcL52/i1bnbID533bB4KVGc5H/SoGhP4NzsMuCLwoHoRKqq82cLU=; 24:X8+qX5yqOktp5X98TeCWU3dJGiYVYoIzsMin1DS7u0GF/NMvkmi5PUmSOywznWBBL4OU2WJo/lr7elYLjGOIkG06DgEAzRgyhmjEr5vBDRw=; 7:EQ4xofXJ9ANjzROPo0S2BOdi3wwxYLCrjD+vi5HGUf+9lezjtNnP2kGJ0zH68VZDxf/BtnTy18tNk3nKcZW8YIu3EPBjxdeww8T5xNu0O1NgGWO/8pEgP+aPRp0bD4gnl1oxshmMmaCmvSBv4VFFyNC0TFWtrk62Fr4/xZ3xMVLrOJIjbrrYYZ6eeHTxVGY34hP61k9RgRKZYfHIzBzGDpN/E0i0GE7IDL1E7arz+kE3Oz2C53mbB3BlbioBJEuB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 17:10:43.6906 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a65aa0c6-adcc-43e7-0a24-08d5470370c2 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 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: Tue, 19 Dec 2017 17:10:46 -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 0548d17..e0b781b 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -303,6 +303,7 @@ struct mlx5_args { .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 = { @@ -350,6 +351,7 @@ struct mlx5_args { .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 e6a69b8..2ec7ae7 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -208,6 +208,7 @@ int mlx5_ibv_device_to_pci_addr(const struct ibv_device *, int mlx5_set_link_up(struct rte_eth_dev *dev); void priv_dev_select_tx_function(struct priv *priv, struct rte_eth_dev *dev); void priv_dev_select_rx_function(struct priv *priv, struct rte_eth_dev *dev); +int mlx5_is_removed(struct rte_eth_dev *dev); /* mlx5_mac.c */ diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index a3cef68..5cf0849 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -1474,3 +1474,23 @@ struct priv * dev->rx_pkt_burst = mlx5_rx_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