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 3B44EA0527; Fri, 24 Jul 2020 16:41:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B9BE91C0D7; Fri, 24 Jul 2020 16:39:53 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80045.outbound.protection.outlook.com [40.107.8.45]) by dpdk.org (Postfix) with ESMTP id D26BA1C10A for ; Fri, 24 Jul 2020 16:39:45 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uwmc7hDNOXsF9HVNoEoABg93sLoRqcvdIDs4QQJhqPVyZR9is01kskJuOJry+be5iO+wAWViJ+AXUJsynVCIEyOZj1ABXjkXi/bDrR0wy+raEr0LD5CV/MjvygoqpYzLq3/JdSObhNL7DRwGX6R3xnUQv86mMpAB1YYv8I2jCfFqgveBKBYrwfKL8PLRhaZ/ftlVbSmbUuor15LMtTnsyb9mUlFsO+nzQVfMtYcuLBMJKu7v34GyMS5KIzwxZE8VPyn/ZW3lcxRKPQowecd3TKTSdqflTTKC4esNLNjgAZ24nWpt2OAWgaKm/IxVB9Xoja3MozNaxfld53ndV1gODg== 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=7RRTCf2cFt1yYGpc94tcUcshT/4Ysfkpd/B2GqYUzMc=; b=WNwfcu0erBu87lDJTyCJvX1Gev1BC/dzo0IQBAvo1Z51w6Iu89zOHiDkq9guzgNlEYp9BnEPJdRu8S75diosHeIJuN5uXyZ0ucuao+fARIyi7VyGwiAs9hczXfxflg6qyW0q1KkgRJWz1Q9SMxdptB4yHVhbkOMQiB68jU8EfeEnwbIjBOzlLPfx3uuQ7AztiCvQIcQNgtqnRAKgJo7fSkoKuvN6/Z/CEgum9DUL64oZajWTVsKcIiAcEQM4W4b+0fpxqhKepsLEVCZrkyz8OOXMOEu1OGkC+xnZWw18xjBZ/obT2bbQiXvDvx3IcduecSmSOE9XvhseVoSh60SajQ== 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=7RRTCf2cFt1yYGpc94tcUcshT/4Ysfkpd/B2GqYUzMc=; b=DcS+BF3Ao4EUKLVg3XYvjvm7ewkzCvfGSH3XdIo+XpMmv520MeJ024QVJhk2ZC5H/0RJvvZUvAAUNtNGqN2PjzILAHyFMLCv9wHHYc797qocdIjYvtGLWVdLUEhFsFiiCc2lxhCdAHd9VPQJIVjIaZnrF6IsiZUd5X1VqIEtRHg= 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 AM0PR05MB4962.eurprd05.prod.outlook.com (2603:10a6:208:c3::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.17; Fri, 24 Jul 2020 14:39:44 +0000 Received: from AM0PR05MB4866.eurprd05.prod.outlook.com ([fe80::eccf:72b3:bacb:f09d]) by AM0PR05MB4866.eurprd05.prod.outlook.com ([fe80::eccf:72b3:bacb:f09d%5]) with mapi id 15.20.3216.024; Fri, 24 Jul 2020 14:39:44 +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, 24 Jul 2020 17:39:06 +0300 Message-Id: <20200724143906.7453-11-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200724143906.7453-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200724143906.7453-1-parav@mellanox.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SA9PR10CA0025.namprd10.prod.outlook.com (2603:10b6:806:a7::30) 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 SA9PR10CA0025.namprd10.prod.outlook.com (2603:10b6:806:a7::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Fri, 24 Jul 2020 14:39:42 +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: 79cdcc03-1e91-4132-ef3f-08d82fdf67bd X-MS-TrafficTypeDiagnostic: AM0PR05MB4962: 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:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ebykJy6BYS4ZBAD2lnHdmb1bFk4onn6PNgvTXKfkXO90YwoX8bkdnCzvnjTctNnrugwOrXSv1YhFr9ZhTzZ65R5uqC615CdUveSBh1l85tHwLodAowBf6wlfa5TkrWODs4eLu2QPT05bgMC82qwtGXEPqMV2lLEFUFjgoTRfw4GerOD/XFymAhXGyrGo4SlRUhpbSSRmIlGXdqZqabrQpPtVlTJ1TPlHFX4m8L4hojbwvCQU7F/bQxfwc5QCQogemNmoyQUexxLbAdf5rCi7OqAK5oeU8T9zL5p8USypRs2PB+oOMUsIslgzh0ccgUTD 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)(396003)(39860400002)(346002)(136003)(376002)(366004)(8936002)(36756003)(1076003)(4326008)(26005)(52116002)(2616005)(956004)(316002)(6506007)(478600001)(16526019)(66946007)(86362001)(6512007)(83380400001)(8676002)(66476007)(66556008)(186003)(6486002)(5660300002)(107886003)(2906002)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 0eXTEYtMrmb9bQRub3+E2/y73VhRzRd7zxncuqIYi5nYb2eOlZWZovfYv35KJ5RsBpU3GHyQZCObo0Ft8YkKs8GOCWbT4wD0KcMuUhK+yfog2RVN9UCKYOA/Z48NCNFDDaRL425zZ96n6tldBos0ihsMqKnuKh3XyCDfbgzIKBgopIzpvDDmiMoXlQh/A8f5SJsrBgeeFAAI/7BT0OBRbJjZRSjvTCawDHsNV/EvFd3olGXOswYWvyeM/BY+ueYbyhFQnd8tXHO5Kr4+AI8zvrB0DF65y0M8HaNFkI2IUNVCT9kEokmtpuyKT71GFRfHkCFpfVjZMgnQoPvtX6PGuwigt/ubQnvE2bBbbulucJ1dhjMzVGRtZ31K56IoVIlwpVlrqtu/KuxjYpSSqGG0DCFXlKSfab0++SzcP3K2z820iRw5rm4pUel398o3i1Ow27EK9+jk/bBjvoIJogRFfWdH5dQAJ8Du9YQfZ9OvvJQLeSceNoBaGoVWd/661x7C X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79cdcc03-1e91-4132-ef3f-08d82fdf67bd X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB4866.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2020 14:39:44.0636 (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: GfGW+eb4uspOL3lI/BGWpG5jZ+Iz8Y3hL7PMtaTMPydM96rBU/gqddVkwDo3/+6oAKyBT/9zcPUq8XpUqRmFHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4962 Subject: [dpdk-dev] [PATCH v10 10/10] common/mlx5: remove class check from class drivers 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 PMD checks 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 --- drivers/common/mlx5/mlx5_common.c | 37 ------------------- drivers/common/mlx5/mlx5_common.h | 2 - .../common/mlx5/rte_common_mlx5_version.map | 3 +- drivers/net/mlx5/linux/mlx5_os.c | 5 --- drivers/vdpa/mlx5/mlx5_vdpa.c | 5 --- 5 files changed, 1 insertion(+), 51 deletions(-) diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c index fd818ef24..06f0a6400 100644 --- a/drivers/common/mlx5/mlx5_common.c +++ b/drivers/common/mlx5/mlx5_common.c @@ -20,43 +20,6 @@ int mlx5_common_logtype; 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 864e82ff0..2cdb226f3 100644 --- a/drivers/common/mlx5/mlx5_common.h +++ b/drivers/common/mlx5/mlx5_common.h @@ -247,8 +247,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 73cf72548..7729d0dd0 100644 --- a/drivers/common/mlx5/rte_common_mlx5_version.map +++ b/drivers/common/mlx5/rte_common_mlx5_version.map @@ -1,9 +1,8 @@ INTERNAL { global: - mlx5_class_get; - mlx5_common_init; + 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 97d7b0e7b..fc339affa 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -1524,11 +1524,6 @@ mlx5_os_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, unsigned int dev_config_vf; 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 ffe2f00ac..c0b87bcc0 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