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 4866AA0526; Fri, 24 Jul 2020 16:26:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 52D2F1C11B; Fri, 24 Jul 2020 16:24:52 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20047.outbound.protection.outlook.com [40.107.2.47]) by dpdk.org (Postfix) with ESMTP id 6AF181C0C9 for ; Fri, 24 Jul 2020 16:24:45 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VKXRKdnstchdR05XHPiV3G6h7W2Ka/vNWRbT1d1tNJdttnrRJudfy+qED5UMFR0jvDeF8xv8ulwb/Gjn8szOxiDgw+kM6p3Ev/NRvCiYyJQiqFKRne/UWQp/KOzM6f8tXViRJFT1DDIgiAM2KWicmTALKe9Nygf5vF2u7ZNFoUA7rPpzcZq1NqIxak1KdGy0jYdJuB1OTsWis0h82qH6GL2+9gwglFPSeQxSzvxpYFV0zaJlXr2u1CEMGixVXiTUHYVgA8qAu69pV75wWZwb/75BHmRlknXAwRLPcTKoBQSbj+zt6rT7CCWRHhZ9W6blgTs9+NS6YV/jLSaR6T+PFA== 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=XImurOh0ANzC6NtyZi9t4ePu+rTRS6KKYgCYxX1gFiZRfPILmrdfBd0ujsFe6wzr9D/dcfJaIbKdjAoq9sm6pwFucEJtKxd+AZY+6G/4Zivf4CJ7G+nxyG4HWIt9mAQyjY+pw5Uavbonwa44siOuM1deM+uJTDcIum2Ygt+qBKhFCxGwbO3z8a9x2Vx8UaxA+BfwTJrNUJLJ6f7K30FC09eGeSU2gwjVumJOFp27FvkJxtRtl3gy9atS5cXsOM2Jaf0w0wuL5kqjj07sN+Kyge53DgfLAycPJvwtEUwK8eccmucIz8Mz9keMtgjTt5nLJX3Tu9b8r4DINZ8pDeSBvw== 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=rOKlgaHmXejZQELI8Qhm2FKeIvE57EOUGmH+xJfkCYEhchOXnmoicbuwC2ZixeSdHD6s7dA83ur0X9Eguyv5RSdRvzpuP+cs+ZnKBA4n5bL2ooIfx+1Q4+GQhS3gziSG2hd93ldMnUJnYeZ6vzMFn+bHqSFHURqkACjxddksets= 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 AM4PR05MB3203.eurprd05.prod.outlook.com (2603:10a6:205:6::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.20; Fri, 24 Jul 2020 14:24: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:24: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:24:03 +0300 Message-Id: <20200724142403.6132-11-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200724142403.6132-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200724142403.6132-1-parav@mellanox.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: DM6PR02CA0136.namprd02.prod.outlook.com (2603:10b6:5:1b4::38) 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 DM6PR02CA0136.namprd02.prod.outlook.com (2603:10b6:5:1b4::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.21 via Frontend Transport; Fri, 24 Jul 2020 14:24: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: 1a3345dc-f542-4d03-b4b9-08d82fdd4f5d X-MS-TrafficTypeDiagnostic: AM4PR05MB3203: 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: 7nZkTHWNnTtOUMya9zmdrb9eNLlisocrjfM7nKmByNivkWk6hTCnIR5i2BjYnmxquMZUQzJTBAHYLGL5g41Rxf8uOCDBvq3oC/HTyLExg7zGz7i3v3ZbEWglcZcMfrKQuTNiDZ2uyclAlWgWd1D09yd80Uk8Acun5mzwCPMawVWy2RhTNhtdQeFD2gzLvxKGCWPGpbvXGoj2LFrvTbRWnOeyGdB+il66Wp735BwN1honPu+ALOhKFLdwhjc/4m+IMV5FDc3g1IwqnV/Rb4DTN/zVCdvkTQ+jnnW/BMsr91MRZPk7innFGwf7JI50pE7w 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)(346002)(136003)(366004)(396003)(39860400002)(5660300002)(86362001)(2616005)(956004)(6512007)(2906002)(66946007)(66476007)(66556008)(316002)(6506007)(4326008)(16526019)(186003)(26005)(107886003)(8936002)(478600001)(8676002)(6666004)(52116002)(6486002)(83380400001)(1076003)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: jggOVlWyhu2eQ072iz/CC/mfLn+qB2Qmsqp0RVqMu4XXeu30PW956SJmm0/ehQbh/XAksah3RKsQwmZUpy4krQn/kzhB/v+jqhlv1c4zf0iFynN1cu8vBQ1d0ghEOvYO3lhDg/xGPCUNpUcyDk0OtD9QQ2/582GZn12lJbP/STFSUfJHykb4/380BETCQ7KeTrnTfxig9PX1We/DKI7gEkS6JEgFH6xSmjrbupIm696FAy5IKddXiqROiNy8EqOC3M0gJGq9BiU8+S1XEWzLh4tuOkI/kB1ppoP9SS0uBljNnj7Y1ZZmp4E0q9nPoLQbnnZtSOb0d5eex8hd7v54VDDpo1sT92GSD6NVonYoSmO/omLAjUKq8QP/Aj0d6SZRfRctM9EUioX1MbMrn1mv3URIOAUcBOierJc5kqoc5Cj+Xi/PdOQQXes2E957BMU7Vj+tJKwq2XB3o7bwi5ZdgZZIWIO8uOx4XQQwhQLXY1+D6ijBBRSksb/kx2bVGdy7 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a3345dc-f542-4d03-b4b9-08d82fdd4f5d 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:24:44.0203 (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: Xnojy5b+O9Iu6mRlt+tEMKv1/rNcMcSTt2KH3QPvAyDiSlkYjsphnB44p0xMe7BU22mvKkKKlgKQx1iwkD+pdw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3203 Subject: [dpdk-dev] [PATCH v9 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