mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
libzpci: Add helper to check if a PCI function is a VF
Add zpci_is_vf() helper based on the /sys/bus/pci/devices/<dev>/vfn attribute which is non-zero for VFs unlike the common code VF number which starts at 0. Reviewed-by: Halil Pasic <pasic@linux.ibm.com> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
e0caed5534
commit
86b5df0d2d
@@ -71,6 +71,18 @@ struct zpci_dev {
|
||||
struct zpci_netdev *netdevs;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get if a PCI device is a PCI Virtual Function
|
||||
*
|
||||
* @param[in] zdev The device in question
|
||||
*
|
||||
* @return true if the device is a VF false otherwise
|
||||
*/
|
||||
static inline bool zpci_is_vf(struct zpci_dev *zdev)
|
||||
{
|
||||
return !!zdev->vfn;
|
||||
}
|
||||
|
||||
struct util_list *zpci_dev_list(void);
|
||||
void zpci_free_dev_list(struct util_list *zpci_list);
|
||||
void zpci_free_dev(struct zpci_dev *zdev);
|
||||
|
||||
Reference in New Issue
Block a user