On 8/2/11 4:15 AM, "Daniel P. Berrange" <berrange(a)redhat.com> wrote:
On Mon, Aug 01, 2011 at 09:16:09PM -0400, Dave Allan wrote:
> On Mon, Aug 01, 2011 at 04:56:58PM -0700, Roopa Prabhu wrote:
>> This patch tries to fix getPhysFn in macvtap.c to get the physical
>> function(PF) of the direct attach interface, if the interface is a SR-IOV
>> VF.
>> It derives the PF/VF relationship from sysfs.
>>
>> There is some code to do this in node device driver. But it is local
>> to the node device driver . I did not see a clean way to use some of the
>> node device stuff here. The node device driver looks at PCI capabilities to
>> get the same information.
>
> We should not have two implementations of this functionality in the
> code. Either the node device code should be made to use this version
> or vice versa.
We already have a file src/util/pci.c that contains a bunch of helper
APIs for dealing with PCI devices. If we need some shared code between
macvtap and the node device driver, then we ought to put it in the pci.c
file
Yes, I looked at it and saw that I had to move quite a few node_device data
structures and code in src/util/pci.c. Wasn't sure if there was a reason for
it to not already exist in src/util/pci.c. So decided to post this patch as
RFC for specific directions.
From the patches that I posted, I still need the stuff that tries to
derive
the net device from the pci device. I will re-evaluate moving the node
device stuff to get PF-VF relationship information into src/util/pci.c and
repost the patches.
Thanks for the comments.