Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp7091417imm; Tue, 28 Aug 2018 06:19:36 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZioP03iFXZUp8y8V756OYjzjh/vjZ6DnF7eb7IIiBEp/t0GkYir64qAUNoJMSVYzHMweZe X-Received: by 2002:a17:902:5a87:: with SMTP id r7-v6mr1549018pli.247.1535462376473; Tue, 28 Aug 2018 06:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535462376; cv=none; d=google.com; s=arc-20160816; b=eSriOSgbnmpRcgpF67CRS7MWrQt9n0Ener6Nl8oxGXGaM56S9eC5pks7L/utM94/2h zdTIU8hf7nVreK3Xw28y2lbibmyFdxvjU36491gejxYZz3144quwTx0vlpeJFvbzQN/n twrj0r2DKU0KbYPwPBNYQ5hDM7Cm2hgp/1uJGNaZGXKGcm/ebbLpFGgGa7l2FGgIVmBB OX7a1Dfh2+/9hDEOHRHq5KV6p7rfkBMVKKCmHiEQZjnvzadXq4B17vNqCOOMzAV4DG6w JqyY6eIPAhG1OEg2JGibTOP0W9bXrBY8fomw8MtgA+hu70MAtrWAPHOzp/dld9QwhmCw pxVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=+hVT2hUpQbelVOqvUGZf1pAu/XKWCfLfn6EsyCLT1u8=; b=MPhsZdRQ1Z7D9/Pp+x4FWvOVzQo4DUJoz9XJLGj+MhR39thIbxqxmgw4WbcckZdInt /t6a36pX9X82tOy4FGmwHCiBBd9/XPYKqtk/SHojqtuL+ObA/ApkgQYvIWWksttKI1Vr Ir2kiyVBp3QPr2HVDC1CC3+ZFKOCGlXlt6IBEEACZjJVvvE7zT71Ak6A3B6gxv9An56x ynwNlHSyvVLfoDK+UZ6HsqznTUOTzpDT6QcqTCbRd5fLP6HCO/bN40b7hPUYjCv/9ZWp 5jr3QoIvZ/R7b+cqNpLpxBErxYz79X2I7yUfTdVqisgTyZjBEYL6U6gqb2KOHDSviwMs 8QrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qQawZ6WL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 20-v6si971216pfr.242.2018.08.28.06.19.21; Tue, 28 Aug 2018 06:19:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qQawZ6WL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728126AbeH1RJW (ORCPT + 99 others); Tue, 28 Aug 2018 13:09:22 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:44602 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727985AbeH1RJV (ORCPT ); Tue, 28 Aug 2018 13:09:21 -0400 Received: by mail-wr1-f67.google.com with SMTP id v16-v6so1547078wro.11; Tue, 28 Aug 2018 06:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+hVT2hUpQbelVOqvUGZf1pAu/XKWCfLfn6EsyCLT1u8=; b=qQawZ6WLjUykRPMgP73Oc02gxxMHX2qgaTQkuTlyszSlyOW71V7+1i7LAJcUeK5zIj df7iLng6dcWN29BJ4ENxMZBArEUzukTRccPl3iiZSmRKdZ+9ioBTMcKVD1R0Ar0N+FUj 73s8dc4/VG9D623nabElmrMcxQa9PjPhobgA6MPZKS2l3hKZgf13XTKYSy+2sVaQ7o// 8joGHwhjgQBIMSC1EW/E4Lak8oSuXX0+WhVHRqzaDnKsb+H17SEE1FOFCMtXTGW3P2rj RhVw5WWlRwt2r6TUuhaB6e8ppHP2q0iZfFGn+pgdGyAuJQy8EC+7U9TXFCbys+ftzGzm k6Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+hVT2hUpQbelVOqvUGZf1pAu/XKWCfLfn6EsyCLT1u8=; b=KlLQW6wDA2Ww5HHxHtmmTT9fCAFewBL1ufZzl5yGwtg62mp3+sj94oRhvv/lB+o/x5 0TFTM7JzhV1u5xaA224bwfbwrju3EzbXcb27eSjPqYoY/7hab6vjry9n/i9J49eHD6g7 vCv9SyHKuAe3fqDKj/ODtFoSyY4qX/rdfP/wXOIqdDyX1+ceaeq0jcWt7RsoNDHgfcq5 I0n4SsZNogJEazg39Oj4KZ6Bvmd9JVTm3+e6BjZOKfSY+/4YN5VzjTPOgD7DOdKYP5tl /slDAWwMsltHOYY2m59bG15G9BImPMR1DZLWLhol1mdN0Ga4CMxqw86aFudKNFwTNcpM c5Mw== X-Gm-Message-State: APzg51D6WiESY5qTuykLyr+kIE7abUZtW4g8mzozmX2MZdBe2hMKSlGT 7ptJ2wdl6+8j/RC4Tkv7XUFI69zIovniDAcj/6g= X-Received: by 2002:adf:82c3:: with SMTP id 61-v6mr1190360wrc.131.1535462262304; Tue, 28 Aug 2018 06:17:42 -0700 (PDT) MIME-Version: 1.0 References: <1535453838-12154-1-git-send-email-sunil.kovvuri@gmail.com> <1535453838-12154-11-git-send-email-sunil.kovvuri@gmail.com> In-Reply-To: From: Sunil Kovvuri Date: Tue, 28 Aug 2018 18:47:30 +0530 Message-ID: Subject: Re: [PATCH 10/15] soc: octeontx2: Reconfig MSIX base with IOVA To: Arnd Bergmann Cc: LKML , olof@lixom.net, LAKML , linux-soc@vger.kernel.org, Geetha sowjanya , Sunil Goutham , tglx@linutronix.de, Marc Zyngier , jason@lakedaemon.net, linux-pci Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 28, 2018 at 6:27 PM Arnd Bergmann wrote: > > On Tue, Aug 28, 2018 at 2:42 PM Sunil Kovvuri wrote: > > > > On Tue, Aug 28, 2018 at 5:39 PM Arnd Bergmann wrote: > > > > > > On Tue, Aug 28, 2018 at 12:58 PM wrote: > > > > > > > > From: Geetha sowjanya > > > > > > > > HW interprets RVU_AF_MSIXTR_BASE address as an IOVA, hence > > > > create a IOMMU mapping for the physcial address configured by > > > > firmware and reconfig RVU_AF_MSIXTR_BASE with IOVA. > > > > > > > > Signed-off-by: Geetha sowjanya > > > > Signed-off-by: Sunil Goutham > > > > > > I think this needs some more explanation. What is the difference between > > > the MSI-X support in this driver and every other one? Are you working > > > around a hardware bug, or is there something odd in the implementation > > > of your irqchip driver? Do you use a GIC to handle the MSI interrupts > > > or something else? > > > > This admin function is a PCI device which is capable of provisioning > > HW blocks to other PCIe SRIOV devices in the system. Each HW block > > (eg memory buffer pools, NIC dewscriptors, crypto engines e.t.c) needs > > certain no of MSIX vectors. Admin function has a set of 32K MSIX vectors > > in memory (not on-chip) which based on HW block provisioning to a PCI device > > attaches the required number of vectors to that device. Some part of this > > configuration is done by low level firmware. > > > > RVU_AF_MSIXTR_BASE points to the memory region allocated for 32K MSIX > > vectors. If kernel is booted with IOMMU enabled and admin function device > > is attached to SMMU, HW will go through translation to access this MSIX > > vector memory region. Hence the mapping done in this patch. > > Do you mean this is not a regular PCIe MSI-X interrupt to the GIC, but > something internal to your device that gets routed through the IOMMU > back into the device? > > I'm still confused. > > Arnd This is a regular PCIe MSI-X interrupt, the difference is that the bunch of PCI devices here doesn't have a fixed set of MSIX vectors. Admin function has a memory region with 32K MSIX vectors which it provisions to PCI devices based on the HW functional blocks attached to them. A PCI device which works as a ethernet device needs X number of vectors and a crypto device needs Y number of vectors. Since the admin function owns the whole MSIX vector region, HW uses this device's stream ID to access the vectors. Hence the IOMMU mapping. Once MSIX vectors are provisioned to a PCI device they work as normal MSIX interrupt like any other device. Thanks, Sunil.