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.
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 <roprabhu(a)cisco.com>
Signed-off-by: Christian Benvenuti <benve(a)cisco.com>
Signed-off-by: David Wang <dwang2(a)cisco.com>