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 57931A053B; Fri, 17 Jul 2020 15:51:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B8C161C1EE; Fri, 17 Jul 2020 15:50:08 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2069.outbound.protection.outlook.com [40.107.21.69]) by dpdk.org (Postfix) with ESMTP id 36E201C1DB for ; Fri, 17 Jul 2020 15:50:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VesEry52UBcj+eRNncJ1+uqjHkNlqm4f521RwXPcul7LSD2Em3W8FWein6HJDx9+PsVnLQ6FGnWv11/afaRBkDkO7/ll4Y0etvtyTpWjwsCZY4/SgUkf9k7KSNzBeo8wM7KMz8vSrJERfSbn2xVbu+wqJHJnvsHDk/EGpRGMUJZcnBn6EbvXAHJ7QWvSpzxvxi0+35cWhWjVNtGeVzxUhBzbxAL3qUrQl8cIJu2FyJXfNcwp1s+7hDbAO8wsgA1MeGZRsEjN5qSM1OztZyTVhSUDfP1PsMTZCWGhl/umg38zAWyJBMFfIZuJqMU+Jl/FDkvK5jUgMNImHrAwjeqLpg== 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=LyV76SZgw6N4S+EKAwSv/IVVbLgxIU2ZwiendAzRGII=; b=OOj5j2YVkalh8HqZz9H2JST31S8pNFH+pP3GsJ6i7SNISJdgiKyddLpYDXj0BMrrCbsU0h+srKedm7aCJcdQ1iYLq0i6iBBkCfMzEWql4bR0x93pXiOxvUWZ3v9b1qJwCFESQSo2u9H7PXSbb9ENW13KHPHnQgduzOXRvHEKx8huwxDeXBUz9rByG1xSW6mxrApv6ocgw9wgUfVtZHeLOQ4kRwmgmTncPWNIH7R75SgbNMxFOyJvVyN39JU7NP4Ee4uur2q3e2EA4LKdgihZCuEw4UsfHLUrJC5XW/g2SlWe50oc6MmTWkoHqagKsZmtwZmFafM275br+kDr7bO3Ow== 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=LyV76SZgw6N4S+EKAwSv/IVVbLgxIU2ZwiendAzRGII=; b=hE9+jUQFGn/NQUjElBMqMQJZFBW3OpBIxNlnbg5+/5BBJQ3a7tfo7616jgXigU7HV45gJ/URFqdpO5JHk1G3Vm/vFKsLhpwNMqo9QGCM1nupWIWlRVz0+G1j9jq0iOHo0qYo3jU4yQkZ/FsTEl1qgokKzS3fFJ7Y5v240WBjpdk= 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 AM0PR05MB4355.eurprd05.prod.outlook.com (2603:10a6:208:59::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Fri, 17 Jul 2020 13:50:05 +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.3174.026; Fri, 17 Jul 2020 13:50:05 +0000 From: Parav Pandit To: dev@dpdk.org, grive@u256.net, ferruh.yigit@intel.com, thomas@monjalon.net Cc: rasland@mellanox.com, orika@mellanox.com, matan@mellanox.com, joyce.kong@arm.com, Parav Pandit Date: Fri, 17 Jul 2020 16:49:24 +0300 Message-Id: <20200717134924.922390-10-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200717134924.922390-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200717134924.922390-1-parav@mellanox.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: DM3PR03CA0013.namprd03.prod.outlook.com (2603:10b6:0:50::23) 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 DM3PR03CA0013.namprd03.prod.outlook.com (2603:10b6:0:50::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.19 via Frontend Transport; Fri, 17 Jul 2020 13:50:03 +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: 13dac96e-f494-4e64-4f37-08d82a584f58 X-MS-TrafficTypeDiagnostic: AM0PR05MB4355: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:901; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ieNuwqIHFOx5f2YpUgyx+CXRWSLTaNoznDsoWG6G9ICU8aolwmTkbJSUo0aShpLUx05+AfV0jMgbkIbts1OfYewe9w1bD7tWOSGUmFVsTZaWfV52bdChwA1d9sBBxD4yF/7++jJyCFQ1eAF6ri7hT1MDKQN6GjvZ5WXekLhVElXYr+cVFAOWBDxS7GsGTX6Nc9U8vZ+A72rT59x092RsBOssWfOPiaUwe1yZp0OoYOQKtt0+CFkdSlTgmKbVRLa0bvdUmLiYBr9wmCn7zbfPMrjcNDKTs9S/897NocVcuzVkDZ26NwdqXuAjMhJdlOfQ 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)(136003)(346002)(396003)(39860400002)(376002)(366004)(8936002)(6666004)(83380400001)(2616005)(107886003)(956004)(86362001)(478600001)(4326008)(16526019)(186003)(26005)(6512007)(52116002)(1076003)(6506007)(66476007)(66946007)(5660300002)(2906002)(8676002)(66556008)(316002)(36756003)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 6hrP4n3e5hNoX0lBmMFGxTWb0IedlF6eL3WsC+McxuAyLomEZMDZuYPa0fcTYnzC0HT5mNGaJfDc9SoZb/SOUI7fx92xDB0qNtfdHXge3YXYOIAs4gpsv4YSWpC3iNGnrYBLbWXlarmQBCVnnq4rYE0dt5NXZHMpu92Xe/sHNWeIdZsl1TovmE5nL0uWUR4OUOI4xqjhG5MpIia2LP++LfOMPjXO61iVbE0IXHwtMZ39moqIjaaBP9IPy3ecWjC54XHsJahNVk9oFoYKO7rbJaukjbicoep4ZVn39sQQiD9SYxF1yoUffbDlysN0bBdaVrVmQKPjoVy8vqkMUQwc/K67N1oljcX1kBgiesx2jPneVSYliIYwBwExdiljn7DUAEdn3dZDPLQ2fGZCR2zV5CBlfHut21aMbPxEiRoTxnULuU/LMX6SOO4jLH0kuDlU4VexpXkOJNz8OLFzjKWo8kSLXkz/s5Tdy3W1PXs4vuvyO4DZX0QIFhvhThKIIUIp X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13dac96e-f494-4e64-4f37-08d82a584f58 X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB4866.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2020 13:50:05.1850 (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: s+YClTgF32A/oYANKlPMhZEO3kAxagqgyt7coIGlmGNY9Y68GC0woiqnB5DJJoDwMEsqtvs8mWO7Gbett98oyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4355 Subject: [dpdk-dev] [PATCH v7 9/9] 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 does not 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 00e68edbb..5b9b7bd5a 100644 --- a/drivers/common/mlx5/mlx5_common.h +++ b/drivers/common/mlx5/mlx5_common.h @@ -244,8 +244,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 5aad2199a..ce91576b3 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 3450a961d..0b3e1b674 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -1386,11 +1386,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 5d247e0a1..70692ea1d 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