From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10041.outbound.protection.outlook.com [40.107.1.41]) by dpdk.org (Postfix) with ESMTP id 7FB9F1B2D8 for ; Wed, 17 Jan 2018 21:19:56 +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=oAL2uNaSeNasx4kt4LTbimK1KFGf6liKZ9ys1045BHrDGfVRME+NgIXgKaKt5V86GRWBgoEOu5gqQoaFrbJTSJkNSRgPpjVF90L79qCuM9ftOzcgSz+fxcNAov/J8apzpF2b8eCgVMkuKV9NFjgazkbnr6n252QZGaDe1sFBucU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM6PR0502MB3799.eurprd05.prod.outlook.com (2603:10a6:209:a::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Wed, 17 Jan 2018 20:19:54 +0000 From: Matan Azrad To: Ferruh Yigit , Adrien Mazarguil , Gaetan Rivet Cc: Thomas Monjalon , dev@dpdk.org Date: Wed, 17 Jan 2018 20:19:14 +0000 Message-Id: <1516220357-13013-4-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1516220357-13013-1-git-send-email-matan@mellanox.com> References: <1515587465-9304-1-git-send-email-matan@mellanox.com> <1516220357-13013-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: HE1PR06CA0129.eurprd06.prod.outlook.com (2603:10a6:7:16::16) To AM6PR0502MB3799.eurprd05.prod.outlook.com (2603:10a6:209:a::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 855bea88-9753-4cf0-3d25-08d55de7ac89 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:AM6PR0502MB3799; X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3799; 3:3jhmTWLjWyf9It4Ykkg88q0wvMgK3O6B19+0xCJwB82Shvn+6audaEM6DEYL3C23Q0Vjobepce4cXHtWrXkHJFGOWdytf7EaypXEIEvw4Af3v569gaTHOI7DuDwTHf6UaydCTdD7IGwjPwFTu00+E+K7U6NWABEwWlabdJem2xDJ0qq4NKYqbqP872gSIcA5l+j9baGSm92Zhos1NdVG/ixOAIMQQ9FdOpbUebOy5AjbXeYkmybjeQK7WQwHHdWX; 25:YsSg2j9pSTBDOeCdNHLcs6Amjcv3jaEkWxByv9qSLLr1vdDpeQ9wPGrc8inV+G5Te+058U9gNJz+Ce7yDG11fB3mb9WAEiBndWeGmMoN4OH/o2JuWtyZKpkRFV07YEwVr6vKRmHeyYXKJQ3rERvkNaPpneIJjGdRPEZFiXebH/dj6y5qO7lVkNCEJXE40jjRK9cx06Cnv81sMYeTHpVDkPXP21/KkiNnvSzu9yebTXSGH6OxIcPQMNCE/Tzh8DZb0RXrx2Yi+q55Mkw23YtYgXj36A1N04CQDJdnL0WdJ+j/diQxB+YWq2HahT+DWInhazxlUcXNEheJAJRUyLeqSw==; 31:NE8Je6tkTbjHoB0gBS5HAnzW7vatKUWO5D0zRItmeIt5kwfDYdI83V2DlrugEarG6ScooYJbs9VXXFHkIHRlORXvEJkney/WFtXtU8J5cATP9rbT+svAervtMskp4IKgaKZGtqTEOCi5Kju3ymbJ/HHCiY3lg3N0GKMUpcXuSNmsZmwSCOP+ZkfRzJ8U2eBIJORRxuewceDX1wZwId3Ovw1CRtkc+hKM42f7ZD7MpZs= X-MS-TrafficTypeDiagnostic: AM6PR0502MB3799: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3799; 20:micL75sONdM2cViGAPuaj05WdF6qoj6fP9ZFStu0hfDo1jT7D++MnRvjFg9PXgIyt83wy6Jl513xsst71v4of7q8p0xH9xuw3l20VtsD3Udt/cO+bBgXInHT8606tbt17/7xYtjyrOJYnhxsHMcSAFNT4uC44D71X2Vv5SqlF3H7sl2YEmYyyrMQ6mtKsIIIYcIDW9qHD7MZ5lt9Tl2q5PMZh7nR3JZpJe+giTklCK0WQ+l0cLLgdEA+Ev1wrRSU5poR5Cc6AAHCapl1GpJpoKf5erhp10gdVl+yUH/xAt81tZ71o23G9jHkvv9K1Esgo1Om6T/ZM7paa70WCAp1Hsy3Ki17diwsv64ySeSeYIil0a4iI6QKWbjZNmjkp1veNRQoIE44oOyNfku+S1W40+rH7SyAazgcpnz3uELs12nC97pWrK9PsYPxnbh55InijOEfFooS/Tg1dD60t5re0Kt+6JszWqBMzaHNvjaJKDXOwbqQKaBSa30X0Efihuvv; 4:vRbg6WQMSG3gTpkDp6azHXBBJ3Rati4cOXXskMZynF84WBu5hQLAVoNb+1J0T0hUu3xO+AiNzt4aTxIIh2AcBDeE01qr4E2quDHmOr0e0INKkg39rpriiEYhvvUyC/39otkBUkMSZWJATFBBzfBhVETUs/84mbasmchYEr70ljS+pg1BmkcPB4KnjVaOSrpp3dXZWhKL6AURgLvRMLWjDABlsUaiEWzhylEiRcqn3SZznhZGWh+Ps+LybmB6MXZtAYReux6LGvxjz543l/TwrQ== 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)(3002001)(10201501046)(93006095)(93001095)(3231023)(944501161)(6055026)(6041268)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM6PR0502MB3799; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM6PR0502MB3799; X-Forefront-PRVS: 0555EC8317 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(39380400002)(39860400002)(396003)(199004)(189003)(51416003)(6666003)(50226002)(53936002)(68736007)(106356001)(55016002)(21086003)(47776003)(16526018)(2906002)(66066001)(105586002)(97736004)(4720700003)(2950100002)(478600001)(52116002)(305945005)(48376002)(50466002)(33026002)(5660300001)(76176011)(69596002)(86362001)(3846002)(7696005)(7736002)(8936002)(81156014)(8676002)(110136005)(16586007)(25786009)(386003)(36756003)(6116002)(81166006)(316002)(26005)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0502MB3799; 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; AM6PR0502MB3799; 23:2YiI1gPYKVtbqKjhtLwW7KGXHLTjg18WqN1KA/t?= =?us-ascii?Q?jlZD+AIZVsxCI9DaQRvXOEZbY2XxoNSQ9E+FjwHneDge5FVz4vhgBC5KaFak?= =?us-ascii?Q?h4zkQfVdZs0byzHiNX1/jxLgurSG8k0PceAGEAPvds+SKLI2KaclN9twOpIc?= =?us-ascii?Q?nrIEA2KFby0zsBtOghoCYIClQSQfhXXlHEXEvevi+5FSgyiXqGOQDgeRK4IT?= =?us-ascii?Q?f7Ejx+Q4TA9vbXiHmvLAUoTJ7B49gZ3aaOamqxPI5vDmpwNANPmV60MM9leX?= =?us-ascii?Q?wvrIfbAVvjf0yHv9n+/IVPH+MVi01PvpYCBGA0oKWjf2GmLRlAqzVVqKZ7gX?= =?us-ascii?Q?IzGXAubFoOfxTb7PYa48ri/du5y5Afj/0RRdpCHfhsMKyTr4P7TERdJ8+2Lj?= =?us-ascii?Q?LBJwPsdJ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woK4VHw1duPVwOS04ErB4xBsc/eevS5XSi96yr/3lbsnlfbmccvvms+lpeTxKE05agSay9perBermv2+R20sg+op8ArziGh/XQsDivGSniw6mM5uNrOnEP+93bGBV94qqEr896eRtbYyO/rXfeFOUUXfZnLa9oUjS/VaswACvMb8A4d/bJtiQJ720VedENwgu/YgPkN8UAsEPlvL6rVuOcUT3G3mzQN8J9GmKC/RAlb25sFNMaDSJ4cD7SDu6YrvfnQfIJ7GhWCsBvLklM8BE=; 5:P96e+65QOjzeVE8ZhWnM3qUeMvYIPHuZZe28X/oYpTwSyra8bvBSZoJiv8U+ewImZXEbwT+1xuQWyJ4MGgu16UUx3PPegCKItVzEEoQgPIFOpQVHRajG82MPyMcJKVzM8OZF0tzsnNjgss1A5tdQge7NZzKMZyt/dxgtkaxb7Mo=; 24:UNLJoaV5y1X5bVdLf6GFsMPfghQxpuF+DIBQZpQZeYn1thuMBfhaNeogoT4TtxlZmTjUqvQ5KjNbgEr2z8WABqBcy+lldAiJO7/cIYGX4kw=; 7:ioHK/1PwPcmKGs2RkTJ1sILaN6g4ns8FbErGkxwf5QZcd7nzhBgz4sIv7U7n2ZQQdlKq5c2F4ylAu0+gbRlt1f245RZIlfJjr/ZaRfs5NzXvv8N3lNU9JG6AemMB7TQFAjuSx25Y5251OnkmVAXlGmGC6SXuhi9k4c5SxT5fROJBKQmGRBUj66Bw+Pj113ZPQXDSHGPzftih6MzHm5qJjgFeQX2tmwbEByBhG25GSvnapuFvZCsZGgeiulFUBJwn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2018 20:19:54.7078 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 855bea88-9753-4cf0-3d25-08d55de7ac89 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0502MB3799 Subject: [dpdk-dev] [PATCH v5 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: Wed, 17 Jan 2018 20:19:57 -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