Re: [PATCH v5 07/23] iommu/vt-d: fix dev iotlb pfsid use

From: Jacob Pan
Date: Mon May 14 2018 - 16:35:44 EST


On Mon, 14 May 2018 09:52:04 +0800
Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx> 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!