Re: [libvirt] [PATCH 0/3 RFC] macvtap: Implement getPhysfn to support sending a port profile message for a VF to its PF

2011-08-01 Thread Dave Allan
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.  

> This implementation tries to not get into PCI capability details and   
> just looks at sysfs paths to derive the PF-VF relationship
> 
> This patch series implements the following 
> 01/3 - Add function to get the network interface name of a pci device
> 02/3 - Add functions to get sriov PF/VF relationship of a network interface
> 03/3 - macvtap: Fix getPhysfn to get the PF of a direct attach network 
> interface
> 
> Signed-off-by: Roopa Prabhu 
> Signed-off-by: Christian Benvenuti 
> Signed-off-by: David Wang 
> 
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 0/3 RFC] macvtap: Implement getPhysfn to support sending a port profile message for a VF to its PF

2011-08-02 Thread Daniel P. Berrange
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

Regards,
Daniel
-- 
|: http://berrange.com  -o-http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o- http://virt-manager.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org   -o-   http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 0/3 RFC] macvtap: Implement getPhysfn to support sending a port profile message for a VF to its PF

2011-08-02 Thread Roopa Prabhu



On 8/2/11 4:15 AM, "Daniel P. Berrange"  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.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list