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 A8BD1A053E; Mon, 27 Jul 2020 19:49:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D6471C11F; Mon, 27 Jul 2020 19:48:10 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140049.outbound.protection.outlook.com [40.107.14.49]) by dpdk.org (Postfix) with ESMTP id 338A91C10F for ; Mon, 27 Jul 2020 19:48:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b6MFyhCpy3QG+aN1QMEfPQKQBv5FyJaXZy+RzUrbXKtts+TIlf4UAFsNJpcTAw7mzzhRIupTK8SC50XFfFrhy3QaqtgQQJmr3PyiNKJsjF/CrpyuEM7UjknAYY7koh7HLzXGTflAan8uxxshN+EZj5aoPyMCHRrZMRhwcI0S+m2v6L7kccfFeXc9igfadcWaUeh5GxX2RgJ9JrVVrYXWzOW6LH6IafNi9LO9ZSM5Ef/75e4bfRNZjb7OQeyyN2ByMcbQQBlJTJUCvH6XTzvllpy69q7yRVPfIcCYOHKxwEQx0Hj3H/YuWK496+nA2KgzWfsGQls/cojC04yLRdSwyA== 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=VNR+mN2TF6kD8V2Dbt7AqQm55hwjBlE4EI1gjH1uG3Oguffqkla349vdQEcUylawzVmPvRO7El/N3z2Ylr2GFZpdovcKC/8sy7dqnIBoe3ed89ohlUwI8/sRstddMwPX9PfA/3n+r/CqJnzBvJtjjMga/YvWa3UG8JIOCy5WAcznEHGoG2kCDvqnD4JUikPwuk9rmiS0eVOpxvXMCnizEmQnIq0262pSBAqt2nyl46W3gTGUsnruhtXjU/a+JfmSG2EXmHWsVKBlfkgyeWHKgk3cnb8HY4MbdK658ekVCt2AryIJPuaEN8ch2zJm3cySG9YEFt5z1GPMgfl5QqSBNg== 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=fQpwlTPXdribak5bmdJqSHT9SgnqbpMbooh1556xL6i1WztpXw8mMgP/Laqn5eu3qnYEBPP3obODp+mAICqVcoSci3qrd9sxIQ0MTVJyuDppndeAdZIQFtSpmFNbZuioCJPXtCztLvfSsHZcfkjbUwkKQwFDsiDpJRzf2OiyKzw= 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 AM0PR05MB6227.eurprd05.prod.outlook.com (2603:10a6:208:10f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23; Mon, 27 Jul 2020 17:48:02 +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.033; Mon, 27 Jul 2020 17:48:02 +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: Mon, 27 Jul 2020 20:47:15 +0300 Message-Id: <20200727174715.330117-11-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200727174715.330117-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200727174715.330117-1-parav@mellanox.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: DM5PR15CA0049.namprd15.prod.outlook.com (2603:10b6:3:ae::11) 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 DM5PR15CA0049.namprd15.prod.outlook.com (2603:10b6:3:ae::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.20 via Frontend Transport; Mon, 27 Jul 2020 17:48:01 +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: 4c8768c2-db5d-42f0-de32-08d83255359a X-MS-TrafficTypeDiagnostic: AM0PR05MB6227: 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: 5ExHJP2le8IfO3nnhTkQ/PHz2eHQlhXZyUa5zyQ4b4CjpQyHqiQFquJIplAQzm/x99NKnrGkEq7c6h++fNmbCY9WR/YDZTXCeZk84ZqDOaN+kExFesApUMtZHyt97MvLO/9btlkOSCdaZhM3drAh4Gphh6sfcjV4TVAxkRmjOOpjyYLHN+s57R3tBnQlc30dSXUrLEHriz6n4hQnahyUPMY+TkBra93vgttjMhqlmObf7Xyd6D9avg+36JR7zpfg8u/Fib0OFf5aH+rxpOvsbwKx7ufK8k/7PWHzR2NDrGkjJeoJsP6CCyppDvN7nm01 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)(136003)(366004)(396003)(39860400002)(346002)(52116002)(6506007)(2906002)(316002)(6486002)(1076003)(5660300002)(8936002)(8676002)(478600001)(6666004)(6512007)(26005)(16526019)(186003)(66946007)(66556008)(66476007)(86362001)(2616005)(956004)(107886003)(4326008)(83380400001)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: jxyAm/qHVuvBKbqsu1ZU5ph6jAghqZlkn63O4Zot6IU8zsSOy6VdY+FD4xWlOS1iJZDQgbplCd1X31Quy9f83MfyBFvmcchE4OuzL+If/zWxtdE3p3Ck9Q76IwaTsRJAHa1HJY2GgDAJrzBoVPwHvxjqoi8EsOFvgjJ4KuIFoNNhwyrox5VxrCfxF9yoIYLVt8dX7QhwVP6k3pRKiuhb0KS+8npkQccvvPFghu1MqVQiQCVcRtAUIMNAAo1JlzOhN0B1ZDGrA5HTyX/Pp+p3dyew6z+TdOcc7fb7DXLGT/8ZPL3e8W+R4dpU5TmgY+5qhir29WUB6gpsrPlXj5KN8dz54Gz7+WkCsjzX4HZzzJ3eAu7EFv3ncLuAJf+9JJo7MDqeTYhfvXvO46zgWqhD54Q0tNZ9iTL6RZZSTTU1DVGMsbI5Qx0yTFIet2du5saKDRXDe3GDIp31ENY5p+LkEhcKM+q+YreC/kFYf8uZxWmWhm7Z6k20XrI/FPiMJk4K X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c8768c2-db5d-42f0-de32-08d83255359a X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB4866.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2020 17:48:02.7834 (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: pVuLT3mR8yTcSkWUUIEzcAPDFtLxIZwA9vWbg1lqunaRG2kwrjPlfFY5bFBzvQnyAvilPK5QO/rSrq9G0uDUqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6227 Subject: [dpdk-dev] [PATCH v12 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