Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp668807ybh; Wed, 22 Jul 2020 10:06:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwbtAte8mOhiQk5syn/E00yHVPlO+w7YrgUuICOoCFkSJfjlWTGCl0y4hRhvXSrPpwy5zT X-Received: by 2002:a17:906:a10a:: with SMTP id t10mr470775ejy.377.1595437614546; Wed, 22 Jul 2020 10:06:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595437614; cv=none; d=google.com; s=arc-20160816; b=BKbpU2iHTpYMPUJW2IVgyDpLiMdvgx7HmPsuDsXL7qvJk1PywPJVdXBhL1gMLSYiKb yU+d7IxIZ7opn1JiSSSGAqM2YttouPQsMwggeBflk5HtJb6hl3W/7qbX66P0xSFWW3XM zvTk5Iqkb2z+yMvn/Q0VAD/Px3npnAtTm6RzhiLq/zL7g8iE3dOz3MJ0dz6QtTkPIHh1 oshcdKRObykrLKNXGmSR3U78WD1Pd5Ych0+CFNThdmCrFKxgjpznWvSL6o9XBTr1YqBD j2+kSqbjqB20gSqqOjpX7dLAiz6/VHLO1V5d8wh5rSTtBXLJ8Z0xEI/PRcjy+x60zX6w i5wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=ZKCR3MmGVPeTSPwjYlIIPylA3eq+T5ETl4UV+hHQZBg=; b=mWxm+Qe7M6PSsU538H2lmNNhV03wil8U72uwhMpA9PvbP4/6lrNpgyrrifUF+bBAEn hoI6bdnsGuQ13aKvUEa9SmiaqoufTglkmmQwI3ZhfHUnQSkenkbL9f9AcqMB8uubezvV B7sZX01CeRtjohDOC6JFFWXzOJuGlLywawew58GvG2e/C2bpP6Px65sg5GPklM1bSDbm vt0OFJyAb+pEXHzgUusVTBCzRQRryp1OshixOI/7z2zuxp1Q9atC+RbYK3Ayi+Su7/tb ++O2RTFs+JoRH2i3ACzxrKnsnJc6sk9Z4BqFk3uVJritSukwp4UFtFypZ7ULF0t9vi56 YxYA== 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 h25si368359edv.231.2020.07.22.10.06.31; Wed, 22 Jul 2020 10:06:54 -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 S1731668AbgGVRF5 (ORCPT + 99 others); Wed, 22 Jul 2020 13:05:57 -0400 Received: from mga07.intel.com ([134.134.136.100]:13822 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbgGVRF5 (ORCPT ); Wed, 22 Jul 2020 13:05:57 -0400 IronPort-SDR: /oCfT+a9GmLu2AXGt3FjF+8zo4mNtJiSqKHdPDGK41mGHd4DmO2Ob4CP7hSRNKzkhyogXEXBi1 Nq4nrUShJmkw== X-IronPort-AV: E=McAfee;i="6000,8403,9690"; a="215008550" X-IronPort-AV: E=Sophos;i="5.75,383,1589266800"; d="scan'208";a="215008550" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2020 10:05:56 -0700 IronPort-SDR: LzRvidCjs/m9a564knoOx4ZyoubMuvJUXEs5TAVSzPayEV+nJ1bEljsUkzKx5PKhBUpJ5lZR9x GVzVn7GWImyg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,383,1589266800"; d="scan'208";a="328276703" Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by orsmga007.jf.intel.com with ESMTP; 22 Jul 2020 10:05:56 -0700 Received: from [10.254.181.38] (10.254.181.38) by ORSMSX101.amr.corp.intel.com (10.22.225.128) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 22 Jul 2020 10:05:55 -0700 Subject: Re: [PATCH RFC v2 04/18] irq/dev-msi: Introduce APIs to allocate/free dev-msi interrupts To: Jason Gunthorpe , Dave Jiang CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , References: <159534667974.28840.2045034360240786644.stgit@djiang5-desk3.ch.intel.com> <159534736176.28840.5547007059232964457.stgit@djiang5-desk3.ch.intel.com> <20200721162501.GC2021248@mellanox.com> From: "Dey, Megha" Message-ID: Date: Wed, 22 Jul 2020 10:05:52 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200721162501.GC2021248@mellanox.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.254.181.38] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/21/2020 9:25 AM, Jason Gunthorpe wrote: > On Tue, Jul 21, 2020 at 09:02:41AM -0700, Dave Jiang wrote: >> From: Megha Dey >> >> The dev-msi interrupts are to be allocated/freed only for custom devices, >> not standard PCI-MSIX devices. >> >> These interrupts are device-defined and they are distinct from the already >> existing msi interrupts: >> pci-msi: Standard PCI MSI/MSI-X setup format >> platform-msi: Platform custom, but device-driver opaque MSI setup/control >> arch-msi: fallback for devices not assigned to the generic PCI domain >> dev-msi: device defined IRQ domain for ancillary devices. For e.g. DSA >> portal devices use device specific IMS(Interrupt message store) interrupts. >> >> dev-msi interrupts are represented by their own device-type. That means >> dev->msi_list is never contended for different interrupt types. It >> will either be all PCI-MSI or all device-defined. > > Not sure I follow this, where is the enforcement that only dev-msi or > normal MSI is being used at one time on a single struct device? > So, in the dev_msi_alloc_irqs, I first check if the dev_is_pci.. If it is a pci device, it is forbidden to use dev-msi and must use the pci subsystem calls. dev-msi is to be used for all other custom devices, mdev or otherwise. > Jason >