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 17A0DA053E; Mon, 27 Jul 2020 19:48:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 338111C0C0; Mon, 27 Jul 2020 19:47:54 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10071.outbound.protection.outlook.com [40.107.1.71]) by dpdk.org (Postfix) with ESMTP id 7DA681C029 for ; Mon, 27 Jul 2020 19:47:50 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NxMKQeBSf3xfSUmJGkTFjnDBfofFlz0XzcYmVidFSZtv+pU8GResv8nkQR1zpanlDAUesG74Vabpwx+h6ZSDaSIHt2y9rQDAoRvKl5CETND7z94Db+3dRy38pU4hZ8zniUB4eqAWp8b9fLJ7c4wUMCfO1BA+jFVy+zn2Fuw1NLoEvRyIzwVjqUsEZRhsMtQ0dOl7XmPZGtHEL+YZ+2xeMCwY21QesOusz51FmydQcfNBor+gFA/6z9hRMT2RrshQoiEGkbjDt9Tqv+HSUWFHS5OYuVRzkuKKTWX4PVGyrTb0L3VSUPQxRXWbueHNGNJQUT/5ufsPV5s1rZguti0Iwg== 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=H+zsjjpUfRvl5A2cJBs9HhKyQjaBgU+JrYc4BRnOFFY=; b=ZfYae+z5u0MPAE/lbt4EI13kBpUSuqBG2ZoLR4GHiDHhInLk1+fa0wIPODbRvAUXN7ZR09MGM4mholLV5gZpcJpFnWTqpS2xJZ6J7P4/j2j4/W7YA4WrTi5gRPGg3MQ+f5gDgF1hOP+QCKFJ+eAHKbEQuNp9qPAYUUVUEybCVy5C1p3rBPpRPfA4aw87gq0BSgAJsLitr9FC1D9vVUxvYfB+xBGzik7e5JT6/7vGix6mOksGNUxoBdhvOR7tdVoXHyCANfimq8vfr93LZFw33F9RCd/phi+B+akTOksNavNeGaMrmKmjw6+xyfGik2w7zixybv9Gd42GIdqxBObknw== 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=H+zsjjpUfRvl5A2cJBs9HhKyQjaBgU+JrYc4BRnOFFY=; b=Adigclea8IBwReXAGqDLc1t6uFhstryBKha55/Fj5p6JlNb6rlBV9iBouzGqzfRMylDCYn05wJqSXXuBdfbmVmNBnrV1GFatVO1qLfT1v5P8muB9vR2n3MEcQkfQknYDMZmUIviaRl99btncRdcvPGYhpvuDI+bEgsH6ElEP/Xk= 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:47:49 +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:47:49 +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, Bruce Richardson Date: Mon, 27 Jul 2020 20:47:08 +0300 Message-Id: <20200727174715.330117-4-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:47:47 +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: 18a57431-8e62-476a-eb81-08d832552d5f 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:2089; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IZ1+wD3Ae2qjV7bd9aW4oo8b+enp68ceRznyP8lH11B3hDxJdkkXMBYaZwdocXPw69LY46PzLL/QKDNfQ9bzCV5erVPx1S38Wc68N6VseUPFv6rj+/+1pcYprtZCkj7ZkgoNQikEeD8Arb4sYxWcgN0rV0EqFhOM3oaZw00I+PO35pOC4LZHhEcPi3b8Rpyn+mO0zdZtTH+XGX3mqEmU/rufpzskMq2h108f/UHwCc8YXZK3RDM4xSB4fGTVXueXHdiB1a5UB87xJJmTooe/S4ykLR0x6srCAg5TL+DBHkRfUYZZSuWxA5+EPVLKYSt7r9SOlgCmiX6q7Ize8CAO7w== 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)(4326008)(83380400001)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 7UpYS6OllwgOAZYdNJoQYP2vpU/y+udozMBE2vCM366/KKNo8DfTBwARZMSSxe8w/IVj5F6wg+GzqOkTff86CgtoNWJvufTR78oV8ri8wcWM+qr3uDQwvzocKd4WLtX+QXkJuUaOWMEkBPGqmia061BONJEvAzqNS9baGxcMOz23CpQF8kRSjSrctfcDSfvpWw4liCicvM2SmA9LIdRLhT5Akbt1K7pUU8R1X1QN3XrxOHP/7ffoo5t8Nl/r4nq3bLtmQrr3oUOLZupCXvmnIzFZ0PuyEu5ij2PuGBmRYLb4nafpnra8+SYuwCsnp/eg4aFebWe+5/p/S91BeqTb07+elVSka77mvMzARmR1KP4e6lyZgIqd/nhBoMDsITINaV+oF9MuJdBFk5+cybg+JneQ8F1uso9wM2sS+tr+n4xLXtln0ViA/KzXWURDtJwfPsfY0pyqrjLoJjIjoDbAx2rgkwqN0/q1fev3moLz8KS9TZvWYwVES70YAd1bA4Jr X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 18a57431-8e62-476a-eb81-08d832552d5f 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:47:48.9664 (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: 3+xGJy5L/Mvq+gJVGZ7OvLol+Cq3MOqQzM9zSeiKUHOBcIdDdeSZRsXqCQ4AWymjF3k7PKaRenyzGY21yVKnTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6227 Subject: [dpdk-dev] [PATCH v12 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 prevents from having pairs of drivers from two classes with different dependency ordering. For example, if the mlx5 common code depends on the pci bus driver, while the dpaax common code is itself a dependency of the dpaa bus driver. Having a strict ordering between directories bus and common is too restrictive, as processing either common drivers or bus drivers first leads us to missing dependencies in this scenario. This patch makes it possible to have a more fine-grain directory list, adding a specific driver sub-directory in the top-level drivers subdirectory list. In this case, the isolated driver must also be removed from its class list, and the per-class variables must be duplicated in the isolated driver, because the call "subdir(class)" is skipped in the isolated driver case. Reviewed-by: Bruce Richardson Acked-by: Bruce Richardson Signed-off-by: Thomas Monjalon --- Changelog: v8->v9: - Updated commit message - Fixed typo --- drivers/meson.build | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/drivers/meson.build b/drivers/meson.build index e2aeba931..038957460 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 occurrence + 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 -- 2.26.2