From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CA128A0519; Fri, 3 Jul 2020 11:14:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6E88D1DAF3; Fri, 3 Jul 2020 11:13:38 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00050.outbound.protection.outlook.com [40.107.0.50]) by dpdk.org (Postfix) with ESMTP id 4CFE01DAEA for ; Fri, 3 Jul 2020 11:13:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nhpVOBE3wY7nMBjgIl6EcFhWfFOVxOqORZgylX/ipiuk2jWXWzNWWA/UNWpt3gRDYL7Nj4lWeHoGoDHCmYgIX7o9b/WRtMfboJjAFs7E/WWT1UIq5KB+H4DwxXXHlueOff0LvjEUwJObzE9mnw8vME1x3RC/tsD2R1lRq4xiv2pVz9+4jgQ7vg0nHrKs52A2jXorae0/Nt5J2xsdf5s/TCzLhwJjgKmshSYUVIPd8HxoGIeo5lm9uQ5kRHUMW8u7aua5axj7zK9deBU6OTIpGa97ZINRnU7lHlHleO0cJ8765HzHUW7k63xcwusZ3ZehNml7XceGu6zBe4lLZlX8DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lgmbu8YCej6yknLxRQkkI4F5+lGEnViI9QpcpIpe8zs=; b=AHJBqUx/9JB1tcsYNXNeQhfs1n70YKhttBgGvtdk9md47y6FqF9sSlMW8qFTqsPZLy+BiXdpm7MDzn8Qn+SSZyU1kBEs4BdXA4yIIOxKyzhxWkAsQ+vzIQnzdR+fH8sT/IxjocIsmtRr2XGgksG7JisJpp0u4uMNJYWc/V3302+89wR6dYyUM24NnrVOLINvp1Q/Qei14QP3ScttmN8cP2KFuG85BYRfyrNunNeyY8xdTrkDBuRQqJ7mZE6fkR4aVvic4DJOvZ3w9mv/t/OrO9bVaUXNfzmrZDOnVtActCu1GiGFW5I6k+OzvT+w0pQpJXA1zy2XIqL2Ss/ff7iPAg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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:X-MS-Exchange-SenderADCheck; bh=lgmbu8YCej6yknLxRQkkI4F5+lGEnViI9QpcpIpe8zs=; b=nD39PE8Uxv7WfWhA/fiCYbbCHKjiFr2WwSfQGbZARNsJjNsXGrhCVfCqFYj+IVaLfEKH0eM0ayGDQPbdiN8p7pcQECH1fIBALmDc3JD/n0eSI2xFMAPvU4IbDYdlua6DccayYWpClsLl33h9tCkib/2RYJ4BjJ1V99guEbR+T7I= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB4866.eurprd05.prod.outlook.com (2603:10a6:208:c0::32) by AM0PR05MB4353.eurprd05.prod.outlook.com (2603:10a6:208:67::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.24; Fri, 3 Jul 2020 09:13:36 +0000 Received: from AM0PR05MB4866.eurprd05.prod.outlook.com ([fe80::d44d:a804:c730:d2b7]) by AM0PR05MB4866.eurprd05.prod.outlook.com ([fe80::d44d:a804:c730:d2b7%2]) with mapi id 15.20.3153.024; Fri, 3 Jul 2020 09:13:36 +0000 From: Parav Pandit To: dev@dpdk.org, grive@u256.net, ferruh.yigit@intel.com Cc: thomas@monjalon.net, orika@mellanox.com, matan@mellanox.com, Parav Pandit Date: Fri, 3 Jul 2020 12:12:58 +0300 Message-Id: <20200703091259.2108996-10-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200703091259.2108996-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200703091259.2108996-1-parav@mellanox.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SN4PR0501CA0006.namprd05.prod.outlook.com (2603:10b6:803:40::19) To AM0PR05MB4866.eurprd05.prod.outlook.com (2603:10a6:208:c0::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sw-mtx-036.mtx.labs.mlnx (208.176.44.194) by SN4PR0501CA0006.namprd05.prod.outlook.com (2603:10b6:803:40::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.8 via Frontend Transport; Fri, 3 Jul 2020 09:13:35 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [208.176.44.194] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6fa483d1-b65b-4208-9185-08d81f315de5 X-MS-TrafficTypeDiagnostic: AM0PR05MB4353: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:773; X-Forefront-PRVS: 045315E1EE X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8mwEI+9TibMOdyIziblD/PQmNyNqpR++ByPirMtJtCVWmDYuTwjdJkxSYU3bsWrdasay+GigZlCPzSkV23BFJv/oveoAqaB9QuIGeL85FkR40C+1VsG1LHCR/p6JAQD0iO2HEH7o+XVfqnz/0rKEX/SSo658Mhq8D87jwdREwJz/jAFsZVvpwseA2ZXTr7OQNrxU+hfu5jgWGiPYDztU377qnckKMiM0jcExgRAjQveqPlz9HwvNjUjsazMvgzkQxxZiSVTviZq+tHiUpx5eulPl4xvoL2AOs/9ilO6wNc8m3wEVN8403kExrvUudixs X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB4866.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(346002)(376002)(396003)(39860400002)(136003)(66476007)(86362001)(1076003)(66946007)(4326008)(66556008)(6506007)(6666004)(2906002)(6486002)(107886003)(478600001)(6512007)(16526019)(36756003)(316002)(8676002)(186003)(956004)(52116002)(2616005)(8936002)(83380400001)(5660300002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: cZwdAFNy1Lr9EuXYy/s8oBamyD9lQ0WyOCWJEKIjzaP1okAtJnrhSS3LePP4w/XIwVeDwgkVciRz4S238CIo/VncdBtZ0ddOa8su6zcUYWpdAKOQ/k1GpoEBPPpqxiuZYvRt+dpgtkY00j3XEqrfboYE2B2+iJLA7iwX9c0HknjTMnUYUElXZGZXUIx2DTA2GkD/yD1y0vaG8KCpCt/yQk5ty8CEDsWfbMCYIqh62DKlhuQArUS7QwqA9rHZIUwN+Kzwu1cWIo9yhrdnfN2GYwu5c1SE10tdkOPvXp1O9GA2NBTUQDZ9UdkceLTNl4S0eC9zqlQhnPISgJqEnBm61+e0djYE5YZAf8eJOA77NQMAbkXxlYVSXOk5Jn+4P6iV3kWym4x1umb7b94OMClafdlti0k8Wc7p4RPt0dfBCX3yMaHYhz+XxEB6XuopHhxMl3dyAF+zpzs9ZnXnJvd0+FJDaxZnWq8wPFI2hoCGRqLi0bTDRcHUHlT9q6AwlPHb X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6fa483d1-b65b-4208-9185-08d81f315de5 X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB4866.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2020 09:13:36.3878 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lDWZOFlrwRy/ZfCn7hnxkdvkDaAaffUPcCrRRtczGLy0uaSwT1fWui1RE8+0Ozf0aVset6YSAwNkta+6jzoFuQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4353 Subject: [dpdk-dev] [PATCH v3 09/10] common/mlx5: remove class checks from individual driver 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Now that mlx5_pci bus does the check for enabled classes and performs probe(), remove() of associated classes, individual class driver doesn't need to check if other driver is enabled. Signed-off-by: Parav Pandit Acked-by: Matan Azrad --- Changelog: v2->v3: - Removed empty line v1->v2: - New patch --- drivers/common/mlx5/mlx5_common.c | 37 ------------------- drivers/common/mlx5/mlx5_common.h | 2 - .../common/mlx5/rte_common_mlx5_version.map | 2 - drivers/net/mlx5/linux/mlx5_os.c | 5 --- drivers/net/mlx5/linux/mlx5_os.h | 1 - drivers/vdpa/mlx5/mlx5_vdpa.c | 5 --- 6 files changed, 52 deletions(-) diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c index 0ce5e4db1..771e046c1 100644 --- a/drivers/common/mlx5/mlx5_common.c +++ b/drivers/common/mlx5/mlx5_common.c @@ -22,43 +22,6 @@ const struct mlx5_glue *mlx5_glue; uint8_t haswell_broadwell_cpu; -static int -mlx5_class_check_handler(__rte_unused const char *key, const char *value, - void *opaque) -{ - enum mlx5_class *ret = opaque; - - if (strcmp(value, "vdpa") == 0) { - *ret = MLX5_CLASS_VDPA; - } else if (strcmp(value, "net") == 0) { - *ret = MLX5_CLASS_NET; - } else { - DRV_LOG(ERR, "Invalid mlx5 class %s. Maybe typo in device" - " class argument setting?", value); - *ret = MLX5_CLASS_INVALID; - } - return 0; -} - -enum mlx5_class -mlx5_class_get(struct rte_devargs *devargs) -{ - struct rte_kvargs *kvlist; - const char *key = MLX5_CLASS_ARG_NAME; - enum mlx5_class ret = MLX5_CLASS_NET; - - if (devargs == NULL) - return ret; - kvlist = rte_kvargs_parse(devargs->args, NULL); - if (kvlist == NULL) - return ret; - if (rte_kvargs_count(kvlist, key)) - rte_kvargs_process(kvlist, key, mlx5_class_check_handler, &ret); - rte_kvargs_free(kvlist); - return ret; -} - - /* In case this is an x86_64 intel processor to check if * we should use relaxed ordering. */ diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h index 62861af05..ca66c4033 100644 --- a/drivers/common/mlx5/mlx5_common.h +++ b/drivers/common/mlx5/mlx5_common.h @@ -243,8 +243,6 @@ struct mlx5_klm { LIST_HEAD(mlx5_dbr_page_list, mlx5_devx_dbr_page); -__rte_internal -enum mlx5_class mlx5_class_get(struct rte_devargs *devargs); __rte_internal void mlx5_translate_port_name(const char *port_name_in, struct mlx5_switch_info *port_info_out); diff --git a/drivers/common/mlx5/rte_common_mlx5_version.map b/drivers/common/mlx5/rte_common_mlx5_version.map index ae57ebdba..01b4358a0 100644 --- a/drivers/common/mlx5/rte_common_mlx5_version.map +++ b/drivers/common/mlx5/rte_common_mlx5_version.map @@ -1,8 +1,6 @@ INTERNAL { global: - mlx5_class_get; - mlx5_common_verbs_reg_mr; mlx5_common_verbs_dereg_mr; diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index b6042b7ef..2bd2b664d 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -1308,11 +1308,6 @@ mlx5_os_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, struct mlx5_dev_config dev_config; int ret; - if (mlx5_class_get(pci_dev->device.devargs) != MLX5_CLASS_NET) { - DRV_LOG(DEBUG, "Skip probing - should be probed by other mlx5" - " driver."); - return 1; - } if (rte_eal_process_type() == RTE_PROC_PRIMARY) mlx5_pmd_socket_init(); ret = mlx5_init_once(); diff --git a/drivers/net/mlx5/linux/mlx5_os.h b/drivers/net/mlx5/linux/mlx5_os.h index 695722520..31add3988 100644 --- a/drivers/net/mlx5/linux/mlx5_os.h +++ b/drivers/net/mlx5/linux/mlx5_os.h @@ -15,5 +15,4 @@ enum { #define PCI_DRV_FLAGS (RTE_PCI_DRV_INTR_LSC | \ RTE_PCI_DRV_INTR_RMV | \ RTE_PCI_DRV_PROBE_AGAIN) - #endif /* RTE_PMD_MLX5_OS_H_ */ diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c index 09c9cb935..41d69e8a8 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c @@ -680,11 +680,6 @@ mlx5_vdpa_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, struct mlx5_hca_attr attr; int ret; - if (mlx5_class_get(pci_dev->device.devargs) != MLX5_CLASS_VDPA) { - DRV_LOG(DEBUG, "Skip probing - should be probed by other mlx5" - " driver."); - return 1; - } ibv = mlx5_vdpa_get_ib_device_match(&pci_dev->addr); if (!ibv) { DRV_LOG(ERR, "No matching IB device for PCI slot " -- 2.26.2