From patchwork Thu Jul 23 20:09:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parav Pandit X-Patchwork-Id: 74693 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6260DA0518; Thu, 23 Jul 2020 22:10:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C82F01C034; Thu, 23 Jul 2020 22:09:40 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130082.outbound.protection.outlook.com [40.107.13.82]) by dpdk.org (Postfix) with ESMTP id AC0571C010 for ; Thu, 23 Jul 2020 22:09:37 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kbXOEkqveqq9LHyXrntCw1kEtC1wrX8xN6z4PV0VJWwemTxEFDW4qrKsKn4uwrumGUoQ3CNgpo2sXS38ZC/TywQiIHREcjrRcPWnlS5irlA+eybshBMcfz2YkvJs+peaEUTM/cj870TR6zpoDjnSoci+5/6Q3/lhrHajCc4QNZGPOSHYu4Mh2aHFevrBuF5Wr7mI2XPXZwh5Zs9i03b37kplR1loxstWToYXdX4IIDwOh3foLxaahY5LT4n9qXHIT4LZWRHreeLkgoTeXKm+eczIfO2ePO2JeW2ZWkGq9W/6ZSiNeJh0AcsW+dUzlXzTutiDHi8aJGqWB5OTSRgeTw== 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=MjNOGm4Tsp53oTLnQVKVXYU2P5oIovtR4NTCvdLei3M=; b=c4oEFyQHGIAk8JsZz2QPZWC3pg4p+jVnuqVafPAK0kImVgpwzQd+IINPY2duawzITXeUivaho9RM9LQBSgISk1s+wZCU97X6fFK8kfow208D7Rplu2gPUIHRGZFH3MWqz0s4pk6R0cNFhc5M4yyjvMEZL88x2BpkPnn+qCaIoQaVQyLEpaZsm93xD7kkTpmG2sdZtDdJvT7Djlf+ywBuEFYJa99x1QH5VemeIyxdHIQfPtbp2iTpDNxezEe0rRAFZD5xxQqvAbjfb1AgfPL63gA7opccbAVIznx3xzX6jmLjNZAYXGxo9jqgew8rj//GREckp15e8Na1v9/HCzSoYg== 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=MjNOGm4Tsp53oTLnQVKVXYU2P5oIovtR4NTCvdLei3M=; b=YdsuCJBUz91L30+NoJ/mZmA+PknCu7OE+LijAwDgitlxLKtNMfAHRPkLO+bdPO8qju5jIN/zo+nEa5gWL6hQmJ9VkLiqyt5wywiEihciBdCXyfoyBSpeeFnZjrArhD1I32J2a0aXyy1FF5J9N1X9ZA5yE+8FgCLuN7NYNSar3aw= 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:36 +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:36 +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 Date: Thu, 23 Jul 2020 23:09:03 +0300 Message-Id: <20200723200910.376581-4-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> 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:33 +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: 4b44ede1-fe16-4ee9-9182-08d82f4451ce 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:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C7WWIcFzntKKW2V6AUgn8eGvyLWLoL/e9s6VWjci9N400h6/DrEmEKCDN0eUIVIelN7GhoANjVU81wGzDTddI0IyAa8/E8QMDHmPvprM1hsUWhbGbgtN17KfT7rC4HOcmEYc5QkD45FRrqQlLVsGjGBxHGUr4f+7AiVgADXepqD8QSmhUMUHhsC53jW5+EKzNZtQdUiwG2Vmkvtnqqd4xIPayRR6Gjl7jNtLEUQy5PLBKx77OO2pbyMUbKW1FlxF/Lgp/QnUR4qmHfu4pMII5+aHzJhT7tiZiBLUY0q4Lkh38pqozVz9Ql8znoJsHVSmaKWXB+qnLgk65f3uB9iFgQ== 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)(186003)(16526019)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 3ht+hPDMQQzo79R4AuiLDsC860V8JalK3K5iaB/lnPVuBQTC6OiGgA4XTDCc4ZeJf8TzT7/CDUL5nu1+RpkPEMmUVczjQnkUIAKZYWs0P0Z88qbfEYESl4tqQhNOM36ydyeqZQyg/LJsX1e/BI4ViL+QCQu8XolP8LY+uG6dJIrfJhPKW1nHhf2piBWOMuTjvGfd0v7L4yNGv5ReCxukispTOCx7ClFKxFZQ1ggVFiW5PcvFfnbE6iBUux63Ydva8mwCGeWC7Hx+FsyscosviXuGzN1R0Poq8twT3yitXECqozrm6G37W3rNkT/+R0cVTwsN06JroZ4SB+l0iG/lb2Et5gNy/LXQDXZmE2IZMZ2TehDLjAZqLZbU68GqYmjI4dhJ9GghDXZFRL8RWmM/ittjg/SpuQqMewT6JKIRLsncqndhbsERJFZXk1UwgMv0E+SyzlQFqvb2etljGpnjvqLRbbgHRZ4fng6Jw5pygn6erOnSu1fDfdyJ4yWaE8kH X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b44ede1-fe16-4ee9-9182-08d82f4451ce 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:35.1607 (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: faXKUij/AbAidAf9qpztt5AivksGbOw6gwJlMgasD7UFYKE+JyBokYUmUlVRP0rbqEJNFSLkaIGMjVcXcY42aw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5558 Subject: [dpdk-dev] [PATCH v8 03/10] drivers: relax dependency order 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" From: Thomas Monjalon Drivers dependencies are evaluated in the order defined per their parent directory (also called class). This strict ordering prevent from having 2 different drivers of the same class with different dependencies ordering. This problem occurs if drivers/common/mlx5 depends on drivers/bus/pci, while drivers/bus/dpaa depends on drivers/common/dpaax. Having a strict ordering between directories bus and common is too much restrictive. That's why it is made possible to have a more fine-grain directory list, adding a driver sub-directory in the list. In this case, the isolated driver must be removed from its class list, and added directly in drivers/meson.build. Also, the per-class variables must be duplicated in the isolated driver, because the call "subdir(class)" is skipped in the isolated driver case. Signed-off-by: Thomas Monjalon Acked-by: Bruce Richardson Reviewed-by: David Marchand --- drivers/meson.build | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/drivers/meson.build b/drivers/meson.build index e2aeba931..e6d0409aa 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -1,8 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017-2019 Intel Corporation -# Defines the order in which the drivers are buit. -dpdk_driver_classes = [ +# Defines the order of dependencies evaluation +subdirs = [ 'common', 'bus', 'mempool', # depends on common and bus. @@ -27,7 +27,7 @@ if cc.has_argument('-Wno-format-truncation') default_cflags += '-Wno-format-truncation' endif -foreach class:dpdk_driver_classes +foreach subpath:subdirs drivers = [] std_deps = [] config_flag_fmt = '' # format string used to set the value in dpdk_conf @@ -35,8 +35,22 @@ foreach class:dpdk_driver_classes # the library, the dependency and to find the # version file for linking - subdir(class) - class_drivers = [] + # subpath can be either "class" or "class/driver" + if subpath.contains('/') + driver_path = subpath.split('/') + class = driver_path[0] + drivers += driver_path[1] + else + class = subpath + subdir(class) + endif + + # save class name on first occurence + if not dpdk_driver_classes.contains(class) + dpdk_driver_classes += class + endif + # get already enabled drivers of the same class + enabled_drivers = get_variable(class + '_drivers', []) foreach drv:drivers drv_path = join_paths(class, drv) @@ -96,7 +110,7 @@ foreach class:dpdk_driver_classes '_disable_reason', reason) endif else - class_drivers += name + enabled_drivers += name if fmt_name == '' fmt_name = name @@ -203,5 +217,5 @@ foreach class:dpdk_driver_classes endif # build endforeach - set_variable(class + '_drivers', class_drivers) + set_variable(class + '_drivers', enabled_drivers) endforeach