Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp890372pxa; Wed, 5 Aug 2020 15:38:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx80EWLSqLWy5V4cV/T3htHt2OA53nQOtIHUVILL6gymaWe3ijk9liS7Bbytg6MV3p0TFR8 X-Received: by 2002:aa7:c259:: with SMTP id y25mr817611edo.130.1596667132567; Wed, 05 Aug 2020 15:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596667132; cv=none; d=google.com; s=arc-20160816; b=ooBcib5QY4Jenwffoy9cms7QNENmkLaLXykPEs1UcK2e+JPRChSX8D1WLJMVkyyPFP /7BrKDGVgSODNxJ7rFcq4WKnvkCFZ9Rmso6KMzcBmpT82HbjzyP2yoMp9OnsFQrsNJBQ RWmNgrEFhmRniEEFYYYbYLd6eeoYI0MoCN17yhNLbB5vPt/z6nNJiuMRRX4V3WJ6ylar C7W9YFCf9IxOS2WuYGlpiCOyqLJ5OYUGXf2KaKfGZoTlvXyNgn6oA3Z6ul6TcXA/1Jxq MC+Y36O7UDLFydRE7lwLzrXezEMXl2NbYNQYA67hZHGhXdjzl3Tdaq3AYHbiRSdfRi0E L9/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-version:dlp-reaction:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=dXkpOaRfxPkSZOYXkNmOMbKk2J20c4/JPj90FY00XYI=; b=JWVuj/mrpWpUHw9wUm5puUQEWfWUutRgyY5lmI6B02BYexCfRod3L9H46eEPNVTUYU Qfr5Fes5ybc/oCTmHX9zQfwq3rv2mClc1/pCImnyKQwvHmjVPLODhIx9xnC3xqfsn4r3 vCyg0IYJE83ZJIVKTuvjB7Tt8TF+YBmc2Zb+WVYV4vzWeD4QepeeR4NM4zEW7N1jaW7x TyVYRkD50H/HWXmSPB0m4m2eq2JfwUiekMzIJjuTvxiODo0nOGh/BEn3tDSFCFcdg+kQ B30AhN28Zwvrd5P4o44Ts/HHIrGdQ8KP66eXp6pZL10NMm8yTpQUNgRzSXb0qb4YdtNw sSrg== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t15si1891853edr.573.2020.08.05.15.38.27; Wed, 05 Aug 2020 15:38:52 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726200AbgHEWg0 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 5 Aug 2020 18:36:26 -0400 Received: from mga06.intel.com ([134.134.136.31]:46643 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbgHEWgZ (ORCPT ); Wed, 5 Aug 2020 18:36:25 -0400 IronPort-SDR: RLirqUXo7HrWwklojeBehlF8me47hTIkHuWZ1BITssDU5Ynrp37mKYa/Dc18VaUj5MNV/n2SBz 26c3rDd+wypg== X-IronPort-AV: E=McAfee;i="6000,8403,9704"; a="214193135" X-IronPort-AV: E=Sophos;i="5.75,439,1589266800"; d="scan'208";a="214193135" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Aug 2020 15:36:24 -0700 IronPort-SDR: 4jqAPXU8L1MlPNyvW2NBUzDdlzqBwLYZRmwkPKNexXoPqVyZVaGMJ89WXsSESBXG0BcEa5uZZ1 Z+spat/UVAog== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,439,1589266800"; d="scan'208";a="332993780" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga007.jf.intel.com with ESMTP; 05 Aug 2020 15:36:24 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 5 Aug 2020 15:36:23 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 5 Aug 2020 15:36:23 -0700 Received: from orsmsx612.amr.corp.intel.com ([10.22.229.25]) by ORSMSX612.amr.corp.intel.com ([10.22.229.25]) with mapi id 15.01.1713.004; Wed, 5 Aug 2020 15:36:23 -0700 From: "Dey, Megha" To: Jason Gunthorpe 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 Thread-Topic: [PATCH RFC v2 02/18] irq/dev-msi: Add support for a new DEV_MSI irq domain Thread-Index: AQHWX3hgWhQMXvQig0qc4n40fOCoeakUaOyAgAASsgCAFXzAsIAAqfsA//+MFHA= Date: Wed, 5 Aug 2020 22:36:23 +0000 Message-ID: <70465fd3a7ae428a82e19f98daa779e8@intel.com> References: <159534667974.28840.2045034360240786644.stgit@djiang5-desk3.ch.intel.com> <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> In-Reply-To: <20200805221548.GK19097@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 x-originating-ip: [10.22.254.132] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jason, > -----Original Message----- > From: Jason Gunthorpe > Sent: Wednesday, August 5, 2020 3:16 PM > 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 > > On Wed, Aug 05, 2020 at 07:18:39PM +0000, Dey, Megha wrote: > > > Hence we will only have one create_dev_msi_domain which can be called > > by any device driver that wants to use the dev-msi IRQ domain to > > alloc/free IRQs. It would be the responsibility of the device driver > > to provide the correct device and update the dev->msi_domain. > > I'm not sure that sounds like a good idea, why should a device driver touch dev- > >msi_domain? > > There was a certain appeal to the api I suggested by having everything related to > setting up the new IRQs being in the core code. The basic API to create the dev_msi domain would be : struct irq_domain *create_dev_msi_irq_domain(struct irq_domain *parent) This can be called by devices according to their use case. For e.g. in dsa case, it is called from the irq remapping driver: iommu->ir_dev_msi_domain = create_dev_msi_domain(iommu->ir_domain) and from the dsa mdev driver: p_dev = get_parent_pci_dev(dev); iommu = device_to_iommu(p_dev); dev->msi_domain = iommu->ir_dev_msi_domain; So we are creating the domain in the IRQ remapping domain which can be used by other devices which want to have the same IRQ parent domain and use dev-msi APIs. We are only updating that device's msi_domain to the already created dev-msi domain in the driver. Other devices (your rdma driver etc) can create their own dev-msi domain by passing the appropriate parent IRq domain. We cannot have this in the core code since the parent domain cannot be the same? Please let me know if you think otherwise.. > > Jason