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 7D355A0518; Thu, 23 Jul 2020 22:11:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A99E31C0D2; Thu, 23 Jul 2020 22:09:55 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80051.outbound.protection.outlook.com [40.107.8.51]) by dpdk.org (Postfix) with ESMTP id E883F1C0AE for ; Thu, 23 Jul 2020 22:09:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oGY8x7jViABvHJ4jGqGf6nAgXfrJ6xCHhEHhuV621m9u4ACA/N8GYXFCeMD6L6tVydOJ+Q8gXMZQlxiAe0bTK460flq0jxqX2l1rK4wX4CSjDgKw/q0LMni6090KjLR4fCdgjSY/KhjSbvJ/G+zIuwi85d8wB6pc5eVXB+Zs3OecPI1X35v1pBpPJthr4s/WCaQBAToR3k3Fj6JxcMGiLiOWr+KfHbMQt1gt0Taavcfn2Cn5zrVmfPSGXik1ADB7m6gTitNeOLG/qFFnQyXBopMmuwkLoUaGq4DmT7DRw3xMeTGaI0aLwFoUujIl016IIubpkZhSCLIi/FrE9aK0xw== 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=M8SXPw7eKOJbjLmDRs/d1C2C7IKFtlh10Bqvlh2eiQs=; b=DsURQQY5Wwx5JaF6FGPUYZaVoBMguut35rTRgCV7i1dOj4IlfT8Q2EkWDHqP76yv623yvF8PXFJ6iyDBMynYfw8K29zAWty6yX0Igs4RZlRth7Vx0CQAJKulyGqop3Fh86pbE/wW0nHtMRmeX6VjwSbVoYWgPta7X1BXcQLZt4TXU9AJDFi8VuPFCLSy2XrIa3JI/M5qwrrms9TfK962/Y4FGC6n67nlAYDJZfWCHEo9GmW0o/Fnf1sW+H7lzQ49hIuEdUvBTmMNNH1jwb8pmeoeqCXZg3P85dwmV7iu25rnH6mBeZDijkGKfrXlJex/HO7yf6RlQf0AomWjnqPDtw== 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=M8SXPw7eKOJbjLmDRs/d1C2C7IKFtlh10Bqvlh2eiQs=; b=Ho666SR2TD8XxH1ZgYmv/+9AO/J1ceDn0RrsvP9ktriHEGaDIQapKMhax0R0KhYv2II79McHLPZLPVCGlXt24rkFE1Bg87rc23tljq4nSex6tgCL+/lMr9DMiK333xkhStbxHGOvuOvrl9MOfTPtLCZWyQ4wEnZ5jjOF1LH6y3Q= 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 DB7PR05MB5558.eurprd05.prod.outlook.com (2603:10a6:10:5c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.20; Thu, 23 Jul 2020 20:09:48 +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.3216.022; Thu, 23 Jul 2020 20:09:48 +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, 23 Jul 2020 23:09:10 +0300 Message-Id: <20200723200910.376581-11-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200723200910.376581-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200723200910.376581-1-parav@mellanox.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: DM6PR03CA0009.namprd03.prod.outlook.com (2603:10b6:5:40::22) 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 DM6PR03CA0009.namprd03.prod.outlook.com (2603:10b6:5:40::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.21 via Frontend Transport; Thu, 23 Jul 2020 20:09:46 +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: 041afbd6-f5fd-4d03-774d-08d82f4459a5 X-MS-TrafficTypeDiagnostic: DB7PR05MB5558: 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: nMHGyv84Cg/d9C92hx+bkeWFNKAy52QB0YBgDx46wAcw9dZsvcahsoCy6Ml5Hu+PT0+6Q686yYmHzw5S83a4Qetq9dwRK5dBtf3mi6N5N2fFCHLqY7iUlaE7GmKJOaj44GEwee/XO4GDAX2TO7nN9LPNha2efpxjGOq2s96za3d7vEDA5ChCgYCkbJFj6vnR6gPSoL5nTjTGzKhRl1UZhsyEdt6V/9EJTBSy0DOSQ06/l/I69AZL44A+hwZLtJYbk7NKSOddHd7qKTgAWU3TACnkISuxZN8t7ug2hzBzd+j2gh0R0wmnzEmb7goePs8m 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)(376002)(346002)(366004)(396003)(136003)(39860400002)(6506007)(8676002)(8936002)(26005)(52116002)(2906002)(4326008)(478600001)(66946007)(66476007)(66556008)(83380400001)(36756003)(5660300002)(2616005)(6486002)(86362001)(956004)(1076003)(6512007)(6666004)(107886003)(186003)(16526019)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: xsWSrb1956SZnPSIBRvS3uRdEtwnjzyFNwqd7zoWMRyl2N1RXM5nqPBgqEfivUlZAQRQDp5pYZW9rdcJCWKA96j+dkM7hFWDMStl9AJ4EeWNs1uAnr773kN/U6XbxHd0motOUq+PTr68PMgSoHAnQnZSARck1fe0htphYT8N3U5f8MwugvOL/8cw3vh5OeX91XJU4B8+y23T5XOrzxXfapUm01J5tme0XcK5T8RlbD1exvP6S+UeKV2KxG/7UrfEzixK44o8beWu/iaIuI+d3geI9Gr7cp5q/356PhMsc+ZC/cptOUR1jujewP5+IHU/lp2+wB5SQ/Cg+KkgsRNtolL1jnb1EzCRwIQiCbYmajdMwSGl+tEXftubaT9/SOQs1Z0JxtOr8xBs11DBV88U8t6SE8HsGtt0amk8Bj9VCV8Abb5Gf5aJcWlhTf7b/p78BvtQIS39EXH+6SxFBthMvCd3JqnGH+07PNlqYNR0Ylg8sAQvkMQzR3DCkvDlt0Ld X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 041afbd6-f5fd-4d03-774d-08d82f4459a5 X-MS-Exchange-CrossTenant-AuthSource: DB7PR05MB4876.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2020 20:09:48.2382 (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: DkQ+6fEYEYQ0/t+IzlBKyFlM2UFarJ/4NDXfAtc3Em01rtj/DMiUgOXuv/cjpikGGvL5zGO+1bcXO3UZ6rF0kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5558 Subject: [dpdk-dev] [PATCH v8 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.25.4