From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacob Pan Subject: Re: [PATCH v5 07/23] iommu/vt-d: fix dev iotlb pfsid use Date: Mon, 14 May 2018 13:38:25 -0700 Message-ID: <20180514133825.5b166b68@jacob-builder> References: <1526072055-86990-1-git-send-email-jacob.jun.pan@linux.intel.com> <1526072055-86990-8-git-send-email-jacob.jun.pan@linux.intel.com> <5AF8EBC4.4040104@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5AF8EBC4.4040104-VuQAYsv1563Yd54FQh9/CA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Lu Baolu Cc: Raj Ashok , Greg Kroah-Hartman , Rafael Wysocki , iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, LKML , Jean Delvare , David Woodhouse List-Id: iommu@lists.linux-foundation.org On Mon, 14 May 2018 09:52:04 +0800 Lu Baolu wrote: > > diff --git a/drivers/iommu/intel-iommu.c > > b/drivers/iommu/intel-iommu.c index 4623294..732a10f 100644 > > --- a/drivers/iommu/intel-iommu.c > > +++ b/drivers/iommu/intel-iommu.c > > @@ -1459,6 +1459,19 @@ static void iommu_enable_dev_iotlb(struct > > device_domain_info *info) return; > > > > pdev = to_pci_dev(info->dev); > > + /* For IOMMU that supports device IOTLB throttling (DIT), > > we assign > > + * PFSID to the invalidation desc of a VF such that IOMMU > > HW can gauge > > + * queue depth at PF level. If DIT is not set, PFSID will > > be treated as > > + * reserved, which should be set to 0. > > + */ > > + if (!ecap_dit(info->iommu->ecap)) > > + info->pfsid = 0; > > + else if (pdev && pdev->is_virtfn) { > > + if (ecap_(info->iommu->ecap)) > > + dev_warn(&pdev->dev, "SRIOV VF device > > IOTLB enabled without flow control\n"); > > I can't understand these two lines. > > Isn't the condition always true? What does the error message mean? you are right, there is no need to check ecap_dit again. thanks!