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 631A5A0527; Fri, 24 Jul 2020 16:39:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 681821C069; Fri, 24 Jul 2020 16:39:35 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80082.outbound.protection.outlook.com [40.107.8.82]) by dpdk.org (Postfix) with ESMTP id 71D421C043 for ; Fri, 24 Jul 2020 16:39:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y2drkAGSIwUIkCfjmokY0RTY58yTncx6Oqj+a8qE1iAl0Kz8npDU1Sutlu3cNO4a4Iy6ARHnJoyBE0qcpSGYD2UXeTEDjKgRcqG1FhJE4TqS2ALWkrTzbgzlBRoFzlWWeXEIQmDg97ENFsgOMOmD49KjLV9lrKLMehPfsu9ixVvF3euQDXqb0iR0/3cAmDrLJ7LXDXwQGoV/ZWy34eJOxXqEcyfupuZPjegatRPas3J/qEwy/FK2FQAXno06n1XCd1PfqRfig6g3wbewzlss5S44aXnoMLDo3DZPAcmRhP5YK0nWWU/k9ct5DpjYEc7AxkM5NUT35SpBZ4ZPCDrqBw== 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=Mq0ZIjBYU1cgOBpxFbX+ZJpeIvvgVrIrS3RYYcFnVVI=; b=I7ENMJU9QxS0SXehPsYIPC2xAR/XniFGckzoq9zOapI5zyQTa17PaFEwMscjmp/gasY59evUmTMHbRFhXaM17jCbsBhqaTXqnrlMxxjw+S6vuZiPqYrqLCTxm7GTboMy8fSi7LkVFMEGkTw4LZcuHP5zRo5n33cG9jJRCk7NvAxf5GzVOOk3aRu9CwyuBBbVq0HrA01NrYM26WJqrop7jHtvtRl38XsBNKfXH28AYtq+W6EjLY/ZSb1t+8FNcL9U60xAsqxDxsPMk7NXlCwERTDcFiDD8o4DQKZYFdjQ228cgvH2zI1pljqmHl8BJCdpzgTZbIIrbmXQt5pO9feiYQ== 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=Mq0ZIjBYU1cgOBpxFbX+ZJpeIvvgVrIrS3RYYcFnVVI=; b=RJfA4c4ES6Ia6wIbJEfreQu7sggyNKwwqFBaZ3mZxiyf7s0wRW+HQuIGAGIiPTXtQyhxorSEY1+YdB2AnWVGFc+8vn4EZahxreQWOCa+bWM37F4Hw6QvHRnBODRi8I1iztmtUbDrwPyJ05C9twHgFNGcFDDbqgfkDtBTCM+N3L4= 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 AM0PR05MB4962.eurprd05.prod.outlook.com (2603:10a6:208:c3::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.17; Fri, 24 Jul 2020 14:39:30 +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:39:30 +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: Fri, 24 Jul 2020 17:38:59 +0300 Message-Id: <20200724143906.7453-4-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200724143906.7453-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200724143906.7453-1-parav@mellanox.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SA9PR10CA0025.namprd10.prod.outlook.com (2603:10b6:806:a7::30) 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 SA9PR10CA0025.namprd10.prod.outlook.com (2603:10b6:806:a7::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Fri, 24 Jul 2020 14:39:28 +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: 5a8a54ef-1155-482c-cd9d-08d82fdf5fb6 X-MS-TrafficTypeDiagnostic: AM0PR05MB4962: 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: FL0d9usYjBkrusxUyDK8TNp+WMqp9x0NqPJzGvpHxjqqxzFGgy9s1B4VzKdT0JPpYK38dI1B/xn57kEAJDwGoVxluKB7BDptd0Phuy/7ymL+9Dldd232e2foZa0rP6tXo/T04tGakxf3K2hagFbnppOkWB3fwFZ3QTca4o6Y2+++YHt3mUbehGG26jkEFD0v9v459QqrXBO6t9eTVuXvSudOPbhVgEMv4xulalY/+CvUStSIkP3i/mRCD7LYzW+R/e7FH2in8hwfaMmnuzTbpQHgLjluxP+3/2TOJ4vFoesSx9hnscnANluF29e/MCeudJt97/H4kP+ioEysB+GGRw== 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)(396003)(39860400002)(346002)(136003)(376002)(366004)(8936002)(36756003)(1076003)(4326008)(26005)(52116002)(2616005)(956004)(316002)(6506007)(478600001)(16526019)(66946007)(86362001)(6512007)(83380400001)(8676002)(66476007)(66556008)(186003)(6486002)(5660300002)(2906002)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 5zwS7N5ij1E12/j/Lcosa+6qO4xuZyqUK/cOuVDfHK2/A0LUPEZ7K/PhefepORNBFmWu/H/NKdoPK2Fsi5R//hjBJ2JcCuVkOgAKUXskqmZ7e/sDIKo7JwVc6sKuamJERocy84f7hSWBsFULcUR0/2/EflYunssvmZAmHDB2gPW+vBLHnGRouNGz6v5u2pDYSldyJZjozve95/DG0KCKqdGi/PT+ou8H2bw05cSoeVsqPHQBiNuFxwAS2gU5TdI2gMiudyA+4tx3SUne3CKD0Gy9DI3WglVsx7luHN/zX1TNVjHE/WRFydBom4pK3BTusYnpjK250fAMHFv3UTYYOWiip+oYBunugb9BU5DuG8srcNUWlYjwy+/BGOPEsPltd8JcxP9mLKigiDzL/dJOQb8YWbw3cCotDqC9HNaiWPNI541N+wl6lP3VdVy23ZsLT82FcRtcQNir0lGbzPEEWhFcT0k8G/PQcKVFCj70EEEH3gJabseBzoPj4vVPkv4C X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5a8a54ef-1155-482c-cd9d-08d82fdf5fb6 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:39:30.5382 (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: PZkhY36ZSE4JZFO4F9mtlIYEVK1OfjWmsIE2jw/bdeYaOK3tSl8ukcqL098HGIWEBBOBIwmQRm7xD71rTJKCPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4962 Subject: [dpdk-dev] [PATCH v10 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. Review-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