* pci_sriov_set_totalvfs again
@ 2014-07-30 17:23 Edward Cree
0 siblings, 0 replies; 5+ messages in thread
From: Edward Cree @ 2014-07-30 17:23 UTC (permalink / raw)
To: linux-pci
Calling pci_sriov_set_totalvfs(dev, 0) has no effect, because
pci_sriov_get_totalvfs ignores dev->sriov->driver_max_VFs if it's 0, as
that is used as the 'not set' value.
So, three questions:
a) is this a bug?
b) if not, should the comment on pci_sriov_set_totalvfs mention that
passing numvfs=0 will be interpreted as numvfs=dev->sriov->total_VFs?
c) is there a better way of indicating "current configuration doesn't
support VFs" rather than calling set_totalvfs(0)?
Thanks,
-Edward
||
The information contained in this message is confidential and is intended for the addressee(s) only. If you have received this message in error, please notify the sender immediately and delete the message. Unless you are an addressee (or authorized to receive for an addressee), you may not use, copy or disclose to anyone this message or any information contained in this message. The unauthorized use, disclosure, copying or alteration of this message is strictly prohibited.
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <53D9288B.5030302@solarflare.com>]
* Re: pci_sriov_set_totalvfs again
[not found] <53D9288B.5030302@solarflare.com>
@ 2014-07-30 18:05 ` Don Dutile
2014-07-30 18:24 ` Edward Cree
0 siblings, 1 reply; 5+ messages in thread
From: Don Dutile @ 2014-07-30 18:05 UTC (permalink / raw)
To: Edward Cree, linux-pci
On 07/30/2014 01:16 PM, Edward Cree wrote:
> Calling pci_sriov_set_totalvfs(dev, 0) has no effect, because pci_sriov_get_totalvfs ignores dev->sriov->driver_max_VFs if it's 0, as that is used as the 'not set' value.
> So, three questions:
> a) is this a bug?
> b) if not, should the comment on pci_sriov_set_totalvfs mention that passing numvfs=0 will be interpreted as numvfs=dev->sriov->total_VFs?
> c) is there a better way of indicating "current configuration doesn't support VFs" rather than calling set_totalvfs(0)?
>
> Thanks,
> -Edward
> ||The information contained in this message is confidential and is intended for the addressee(s) only. If you have received this message in error, please notify the sender immediately and delete the message. Unless you are an addressee (or authorized to receive for an addressee), you may not use, copy or disclose to anyone this message or any information contained in this message. The unauthorized use, disclosure, copying or alteration of this message is strictly prohibited.
The file shouldn't exist if the device doesn't provide an SRIOV capability.
If it does, and it's not supported, then add a patch in quirks.c.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pci_sriov_set_totalvfs again
2014-07-30 18:05 ` Don Dutile
@ 2014-07-30 18:24 ` Edward Cree
2014-07-30 21:14 ` Alexander Duyck
0 siblings, 1 reply; 5+ messages in thread
From: Edward Cree @ 2014-07-30 18:24 UTC (permalink / raw)
To: Don Dutile; +Cc: linux-pci
On 30/07/14 19:05, Don Dutile wrote:
> On 07/30/2014 01:16 PM, Edward Cree wrote:
>> Calling pci_sriov_set_totalvfs(dev, 0) has no effect, because
>> pci_sriov_get_totalvfs ignores dev->sriov->driver_max_VFs if it's 0,
>> as that is used as the 'not set' value.
>> So, three questions:
>> a) is this a bug?
>> b) if not, should the comment on pci_sriov_set_totalvfs mention that
>> passing numvfs=0 will be interpreted as numvfs=dev->sriov->total_VFs?
>> c) is there a better way of indicating "current configuration doesn't
>> support VFs" rather than calling set_totalvfs(0)?
>>
>> Thanks,
>> -Edward
>
> The file shouldn't exist if the device doesn't provide an SRIOV
> capability.
> If it does, and it's not supported, then add a patch in quirks.c.
>
>
I don't know much about quirks, but I'm not sure they're the answer
here, as it's not quite as simple as "driver doesn't support it".
It's a firmware / configuration issue, that if the device (it's a NIC)
is configured a certain way [1], the VFs - while appearing fine from a
PCI perspective - don't actually work (they can't pass traffic).
We can't detect this misconfiguration until PF probe time, and we need a
way to report that the VFs aren't usable.
Can quirks handle this?
-Edward
[1] SFC9120-based NICs support multiple PFs per port and these can be
used as a kind of "poor-man's SR-IOV" (we're calling it 'PF-IOV') by
placing the firmware v-switch below the PFs. However, this then
precludes adding a v-switch above the PF to direct VF traffic, meaning
that VFs are useless in this configuration. Consequently, our
configuration tools won't allow VFs and PF-IOV to be enabled
simultaneously, but bugs or corruption could cause this to happen.
The information contained in this message is confidential and is intended for the addressee(s) only. If you have received this message in error, please notify the sender immediately and delete the message. Unless you are an addressee (or authorized to receive for an addressee), you may not use, copy or disclose to anyone this message or any information contained in this message. The unauthorized use, disclosure, copying or alteration of this message is strictly prohibited.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pci_sriov_set_totalvfs again
2014-07-30 18:24 ` Edward Cree
@ 2014-07-30 21:14 ` Alexander Duyck
2014-07-31 12:07 ` Edward Cree
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Duyck @ 2014-07-30 21:14 UTC (permalink / raw)
To: Edward Cree, Don Dutile; +Cc: linux-pci
On 07/30/2014 11:24 AM, Edward Cree wrote:
> On 30/07/14 19:05, Don Dutile wrote:
>> On 07/30/2014 01:16 PM, Edward Cree wrote:
>>> Calling pci_sriov_set_totalvfs(dev, 0) has no effect, because
>>> pci_sriov_get_totalvfs ignores dev->sriov->driver_max_VFs if it's 0,
>>> as that is used as the 'not set' value.
>>> So, three questions:
>>> a) is this a bug?
>>> b) if not, should the comment on pci_sriov_set_totalvfs mention that
>>> passing numvfs=0 will be interpreted as numvfs=dev->sriov->total_VFs?
>>> c) is there a better way of indicating "current configuration doesn't
>>> support VFs" rather than calling set_totalvfs(0)?
>>>
>>> Thanks,
>>> -Edward
>>
>> The file shouldn't exist if the device doesn't provide an SRIOV
>> capability.
>> If it does, and it's not supported, then add a patch in quirks.c.
>>
>>
> I don't know much about quirks, but I'm not sure they're the answer
> here, as it's not quite as simple as "driver doesn't support it".
> It's a firmware / configuration issue, that if the device (it's a NIC)
> is configured a certain way [1], the VFs - while appearing fine from a
> PCI perspective - don't actually work (they can't pass traffic).
> We can't detect this misconfiguration until PF probe time, and we need a
> way to report that the VFs aren't usable.
>
> Can quirks handle this?
>
> -Edward
>
> [1] SFC9120-based NICs support multiple PFs per port and these can be
> used as a kind of "poor-man's SR-IOV" (we're calling it 'PF-IOV') by
> placing the firmware v-switch below the PFs. However, this then
> precludes adding a v-switch above the PF to direct VF traffic, meaning
> that VFs are useless in this configuration. Consequently, our
> configuration tools won't allow VFs and PF-IOV to be enabled
> simultaneously, but bugs or corruption could cause this to happen.
My $.02 on the issue would be to simply have sriov_configure return an
error indicating the resources are not available if you have the PF-IOV
mode enabled it is consuming the VF v-switch resources.
Thanks,
Alex
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: pci_sriov_set_totalvfs again
2014-07-30 21:14 ` Alexander Duyck
@ 2014-07-31 12:07 ` Edward Cree
0 siblings, 0 replies; 5+ messages in thread
From: Edward Cree @ 2014-07-31 12:07 UTC (permalink / raw)
To: Alexander Duyck; +Cc: Don Dutile, linux-pci
On 30/07/14 22:14, Alexander Duyck wrote:
> My $.02 on the issue would be to simply have sriov_configure return an
> error indicating the resources are not available if you have the
> PF-IOV mode enabled it is consuming the VF v-switch resources. Thanks,
> Alex
That would work, but I don't like the idea of saying (in sysfs
device/sriov_totalvfs) "I have some VFs" only to say "not really, ha"
when someone tries to use them. At least, not when we knew all along.
Let's look at this from a different angle:
If I posted a patch to make pci_sriov_set_totalvfs(dev, 0) do what I
want, would there be any objections to taking it? It seems like a sane
API, the only existing (in-tree) users never pass 0, and it shouldn't
require too ugly an implementation.
-Edward
The information contained in this message is confidential and is intended for the addressee(s) only. If you have received this message in error, please notify the sender immediately and delete the message. Unless you are an addressee (or authorized to receive for an addressee), you may not use, copy or disclose to anyone this message or any information contained in this message. The unauthorized use, disclosure, copying or alteration of this message is strictly prohibited.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-07-31 12:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-30 17:23 pci_sriov_set_totalvfs again Edward Cree
[not found] <53D9288B.5030302@solarflare.com>
2014-07-30 18:05 ` Don Dutile
2014-07-30 18:24 ` Edward Cree
2014-07-30 21:14 ` Alexander Duyck
2014-07-31 12:07 ` Edward Cree
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).