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 31894A0526; Thu, 9 Jul 2020 09:37:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BBF451DC58; Thu, 9 Jul 2020 09:36:13 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40049.outbound.protection.outlook.com [40.107.4.49]) by dpdk.org (Postfix) with ESMTP id C41141DD8D for ; Thu, 9 Jul 2020 09:36:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OYZ8Df+A9ktGZobZE1aJohNGW3gZ4pF2RV0SoWIOgQvYz/TDDuuLqbT3At/0kyoGlaVuQ2kNeczw6lvwGvb0Pv2Ed9td/rqbfUrEg/Gviz38fVL4JqcAT0vpvzqZk1YexfOXhWXYheFbjMTP7IsWGyx/FWSll5Z3pOLjWL1QGURb5XOEst3ld9zpG9bbbquiRkL8vqAv/HrcOIcTYVPOKFpLnrgEdtcdrtLGupIVlJ+a/nGR0LcyAUb2jlUu6knKl46K+2itaFtLCDUaA03iYBKhsvaQXU+eMhLBdL68JFU6SPym4njfGZQ20sU1WeJmxygzBV4ngQOkOv2tVBDVcw== 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=0W3vsmYBjYtXT7CrN/ZZCEsBij3evIC3AqBB19HqAl4=; b=EVtzekL4z1ozKUxOM+NGQ8vNSK1Sd3lPQYYqmzYeMGIRdJeAamIUwE2tjnEjQEXCSVq9kJKzXPFoDR2JOe7CpURO/pXZcFyFzl6YVXthh8T0wOR7+J3gQ74+A1vXZND1QK3Aav2EIR/qmi9M/89Jx2FBBuio2wZ7RxraL6jAhM7oFJ6/CsGTtyb9r9HBEv6/IzeDrfTlyO9jgS2vdjIfBBAZ0x+YQquaDAS4tCq7q0iT01fT2jkk1+NpD1g0MuuNfXr/MWjuZlCe4eNmL5PbZ75NnUk0BZgBC1uISZw51aX10parP8Hi2vvEHR1tUla/EbwtEDPZm/QEAzC1AmFXwA== 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=0W3vsmYBjYtXT7CrN/ZZCEsBij3evIC3AqBB19HqAl4=; b=NOSk76LkxiT8Eg7HDipqqgXC6yIeqXOLn41brvHXCrxpXcUTANhpX+y7E6PY9sIqaS0Pzxumc6S2L31Ni0/zjO0DOk9yDehX/LPeG5KnFQJzh1b/h+jZYCzJxrAbr3sqAR0T3gQGY7rUp+To6KVMcAFgAdXDEJSv5pv4ed4X+bU= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from DB7PR05MB4876.eurprd05.prod.outlook.com (2603:10a6:10:1d::32) by DB7PR05MB5084.eurprd05.prod.outlook.com (2603:10a6:10:15::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.28; Thu, 9 Jul 2020 07:36:11 +0000 Received: from DB7PR05MB4876.eurprd05.prod.outlook.com ([fe80::8cb3:93cb:c3ef:4293]) by DB7PR05MB4876.eurprd05.prod.outlook.com ([fe80::8cb3:93cb:c3ef:4293%5]) with mapi id 15.20.3174.022; Thu, 9 Jul 2020 07:36:11 +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, 9 Jul 2020 10:34:52 +0300 Message-Id: <20200709073452.948894-10-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200709073452.948894-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200709073452.948894-1-parav@mellanox.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SN4PR0501CA0104.namprd05.prod.outlook.com (2603:10b6:803:42::21) To DB7PR05MB4876.eurprd05.prod.outlook.com (2603:10a6:10:1d::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sw-mtx-036.mtx.labs.mlnx (208.176.44.194) by SN4PR0501CA0104.namprd05.prod.outlook.com (2603:10b6:803:42::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.9 via Frontend Transport; Thu, 9 Jul 2020 07:36:09 +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: e413d1da-43f0-4995-7c8e-08d823dac05f X-MS-TrafficTypeDiagnostic: DB7PR05MB5084: 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:773; X-Forefront-PRVS: 04599F3534 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3s2GJVawN2j1tB5XshX0Q2Jf4BqpXlEjE9Pz0vwvhr4H99ZPS2AxMsJmBNs6Vu9MZdXA65eZvw4mkA9o8b2aniSWK8+2uU6UAMVw3cZqwWJU8nP2pbg3PnFuo5rmNfjGkjDxiGaG6o4lSJph79bugxD7hqCEE5RFxLQD5IspqnCIhgoVRCIya7y8et/NG47MOutiVwFgYevL++fI+58is49G8/CpWKOA2aB14QnlQqDmC0Gaa1I5SvoJVSMUk3u7DA0EM0rRdoZtd+LUy7EdtxGTx/jSoj1Eg8bnDv2OqYu1tsP/PLgAbTUD8PspKVNW X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR05MB4876.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(366004)(136003)(39860400002)(346002)(376002)(2906002)(16526019)(186003)(26005)(6506007)(6512007)(52116002)(107886003)(5660300002)(1076003)(6666004)(4326008)(316002)(83380400001)(36756003)(478600001)(86362001)(6486002)(66556008)(66476007)(956004)(2616005)(8936002)(8676002)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: pnkgRDvlEhUZNZk+Us+RrIirTY5pbVXet4HcGmk6wvv5Y/eKt8PiwQ9YnI/Bm1u7gc56H4lBpacm9TEBQBDoE0Ygop/1IR2g1449iHecjtr1QUy7Nw0TQZFzhGYR+ihMsLwhX163V3K8RZpHnfe+XSWKIqyTp5BssGC5qjMxud+W7mEUD5m3X3SkAezgfpAbFTSzE0gRCPjzNqFJms7nm2KNhFyh0eqeen0tMKg0svXcSyro5WBPwV6U/parT5cZ5gZRIkKsVtvdReBmzglCY2AlWr4tbs4MSfGPWFfeZkiG9drUun0MIFqCzrV4tUBW5IZBbMRv6akbDG9BcBPxPuOlMCVU3Vtg//njL6uOzGkaJgMNlTqyAU1PV/Mujp44Gs3SuQ3rYtlmXGfeOULomwb9pIeYYr8aOakPlLpYcoV8ZiMPkfzh0aDpvuLrodxRI9u35Nqqe5j4MUEri+JOSt3yFBjBXLBrvdKHiEuesNgwZDHAJv/XJEo8DJNeDs3A X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: e413d1da-43f0-4995-7c8e-08d823dac05f X-MS-Exchange-CrossTenant-AuthSource: DB7PR05MB4876.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2020 07:36:11.8246 (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: caI7XvKRHGnrv+IVDKetoyeRTr4ELJ4C504uXp/offsirJ2C6wZAQ5zWbuz7KSAKUpEYZTX39pplX0APJZywQw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5084 Subject: [dpdk-dev] [PATCH v5 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 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 00ccba622..0effaab1d 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