Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp964306pxa; Wed, 5 Aug 2020 17:49:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7cem3dufFskxDew1XDGlsIH/n+4SepYFWrXXthZCJF0s/g5WZlRrEW2et5UzMn24tsQBC X-Received: by 2002:a17:906:1986:: with SMTP id g6mr2020568ejd.404.1596674958536; Wed, 05 Aug 2020 17:49:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1596674958; cv=pass; d=google.com; s=arc-20160816; b=Ul+pqqVSxwu5gcSaOtudd4B3Ht5k1ARRzQR6t9RdiGNLsXE6ajuTdCskxe2lLE5+mL /2dOi+geavpB1xEz7vt/vv/CgTMrvyNiZvTAofC1LaoasaGW/fWyIUUtPRN5iMf9tznc 3yrxaEgE95x0ubcQ0l5aHjHjuCy5oPlSyabtiMZCVR8VgLG9ZlHEFbqfRaSEcWmVZtqQ NGIMYs3tdcMXDvvzlfpXHFIJ0I3BWec7Vqq71eYjuqIM7ywLOvrR5OKo38fTLdpH7xEX Gv9Ogf3T4bd5pLAATOoSg5EU9i+KaZM1AXrrLo357+Z3bTQZe+GJnTuqxvcX4pXWKK0v NcvA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:in-reply-to :content-disposition:references:message-id:subject:cc:to:from:date :dkim-signature; bh=wJVQBcW4hT256/PgomfUcWtiFllxl/LoBaMm6CzjBHI=; b=MpwGAJH8WklfJP/pHzooArrppcLRonyx3MhCRBOYPpt2Eit6N/lkOby0Xz3Lv3Sq/+ 4qkLttaxAfZpIDOA8GbzbRlKEfgNlo7LMU8X+wLh0uN67MNjg56GxC5AH2vfbj0UPvfe zlefoHKZwfi28uO3ItzBnU5nGIiXqhWdZAzmNR2JdeaF7jMQ6B7/2OEnDsSz1x1Zwgsl iEt8W1WTqn5cuu6zSP8lCaSTc8lcDgsCaImr8DfF/ZwNf1tkc/KSYaJh/TKtN1oHDEci wO6tdGHTfSk9XfPUuBzBieSuN3zSMBC/6kUsCA5KlTQcNYMvzyef7gTIZZejLNrsUV+/ RDFQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=sFsK+4VI; arc=pass (i=1 spf=pass spfdomain=mellanox.com dkim=pass dkdomain=mellanox.com dmarc=pass fromdomain=mellanox.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k17si2258536eds.353.2020.08.05.17.48.56; Wed, 05 Aug 2020 17:49:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=sFsK+4VI; arc=pass (i=1 spf=pass spfdomain=mellanox.com dkim=pass dkdomain=mellanox.com dmarc=pass fromdomain=mellanox.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726935AbgHFAqZ (ORCPT + 99 others); Wed, 5 Aug 2020 20:46:25 -0400 Received: from mail-eopbgr20069.outbound.protection.outlook.com ([40.107.2.69]:23524 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726150AbgHFAqX (ORCPT ); Wed, 5 Aug 2020 20:46:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gU3jKzOapUa2EP9Z1bZcKYFrxljklgPZXMErl83g5Lfr+IclgWHrJRrvODN3rXIR7RbLVR5HAai59AXkI8ZiOaZVgKkTWL5H+yZyFsM9eX8r/nfTn7EbIoylFaMC9TfdMCxYNNjFp4ofg0+B0w/S7u39MnuNsRAqSQirq2neao4DHhMEcqGxiNsQZutQHTPSN8ZWfDh2ZxcqDy42bBiyx7CbRfpdLGwddPqXF1qxXfOiblnojE2Iutczsbw3pMJuoZ/743gfdeiMtRJ3h9+LvCdFz7RNZIQ248ThF5E7X3GnoJmXy+PerS0MfN4gjNMfyFj5WgkdNPIeb6Khtp58dw== 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=wJVQBcW4hT256/PgomfUcWtiFllxl/LoBaMm6CzjBHI=; b=OOBMI2xmNnZxJ2NfUqssc6Pju/rQJff7mL1lVazqcCG2Ii4bGkrA0WDMAEedDwtDIq65J43SNYWP2/xSRgIiRfIGMlXGU2gyFyLHKEgurc3j8OCsR3i93Z/gRKr6GB+Te/Fm+KQhKQ33JvI3VNt2cBgCUJh1f/sFvgmjb1UmKvPWQgSRYgYTJfa+j66cK8KVy6u71QS99i5yH9RammC+GaqnsKcNoS/ChaWeZ24htUNbLnBrY9bHhMr/kznxwUJJgcYwDjTI8IHxrY3wYNaywXRngSWG3rVG9W0Ip+tCcWenm2LlyfmWVeG5Ohv3Eoznwj1WOHOTnouPmiu3eoIVFw== 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=wJVQBcW4hT256/PgomfUcWtiFllxl/LoBaMm6CzjBHI=; b=sFsK+4VIHDqgaCmzqhJif4T2jOrAM321UmOVn/QPYgVzMBtTfGZG8wpWe18ytDnw8mJWOCEHKWOVJWSdZXyphH5V9Yj9/KfjeJoSknp1lAty9Bm+McKDIJ0iWfOqiAUcjS3GGqnJk4E9yTEb4yZUjJJptR5lpfmEE8G+yz4nPsk= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=mellanox.com; Received: from VI1PR05MB4141.eurprd05.prod.outlook.com (2603:10a6:803:44::15) by VI1PR05MB4493.eurprd05.prod.outlook.com (2603:10a6:803:45::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.16; Thu, 6 Aug 2020 00:46:18 +0000 Received: from VI1PR05MB4141.eurprd05.prod.outlook.com ([fe80::10b0:e5f1:adab:799a]) by VI1PR05MB4141.eurprd05.prod.outlook.com ([fe80::10b0:e5f1:adab:799a%4]) with mapi id 15.20.3261.016; Thu, 6 Aug 2020 00:46:18 +0000 Date: Wed, 5 Aug 2020 21:46:14 -0300 From: Jason Gunthorpe To: "Dey, Megha" Cc: Marc Zyngier , "Jiang, Dave" , "vkoul@kernel.org" , "bhelgaas@google.com" , "rafael@kernel.org" , "gregkh@linuxfoundation.org" , "tglx@linutronix.de" , "hpa@zytor.com" , "alex.williamson@redhat.com" , "Pan, Jacob jun" , "Raj, Ashok" , "Liu, Yi L" , "Lu, Baolu" , "Tian, Kevin" , "Kumar, Sanjay K" , "Luck, Tony" , "Lin, Jing" , "Williams, Dan J" , "kwankhede@nvidia.com" , "eric.auger@redhat.com" , "parav@mellanox.com" , "Hansen, Dave" , "netanelg@mellanox.com" , "shahafs@mellanox.com" , "yan.y.zhao@linux.intel.com" , "pbonzini@redhat.com" , "Ortiz, Samuel" , "Hossain, Mona" , "dmaengine@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "linux-pci@vger.kernel.org" , "kvm@vger.kernel.org" Subject: Re: [PATCH RFC v2 02/18] irq/dev-msi: Add support for a new DEV_MSI irq domain Message-ID: <20200806004614.GN19097@mellanox.com> References: <159534734833.28840.10067945890695808535.stgit@djiang5-desk3.ch.intel.com> <878sfbxtzi.wl-maz@kernel.org> <20200722195928.GN2021248@mellanox.com> <96a1eb5ccc724790b5404a642583919d@intel.com> <20200805221548.GK19097@mellanox.com> <70465fd3a7ae428a82e19f98daa779e8@intel.com> <20200805225330.GL19097@mellanox.com> <630e6a4dc17b49aba32675377f5a50e0@intel.com> <20200806001927.GM19097@mellanox.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: MN2PR19CA0026.namprd19.prod.outlook.com (2603:10b6:208:178::39) To VI1PR05MB4141.eurprd05.prod.outlook.com (2603:10a6:803:44::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mlx.ziepe.ca (156.34.48.30) by MN2PR19CA0026.namprd19.prod.outlook.com (2603:10b6:208:178::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.18 via Frontend Transport; Thu, 6 Aug 2020 00:46:18 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1k3U2w-0041x8-JR; Wed, 05 Aug 2020 21:46:14 -0300 X-Originating-IP: [156.34.48.30] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3d4d3e80-06bb-4a2b-8f3a-08d839a22186 X-MS-TrafficTypeDiagnostic: VI1PR05MB4493: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JffkrB6OM3UAs62K6bgfuq825jMtU4VGZe+aWplJBQvPQZMcG1Z48VWJFUigDE1SA6tgigBdCrNGwu4X0WVMbKpWMOIY2ttO650BIv7b8WY0oIjr0bPr90vCYOy1v3wJnRHI1EIU4hIDV5dXdgpgjyUx52eDa8Bm2M9YN6vypFOhZv7aOy9XjusONXRp/rDhebdWloIRpI5CJF/96stNA/iBNfefscev7DC6EtOvwl1z2RgKKldQi4C80SK0jPSA+Qp/gPBmgVxVhA2bH4aTWNHFzpjIa2+6jIhxt6USMtctYpoH4MBFI6yA/pJ7A7PNV4cqy7QY0HBIR3us+t1yQQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR05MB4141.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(136003)(39860400002)(366004)(346002)(396003)(376002)(6916009)(2616005)(36756003)(86362001)(2906002)(5660300002)(54906003)(7416002)(66946007)(8676002)(316002)(66556008)(66476007)(7406005)(4326008)(1076003)(33656002)(8936002)(9746002)(9786002)(186003)(426003)(26005)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: zEmWJwMljiMzHl9+XMBCAkjGE8oPdvQo21+ny3BFALNp6ou0iot2xrLISXMgAdbuhzxlqDBKoUPSHwBWvSrFM5nKNN1WTF1vqLRmgjzjbMW++wzyB6ctSaQQK5Kdo55pDBaDkP6XxfzL815sUaQb00gAVDHc2cBzqaYUueneSa7vHu6gzNJ32NTF4cZe9L/pZcbH3OxDFZGEHKHIDSXMCDrZq5CDp5uNqQYIKccarKf9DJupsO57vfc8+GVqAFYlr3UkASchMZjIsrgaWzNFI8HeHEn0dtGr38WIzHsX9Gt+Oqk47piM0mL4wp13khmDBWCJ+S7QjyQrOFpRCrMcshhxpEl5lpcGpwB9JCE6Bl3pgaS1iaFruJwMxmESmUNyOcpMpru578xCDBllsm431qN3kkpMLR9nTDnC7UWYxNFaApG1Y9MvOPIInD6oYZgea53HN6ZpwjJTbjUfbhdyP79+Wuk9ShOlL1HxgN2RUP48fJaMiJ8pbzih01Ko/3Aqfa94yA0zyNSRRmb3fs1KYTQQIuoaf9DZDJPOoR86QSCuOygCVnnq0GoZ8yWhP/wnfIea6T6NUIsnnRy5+NGPQTXqBjlbKB5ewciE+zEmatw9l4zO/mVF7JqX3B7bbqOQxxhEW4lXUBUhvDb2ZTS3iQ== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d4d3e80-06bb-4a2b-8f3a-08d839a22186 X-MS-Exchange-CrossTenant-AuthSource: VI1PR05MB4141.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2020 00:46:18.5275 (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: Q7vYwNhVu3UGT+zk/7Vfmxg9IGrIQp+MN7E32Gd0BI97oLLxOUKAZF9PxiZmDDToXAvv6qR59q4Q0nCp9Xlcuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4493 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 06, 2020 at 12:32:31AM +0000, Dey, Megha wrote: > > Oops, I was thinking of platform_msi_domain_alloc_irqs() not > > create_device_domain() > > > > ie call it in the device driver that wishes to consume the extra MSIs. > > > > Is there a harm if each device driver creates a new irq_domain for its use? > > Well, the only harm is if we want to reuse the irq domain. > > As of today, we only have DSA mdev which uses the dev-msi domain. In the IRQ domain hierarchy, > We will have this: > > Vector-> intel-ir->dev-msi > > So tmrw if we have a new device, which would also want to have the > intel-ir as the parent and use the same domain ops, we will simply > be creating a copy of this IRQ domain, which may not be very > fruitful. > > But apart from that, I don't think there are any issues.. > > What do you think is the best approach here? I've surely forgotten these details, I can't advise if duplicate irq_domains are very bad. A single domain per parent irq_domain does seem more elegant, but I'm not sure it is worth the extra work to do it? In any event the API seems cleaner if it is all contained in the platform_msi and strongly connected to the driver, not spread to the iommu as well. If it had to create single dev-msi domain per parent irq_domain then it certainly could be done in a few ways. Jason