The Pedigree Project 0.1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
PciVirtualFunctions Class Reference

#include <PciVirtualFunctions.h>

+ Collaboration diagram for PciVirtualFunctions:

Public Member Functions

 PciVirtualFunctions (Device *pf)
 
bool enable (size_t count)
 
Device * function (size_t index) const
 
size_t count () const
 
bool disable ()
 

Static Public Member Functions

static bool bar (Device *vf, uint8_t index, uint64_t &pciBase, uint64_t &bytes)
 

Private Member Functions

 PciVirtualFunctions (const PciVirtualFunctions &)=delete
 
PciVirtualFunctions & operator= (const PciVirtualFunctions &)=delete
 
void reclaim ()
 

Private Attributes

Device * m_Pf
 
Device * m_Functions [MaxFunctions] = {}
 
bool m_Present [MaxFunctions] = {}
 
bool m_Reserved [6] = {}
 
size_t m_PlannedCount = 0
 
size_t m_Count = 0
 
uint16_t m_Offset = 0
 
uint16_t m_NextCapability = 0
 
PciSriov::State m_Original
 
PciSriov::Geometry m_Bars
 
bool m_Touched = false
 
bool m_EnableAttempted = false
 

Static Private Attributes

static constexpr size_t MaxFunctions = 8
 

Detailed Description

Owns an explicitly enabled, isolated group of VFs for one physical function. The PF and this group must outlive all VF users. The caller must quiesce the PF and clear its bus-master bit before enable(). VF controllers are children of the returned off-tree nodes and must be removed before disable(). The caller serializes all VF users with enable/disable.

VF Address entries named barN describe CPU-translated slices of PF VF BARs. The actual VF configuration BARs remain zero; drivers must use these assigned ranges without probing or rewriting VF BARs. Isolation covers requester DMA, not peer-to-peer routing or ACS.

Definition at line 21 of file PciVirtualFunctions.h.

Constructor & Destructor Documentation

◆ PciVirtualFunctions()

PciVirtualFunctions::PciVirtualFunctions ( Device *  pf)
explicit

Definition at line 83 of file Sriov.cc.

◆ ~PciVirtualFunctions()

PciVirtualFunctions::~PciVirtualFunctions ( )

Definition at line 85 of file Sriov.cc.

Member Function Documentation

◆ bar()

bool PciVirtualFunctions::bar ( Device *  vf,
uint8_t  index,
uint64_t &  pciBase,
uint64_t &  bytes 
)
static

Definition at line 339 of file Sriov.cc.

◆ count()

size_t PciVirtualFunctions::count ( ) const

Definition at line 256 of file Sriov.cc.

◆ disable()

bool PciVirtualFunctions::disable ( )

Definition at line 261 of file Sriov.cc.

◆ enable()

bool PciVirtualFunctions::enable ( size_t  count)

Definition at line 91 of file Sriov.cc.

◆ function()

Device * PciVirtualFunctions::function ( size_t  index) const

Definition at line 251 of file Sriov.cc.

◆ reclaim()

void PciVirtualFunctions::reclaim ( )
private

Definition at line 277 of file Sriov.cc.

Member Data Documentation

◆ m_Bars

PciSriov::Geometry PciVirtualFunctions::m_Bars
private

Definition at line 50 of file PciVirtualFunctions.h.

◆ m_Count

size_t PciVirtualFunctions::m_Count = 0
private

Definition at line 46 of file PciVirtualFunctions.h.

◆ m_EnableAttempted

bool PciVirtualFunctions::m_EnableAttempted = false
private

Definition at line 52 of file PciVirtualFunctions.h.

◆ m_Functions

Device* PciVirtualFunctions::m_Functions[MaxFunctions] = {}
private

Definition at line 42 of file PciVirtualFunctions.h.

◆ m_NextCapability

uint16_t PciVirtualFunctions::m_NextCapability = 0
private

Definition at line 48 of file PciVirtualFunctions.h.

◆ m_Offset

uint16_t PciVirtualFunctions::m_Offset = 0
private

Definition at line 47 of file PciVirtualFunctions.h.

◆ m_Original

PciSriov::State PciVirtualFunctions::m_Original
private

Definition at line 49 of file PciVirtualFunctions.h.

◆ m_Pf

Device* PciVirtualFunctions::m_Pf
private

Definition at line 41 of file PciVirtualFunctions.h.

◆ m_PlannedCount

size_t PciVirtualFunctions::m_PlannedCount = 0
private

Definition at line 45 of file PciVirtualFunctions.h.

◆ m_Present

bool PciVirtualFunctions::m_Present[MaxFunctions] = {}
private

Definition at line 43 of file PciVirtualFunctions.h.

◆ m_Reserved

bool PciVirtualFunctions::m_Reserved[6] = {}
private

Definition at line 44 of file PciVirtualFunctions.h.

◆ m_Touched

bool PciVirtualFunctions::m_Touched = false
private

Definition at line 51 of file PciVirtualFunctions.h.

◆ MaxFunctions

constexpr size_t PciVirtualFunctions::MaxFunctions = 8
staticconstexprprivate

Definition at line 40 of file PciVirtualFunctions.h.


The documentation for this class was generated from the following files: