Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1258340
| From | Alexander Duyck <alexander.duyck@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/5] iov: Update virtfn_max_buses to validate offset and stride |
| Date | 2015-10-28 19:00 +0100 |
| Message-ID | <qoDaW-5OU-25@gated-at.bofh.it> (permalink) |
| References | <qojvA-1tZ-1@gated-at.bofh.it> <qojvB-1tZ-29@gated-at.bofh.it> <qoBVv-51M-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 10/28/2015 09:32 AM, Bjorn Helgaas wrote:
> Hi Alex,
>
> Thanks a lot for cleaning this up. I think this is a great
> improvement over what I did.
>
> On Tue, Oct 27, 2015 at 01:52:15PM -0700, Alexander Duyck wrote:
>> This patch pulls the validation of offset and stride into virtfn_max_buses.
>> The general idea is to validate offset and stride for each possible value
>> of numvfs in addition to still determining the maximum bus value for the
>> VFs.
>>
>> I also reversed the loop as the most likely maximum will be when numvfs is
>> set to total_VFs. In addition this makes it so that we loop down to a
>> value of 0 for numvfs which should be the resting state for the register.
>>
>> Fixes: 8e20e89658f2 ("PCI: Set SR-IOV NumVFs to zero after enumeration")
>> Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
>
> I'd like to squash this together with my patch instead of having fixes
> on top of fixes. What do you think of the following? (This applies
> on top of 70675e0b6a1a ("PCI: Don't try to restore VF BARs")).
>
>
> commit c20e11b572c5d4e4f01c86580a133122fbd13cfa
> Author: Alexander Duyck <aduyck@mirantis.com>
> Date: Wed Oct 28 10:54:32 2015 -0500
>
> PCI: Set SR-IOV NumVFs to zero after enumeration
>
> The enumeration path should leave NumVFs set to zero. But after
> 4449f079722c ("PCI: Calculate maximum number of buses required for VFs"),
> we call virtfn_max_buses() in the enumeration path, which changes NumVFs.
> This NumVFs change is visible via lspci and sysfs until a driver enables
> SR-IOV.
>
> Iterate from TotalVFs down to zero so NumVFs is zero when we're finished
> computing the maximum number of buses. Validate offset and stride in
> the loop, so we can test it at every possible NumVFs setting. Rename
> virtfn_max_buses() to compute_max_vf_buses() to hint that it does have a
> side effect of updating iov->max_VF_buses.
>
> [bhelgaas: changelog, rename, reverse sense of error path]
> Fixes: 4449f079722c ("PCI: Calculate maximum number of buses required for VFs")
> Based-on-patch-by: Ethan Zhao <ethan.zhao@oracle.com>
> Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
>
This looks fine to me.
Acked-by: Alexander Duyck <aduyck@mirantis.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/5] Various of SR-IOV fixes and cleanup Alexander Duyck <aduyck@mirantis.com> - 2015-10-27 22:00 +0100
[PATCH 2/5] iov: Reset resources to 0 if totalVFs increases after enabling ARI Alexander Duyck <aduyck@mirantis.com> - 2015-10-27 22:00 +0100
Re: [PATCH 2/5] iov: Reset resources to 0 if totalVFs increases after enabling ARI Bjorn Helgaas <helgaas@kernel.org> - 2015-10-28 17:40 +0100
Re: [PATCH 2/5] iov: Reset resources to 0 if totalVFs increases after enabling ARI Alexander Duyck <alexander.duyck@gmail.com> - 2015-10-28 19:40 +0100
Re: [PATCH 2/5] iov: Reset resources to 0 if totalVFs increases after enabling ARI Bjorn Helgaas <helgaas@kernel.org> - 2015-10-28 21:00 +0100
Re: [PATCH 2/5] iov: Reset resources to 0 if totalVFs increases after enabling ARI Alexander Duyck <alexander.duyck@gmail.com> - 2015-10-28 22:40 +0100
[PATCH 4/5] iov: Variable and loop cleanup for sriov_disable and sriov_enable Alexander Duyck <aduyck@mirantis.com> - 2015-10-27 22:00 +0100
Re: [PATCH 4/5] iov: Variable and loop cleanup for sriov_disable and sriov_enable Bjorn Helgaas <helgaas@kernel.org> - 2015-10-29 22:50 +0100
Re: [PATCH 4/5] iov: Variable and loop cleanup for sriov_disable and sriov_enable Alexander Duyck <alexander.duyck@gmail.com> - 2015-10-30 00:30 +0100
[PATCH 1/5] iov: Update virtfn_max_buses to validate offset and stride Alexander Duyck <aduyck@mirantis.com> - 2015-10-27 22:00 +0100
Re: [PATCH 1/5] iov: Update virtfn_max_buses to validate offset and stride Bjorn Helgaas <helgaas@kernel.org> - 2015-10-28 17:40 +0100
Re: [PATCH 1/5] iov: Update virtfn_max_buses to validate offset and stride Alexander Duyck <alexander.duyck@gmail.com> - 2015-10-28 19:00 +0100
Re: [PATCH 1/5] iov: Update virtfn_max_buses to validate offset and stride Bjorn Helgaas <helgaas@kernel.org> - 2015-10-28 19:50 +0100
Re: [PATCH 1/5] iov: Update virtfn_max_buses to validate offset and stride Alexander Duyck <alexander.duyck@gmail.com> - 2015-10-28 22:50 +0100
Re: [PATCH 1/5] iov: Update virtfn_max_buses to validate offset and stride Bjorn Helgaas <helgaas@kernel.org> - 2015-10-29 21:00 +0100
[PATCH 3/5] iov: Fix sriov_enable exception handling path Alexander Duyck <aduyck@mirantis.com> - 2015-10-27 22:00 +0100
Re: [PATCH 3/5] iov: Fix sriov_enable exception handling path Bjorn Helgaas <helgaas@kernel.org> - 2015-10-29 17:40 +0100
Re: [PATCH 3/5] iov: Fix sriov_enable exception handling path Alex Duyck <aduyck@mirantis.com> - 2015-10-29 18:00 +0100
Re: [PATCH 3/5] iov: Fix sriov_enable exception handling path Bjorn Helgaas <helgaas@kernel.org> - 2015-10-29 21:50 +0100
[PATCH 5/5] iov: Update sriov_enable to correctly handle offset and stride Alexander Duyck <aduyck@mirantis.com> - 2015-10-27 22:00 +0100
csiph-web