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 B76BEA0350; Sun, 21 Jun 2020 21:13:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 151FD1C1B9; Sun, 21 Jun 2020 21:12:35 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2076.outbound.protection.outlook.com [40.107.22.76]) by dpdk.org (Postfix) with ESMTP id D317E1C118 for ; Sun, 21 Jun 2020 21:12:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VJIAT0qCmD1srQR5vN7B21iBNHb/6WhjanPx3I4/TczqAnOy7L6Q6Mgi7nwc1i7ZEn7BwMZl3aWS3DkaRATkA2zROiHhs4SPjrLFXuunnLdzN1+akRUqEj9eN/NY2KaiQ9UGA+2ogtz7hJJiwPVSdU+EHv0uZG2zexLKhhwgiPmimI51Q0K5h4Pjd9B+BdHoVqh+BMzs2oEQbWYfd/RJyQ5mj4OwUw6yNeSub75akp6nTEfGBryPqPHS6No41ZC/lBcAAjYUhvkkLKpXKCoZqgC0lbWGhkyJnxnUwZDP/wIEspGZIATLa2IH9UK5P7AKlFQO35iWMsH2Ft9pKkSDdA== 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=1/7xpkFjecFxdx3m9qJQntvVRDMPFAxUcDk1JCVKXFc=; b=QQHWRhG++QBnNtNHYmOWl0/a/cI/Q+MINyX610j4S3xVdfMvl9ebT24CXU6mA4MUV5LMNLF1WG5ydhgFqYBFLdjg4i3APh1jrgGeiSLabc/lnCtmA5eF8a59CMbALqa04cMZKr62BWE0pCEgnJvugnMXuWodMsuI4AcaMypHdGTU9sSZ/w5KoFSm9u1OsYVIP28Od2L7Ma7hcvaIu8jaYcpeddRiyAwIJwELUD5XqJE2sUc6O7oR/qTFXS+V180vq0tK9svzVugL6Vah6yuYZpUxneomjkxL7B0GTkgEC4Pwc65wVDAU3uDie1m8kiu1T9U5YxIs+3pF+rT3wEIDUQ== 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=1/7xpkFjecFxdx3m9qJQntvVRDMPFAxUcDk1JCVKXFc=; b=ff0Tndu4hyg6LtWX/+UG6ocG3wjS61pvMSBBDow8rH6SKm3JLG+yUjpJS0H26jjyBZt9D7NJ3IibFRq1g2QsfPz5ROSch/8goZGxGjoyfDgLR94nx1RpgS/YDkDMnTpCC6AktLkdibuvGgMHqDczhinWG8bw12KUR5tB+YBLSX4= Authentication-Results: u256.net; dkim=none (message not signed) header.d=none;u256.net; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB4866.eurprd05.prod.outlook.com (2603:10a6:208:c0::32) by AM0PR05MB6307.eurprd05.prod.outlook.com (2603:10a6:208:145::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21; Sun, 21 Jun 2020 19:12:29 +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.3109.026; Sun, 21 Jun 2020 19:12:29 +0000 From: Parav Pandit To: grive@u256.net, ferruh.yigit@intel.com, thomas@monjalon.net, dev@dpdk.org Cc: orika@mellanox.com, matan@mellanox.com, Parav Pandit Date: Sun, 21 Jun 2020 19:12:00 +0000 Message-Id: <20200621191200.28120-7-parav@mellanox.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200621191200.28120-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200621191200.28120-1-parav@mellanox.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: DM6PR02CA0105.namprd02.prod.outlook.com (2603:10b6:5:1f4::46) 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 DM6PR02CA0105.namprd02.prod.outlook.com (2603:10b6:5:1f4::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Sun, 21 Jun 2020 19:12:27 +0000 X-Mailer: git-send-email 2.25.4 X-Originating-IP: [208.176.44.194] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 060e2f48-f8e2-4edc-1366-08d816170a2e X-MS-TrafficTypeDiagnostic: AM0PR05MB6307: 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:6790; X-Forefront-PRVS: 04410E544A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Phn3fPNkgVo2N6gRbmai6KlqbuTuPr8xIrhXi9xXDtgKSOd6N4C24C2ZHD9hyTtTblR2HoYvUAkrrk8MzXX39mcAakvaTYcz56boEZCNnETxDjij8Pz0vO5OusbXVcRGDTO5WaTlS3scNfWBsLM0fe2i+Fiorz45ymxpgYuT3afWY8geqUvaRHdxq+f3fhC8K9yU0oHYEEemorE7eCj+dzyFa4ekCVsjDEjvkcIpLFwUdjx6Uvg8nL0CWln5+fear+yJmcY9jQVi50NsKcBa+8k4DkZLi4xVVRqzwgQrBFGNi1efXzRNBzQrJKLox2j0 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)(376002)(366004)(39860400002)(396003)(346002)(136003)(36756003)(66556008)(66476007)(6506007)(4326008)(5660300002)(6486002)(66946007)(26005)(186003)(107886003)(16526019)(316002)(86362001)(6512007)(1076003)(478600001)(2616005)(6666004)(8676002)(83380400001)(956004)(52116002)(2906002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: PAtmlH061cX/7s+ERLYpSZEkmNG1ImViJV1W2r692sNz63Pd2eje8leVcd14LbCUu2llA6dxrU1de/AFJi4DtZaOZLlNKDkLJrxa1sBDByMUOB7gLwnujf9rk+uXZvotd9MFhAGQAAJzeEF2WS4ehGStZCYrpc2P4wIEAY2wTu1FUFNqb/0n4ZZt+dEU8J7N8rIRLT9P7/K+IG4es+DGW079VwHGNh3BkbuyN467ALGpTUtFZ4Jt+Gec9IaKdClVk1HEPKSKXmt7iX+S2UWDaQvavzIjHILvhMutD608i9EzUUR765bQih7h8CyH95tVzF4xSuaUQLR7g7mFpkmqOPXYwDOfMLFiEriIzCKpWPS1+k0O5OcUekM5CjBoXlwhcYy3k0Genc4DWtibkpba10InuH6yVoNlt2EUXzqPIUWNLaHQG5zHJZkM5USpLLUZjHs6RbpnzSEMJViePTGIxLLGegQCCOfCRUXQmVoIE/Ii/N2WiOmMdbitaUKBZOlU X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 060e2f48-f8e2-4edc-1366-08d816170a2e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2020 19:12:28.9692 (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: ysBOq6n2dVnv31zxdGZk/qzy9lhDC6lQRX7ZGCCI6uA/jHOaAKrswpTP6DHxki7qbQxlJlvfsotI32O8pOWsyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6307 Subject: [dpdk-dev] [PATCH v2 6/6] 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 --- Changelog: 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/vdpa/mlx5/mlx5_vdpa.c | 5 --- 5 files changed, 51 deletions(-) diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c index db94d4aa8..ae7a0d6d6 100644 --- a/drivers/common/mlx5/mlx5_common.c +++ b/drivers/common/mlx5/mlx5_common.c @@ -19,43 +19,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 6cc961e99..fee988379 100644 --- a/drivers/common/mlx5/mlx5_common.h +++ b/drivers/common/mlx5/mlx5_common.h @@ -208,8 +208,6 @@ enum mlx5_class { MLX5_CLASS_VDPA = RTE_BIT(1), }; -__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 68f120712..236a7ef7b 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 60f42c5d1..944c3bf66 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -1381,11 +1381,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/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c index b223da7f2..30758f7b6 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c @@ -451,11 +451,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.25.4