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 6DBF5A0546; Thu, 16 Jul 2020 09:31:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 921811BF8D; Thu, 16 Jul 2020 09:30:22 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130089.outbound.protection.outlook.com [40.107.13.89]) by dpdk.org (Postfix) with ESMTP id D06F91BF7B for ; Thu, 16 Jul 2020 09:30:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dR2eBz6l39oV2EHqHAyZzJJKWGhyDnRVHnzhLxatqHR13OFoE662NQEBSUt+EwfvCoxV5hqPI1geodgBzGXHvClX0MkHljk/44BeBd8kjxZdI0UOT/zhJVvrlHMUUP2kQbqbdnEIKfWce3u0lWLOuUPDSl2ldqHzUzf9o6Sf7e9sGOrj2xtEkS5Ww0kKGnZWwRciP+o/L/ma8h90sPiurGebZ+qQVEMdyKXGZ+may7I0H25YTrh2sOFFrSl1L/IdHsYLEDkOGV48vaVsKI/foZ66I7kZjRsNw65iyjXZFhh43j7m6BZw7juJGeLhIdX/sZRFBBM1umo9BKOhRVqlXQ== 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=c0HuwnzH5oPstVrvt/ZG+Cd8j9nCuSxdRSAbdcoMtc8=; b=GeSQAeGs3FRBVUk7f6ebuWx4jUpuze3A42hq+JQfdyAnNxnRESAH6q0awplZImRCmPtZNNtWSZicHdEGP7Uh4AbxiyS1PFRFRCBDYfrEsk/4dNlrhMN5DlneGYihBZEX4/COQAbrHhPHNVz9BvgljhiiHeiSVp2F6fIUOXxbxuj1w8xmu4V/2QoB8ccSvp4m6jeTSuTcb5z7Hb+uiiBU/G/5MywOyasDs//93kPPmfnW1t5UFWkE/QaXLLlntRVBetjrwik0qSdTCe87WR3HEKauMo6PbsQx6bPuUZiM8XTSU2CrqVgXZ6G8nKNBd/65OkOcBKVObYFeY/GEZfnMZg== 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=c0HuwnzH5oPstVrvt/ZG+Cd8j9nCuSxdRSAbdcoMtc8=; b=PbjJS+uHYuTRBnzlQWBgP1bnDgjbFJ1ve+xFuqeUtH2wpwoZwqnRMsdsl5KvDXNGMIy2WodDD5Dg4oTtfKMFLbjeRSpfl/QDrjE/37AK15L/6HORniiix+bpqEsJYGv4Hjxh1NoUE7yDZhZENuluHqPqVP87ZIQ3qR/qj8zjLb8= 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 AM0PR05MB5329.eurprd05.prod.outlook.com (2603:10a6:208:ed::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.23; Thu, 16 Jul 2020 07:30:17 +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; Thu, 16 Jul 2020 07:30:17 +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: Thu, 16 Jul 2020 10:29:38 +0300 Message-Id: <20200716072938.812733-10-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200716072938.812733-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200716072938.812733-1-parav@mellanox.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SN6PR16CA0057.namprd16.prod.outlook.com (2603:10b6:805:ca::34) 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 SN6PR16CA0057.namprd16.prod.outlook.com (2603:10b6:805:ca::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.18 via Frontend Transport; Thu, 16 Jul 2020 07:30:16 +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: ac7f92b2-c3fa-437a-24e8-08d8295a169c X-MS-TrafficTypeDiagnostic: AM0PR05MB5329: 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: Qt/QlBUYgz4xtqixpmS7zSdljqHFLK8jrtvDhMojKJrQJ6IOd9S333wSAKxWVfU0/FLyDXe13kcXoPwkedhotkNq6wzYSjceq09PfCvhyE3ngJ3DQLF9bj5f0oNm8gaegWzHpHtqMo7xS4q9sjrS0BM5GKNWiiezHiDAv4flKc8z5oPrrcu5972fmwaJdV4+YzNbhKJE5bMe71r0EwKzs7fJuCL/Lju/q++vhRiPlcFR7tnL4ulVxCnSBULCWiVs7yezIX9KJqXnpOrFZYNYQFCMUQqH6oxHUxw1TBk6lwU9kZfOjs0OMb8hG9AA1wN0 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)(346002)(136003)(396003)(39860400002)(6506007)(6666004)(16526019)(186003)(66946007)(107886003)(66556008)(26005)(8936002)(86362001)(6512007)(6486002)(52116002)(83380400001)(66476007)(5660300002)(2616005)(956004)(36756003)(8676002)(478600001)(316002)(1076003)(2906002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 5TcKAfHceTDHkIFf/zlFgCToyovag7fR1JQiBi4GaI/KAOQ38WtvK7ErlNQwnCOeK7VTVBFQ5kbnASGr8g2aOnbKCgr2WbL7aJDqCK9mbIpOj4FeZiA2DngbmHRqeywP9+rYPk9tnC5Ff1TSTw5MAHlKUshUud5nzE1RuCsaRLXRqb13KcEtrFxLt32hauUmgOxGS2XhxICvm1q7tPQ88dbUGxtmIN/1Q00CNzjyEiznsysHp+vHVHWXhh9Q6PkcnHcaZzPg/2W9Iy/sqB48Tfh6vnsLwTW0HKzKffOb9O/4O5+0r+T8Zo8n4IInhZ0quRdct9SrdOnt2zwyBov/oAtDlrk07jfvGOqGU2UvvP82Mb7wutpvlIH8pshT6lM5euzHDMFn0bij8gvex7MU9hwYz9m3Bydv5/wP1X5KOERTMcxdHxrepzirHrJc6ZM0aeqNHkhdkcSOk3HteeZe0iJf42nSV+H8UIdq28XK5OfyjxD7YTpCPGACytWPTp4g X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac7f92b2-c3fa-437a-24e8-08d8295a169c X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB4866.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2020 07:30:17.8221 (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: ohSwLC90vFflrdi+WZBQwRn3szqB6MChnNqM2cLDHFLUA+/73l7jS4qoFDu+scjZ7veD4jby0Tiq3OtROoBl+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5329 Subject: [dpdk-dev] [PATCH v6 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 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 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