Documentation ¶
Index ¶
- Constants
- func CanonizeID(ID string) string
- func FindSysFsDevice(dev string) (string, error)
- func GetAfuDevType(interfaceID, afuID string) (string, error)
- func IsFpgaFME(name string) bool
- func IsFpgaPort(name string) bool
- func ListFpgaDevices() (FMEs, Ports []string)
- type DflFME
- func (f *DflFME) CheckExtension() (int, error)
- func (f *DflFME) Close() error
- func (f *DflFME) GetAPIVersion() (int, error)
- func (f *DflFME) GetBitstreamID() string
- func (f *DflFME) GetBitstreamMetadata() string
- func (f *DflFME) GetDevPath() string
- func (f *DflFME) GetInterfaceUUID() (id string)
- func (f *DflFME) GetName() string
- func (f *DflFME) GetPCIDevice() (*PCIDevice, error)
- func (f *DflFME) GetPortsNum() int
- func (f *DflFME) GetSocketID() (uint32, error)
- func (f *DflFME) GetSysFsPath() string
- func (f *DflFME) PortPR(port uint32, bitstream []byte) error
- type DflFpgaFmePortPR
- type DflFpgaPortDMAMap
- type DflFpgaPortDMAUnmap
- type DflFpgaPortInfo
- type DflFpgaPortRegionInfo
- type DflPort
- func (f *DflPort) CheckExtension() (int, error)
- func (f *DflPort) Close() error
- func (f *DflPort) GetAPIVersion() (int, error)
- func (f *DflPort) GetAcceleratorTypeUUID() (afuID string)
- func (f *DflPort) GetDevPath() string
- func (f *DflPort) GetFME() (fme FME, err error)
- func (f *DflPort) GetInterfaceUUID() (id string)
- func (f *DflPort) GetName() string
- func (f *DflPort) GetPCIDevice() (*PCIDevice, error)
- func (f *DflPort) GetPortID() (uint32, error)
- func (f *DflPort) GetSysFsPath() string
- func (f *DflPort) PR(bs bitstream.File, dryRun bool) error
- func (f *DflPort) PortGetInfo() (ret PortInfo, err error)
- func (f *DflPort) PortGetRegionInfo(index uint32) (ret PortRegionInfo, err error)
- func (f *DflPort) PortReset() error
- type FME
- type IntelFpgaFME
- func (f *IntelFpgaFME) CheckExtension() (int, error)
- func (f *IntelFpgaFME) Close() error
- func (f *IntelFpgaFME) GetAPIVersion() (int, error)
- func (f *IntelFpgaFME) GetBitstreamID() string
- func (f *IntelFpgaFME) GetBitstreamMetadata() string
- func (f *IntelFpgaFME) GetDevPath() string
- func (f *IntelFpgaFME) GetInterfaceUUID() (id string)
- func (f *IntelFpgaFME) GetName() string
- func (f *IntelFpgaFME) GetPCIDevice() (*PCIDevice, error)
- func (f *IntelFpgaFME) GetPortsNum() int
- func (f *IntelFpgaFME) GetSocketID() (uint32, error)
- func (f *IntelFpgaFME) GetSysFsPath() string
- func (f *IntelFpgaFME) PortPR(port uint32, bitstream []byte) error
- type IntelFpgaFmeErrIrqSet
- type IntelFpgaFmeInfo
- type IntelFpgaFmePortAssign
- type IntelFpgaFmePortPR
- type IntelFpgaFmePortRelease
- type IntelFpgaPort
- func (f *IntelFpgaPort) CheckExtension() (int, error)
- func (f *IntelFpgaPort) Close() error
- func (f *IntelFpgaPort) GetAPIVersion() (int, error)
- func (f *IntelFpgaPort) GetAcceleratorTypeUUID() string
- func (f *IntelFpgaPort) GetDevPath() string
- func (f *IntelFpgaPort) GetFME() (fme FME, err error)
- func (f *IntelFpgaPort) GetInterfaceUUID() (id string)
- func (f *IntelFpgaPort) GetName() string
- func (f *IntelFpgaPort) GetPCIDevice() (*PCIDevice, error)
- func (f *IntelFpgaPort) GetPortID() (uint32, error)
- func (f *IntelFpgaPort) GetSysFsPath() string
- func (f *IntelFpgaPort) PR(bs bitstream.File, dryRun bool) error
- func (f *IntelFpgaPort) PortGetInfo() (ret PortInfo, err error)
- func (f *IntelFpgaPort) PortGetRegionInfo(index uint32) (ret PortRegionInfo, err error)
- func (f *IntelFpgaPort) PortReset() error
- type IntelFpgaPortDmaMap
- type IntelFpgaPortDmaUnmap
- type IntelFpgaPortErrIrqSet
- type IntelFpgaPortInfo
- type IntelFpgaPortRegionInfo
- type IntelFpgaPortUafuIrqSet
- type IntelFpgaPortUmsgBaseAddr
- type IntelFpgaPortUmsgCfg
- type PCIDevice
- type Port
- type PortInfo
- type PortRegionInfo
Constants ¶
const ( DFL_FPGA_GET_API_VERSION = 0xb600 DFL_FPGA_CHECK_EXTENSION = 0xb601 DFL_FPGA_PORT_RESET = 0xb640 DFL_FPGA_PORT_GET_INFO = 0xb641 DFL_FPGA_PORT_GET_REGION_INFO = 0xb642 DFL_FPGA_PORT_DMA_MAP = 0xb643 DFL_FPGA_PORT_DMA_UNMAP = 0xb644 DFL_FPGA_FME_PORT_PR = 0xb680 DFL_FPGA_FME_PORT_RELEASE = 0x4004b681 DFL_FPGA_FME_PORT_ASSIGN = 0x4004b682 DFL_PORT_REGION_READ = 0x1 DFL_PORT_REGION_WRITE = 0x2 DFL_PORT_REGION_MMAP = 0x4 DFL_PORT_REGION_INDEX_AFU = 0x0 DFL_PORT_REGION_INDEX_STP = 0x1 )
const ( FPGA_GET_API_VERSION = 0xb500 FPGA_CHECK_EXTENSION = 0xb501 FPGA_PORT_RESET = 0xb540 FPGA_PORT_GET_INFO = 0xb541 FPGA_PORT_GET_REGION_INFO = 0xb542 FPGA_PORT_DMA_MAP = 0xb543 FPGA_PORT_DMA_UNMAP = 0xb544 FPGA_PORT_UMSG_ENABLE = 0xb545 FPGA_PORT_UMSG_DISABLE = 0xb546 FPGA_PORT_UMSG_SET_MODE = 0xb547 FPGA_PORT_UMSG_SET_BASE_ADDR = 0xb548 FPGA_PORT_ERR_SET_IRQ = 0xb549 FPGA_PORT_UAFU_SET_IRQ = 0xb54a FPGA_FME_PORT_PR = 0xb580 FPGA_FME_PORT_RELEASE = 0xb581 FPGA_FME_PORT_ASSIGN = 0xb582 FPGA_FME_GET_INFO = 0xb583 FPGA_FME_ERR_SET_IRQ = 0xb584 FPGA_PORT_CAP_ERR_IRQ = 0x1 FPGA_PORT_CAP_UAFU_IRQ = 0x2 FPGA_REGION_READ = 0x1 FPGA_REGION_WRITE = 0x2 FPGA_REGION_MMAP = 0x4 FPGA_PORT_INDEX_UAFU = 0x0 FPGA_PORT_INDEX_STP = 0x1 FPGA_DMA_TO_DEV = 0x1 FPGA_DMA_FROM_DEV = 0x2 FPGA_FME_CAP_ERR_IRQ = 0x1 )
Variables ¶
This section is empty.
Functions ¶
func FindSysFsDevice ¶
FindSysFsDevice returns sysfs entry for specified device node or device that holds specified file If resulted device is virtual, error is returned.
func GetAfuDevType ¶ added in v0.18.0
GetAfuDevType returns extended resource name for AFU without namespace. Since in Linux unix socket addresses can't be longer than 108 chars we need to compress devtype a bit, because it's used as a part of the socket's address. Also names of extended resources (without namespace) cannot be longer than 63 characters.
func IsFpgaPort ¶
IsFpgaPort returns true if the name looks like any supported FME device.
func ListFpgaDevices ¶
func ListFpgaDevices() (FMEs, Ports []string)
ListFpgaDevices returns two lists of FPGA device nodes: FMEs and Ports.
Types ¶
type DflFME ¶
type DflFME struct { FME DevPath string SysFsPath string Name string PCIDevice *PCIDevice SocketID string Dev string CompatID string BitstreamID string BitstreamMetadata string PortsNum string }
DflFME represent DFL FPGA FME device.
func (*DflFME) CheckExtension ¶
CheckExtension Check whether an extension is supported. * Return: 0 if not supported, otherwise the extension is supported.
func (*DflFME) GetAPIVersion ¶
GetAPIVersion Report the version of the driver API. * Return: Driver API Version.
func (*DflFME) GetBitstreamID ¶
GetBitstreamID returns FME bitstream id.
func (*DflFME) GetBitstreamMetadata ¶
GetBitstreamMetadata returns FME bitstream metadata.
func (*DflFME) GetDevPath ¶
GetDevPath returns path to device node.
func (*DflFME) GetInterfaceUUID ¶
GetInterfaceUUID returns Interface UUID for FME.
func (*DflFME) GetName ¶
GetName returns simple FPGA name, derived from sysfs entry, can be used with /dev/ or /sys/bus/platform/.
func (*DflFME) GetPCIDevice ¶
GetPCIDevice returns PCIDevice for this device.
func (*DflFME) GetPortsNum ¶
GetPortsNum returns amount of FPGA Ports associated to this FME.
func (*DflFME) GetSocketID ¶
GetSocketID returns physical socket number, in case NUMA enumeration fails.
func (*DflFME) GetSysFsPath ¶
GetSysFsPath returns sysfs entry for FPGA FME or Port (e.g. can be used for custom errors/perf items).
func (*DflFME) PortPR ¶
PortPR does Partial Reconfiguration based on Port ID and Buffer (Image) provided by caller.
- Return: 0 on success, -errno on failure.
- If DFL_FPGA_FME_PORT_PR returns -EIO, that indicates the HW has detected some errors during PR, under this case, the user can fetch HW error info from the status of FME's fpga manager.
type DflFpgaFmePortPR ¶
type DflFpgaPortDMAMap ¶
type DflFpgaPortDMAUnmap ¶
type DflFpgaPortInfo ¶
type DflFpgaPortRegionInfo ¶
type DflPort ¶
type DflPort struct { Port DevPath string SysFsPath string Name string PCIDevice *PCIDevice Dev string AFUID string ID string FME FME }
DflPort represent DFL FPGA Port device.
func (*DflPort) CheckExtension ¶
CheckExtension Check whether an extension is supported. * Return: 0 if not supported, otherwise the extension is supported.
func (*DflPort) GetAPIVersion ¶
GetAPIVersion Report the version of the driver API. * Return: Driver API Version.
func (*DflPort) GetAcceleratorTypeUUID ¶
GetAcceleratorTypeUUID returns AFU UUID for port.
func (*DflPort) GetDevPath ¶
GetDevPath returns path to device node.
func (*DflPort) GetInterfaceUUID ¶
GetInterfaceUUID returns Interface UUID for FME.
func (*DflPort) GetName ¶
GetName returns simple FPGA name, derived from sysfs entry, can be used with /dev/ or /sys/bus/platform/.
func (*DflPort) GetPCIDevice ¶
GetPCIDevice returns PCIDevice for this device.
func (*DflPort) GetSysFsPath ¶
GetSysFsPath returns sysfs entry for FPGA FME or Port (e.g. can be used for custom errors/perf items).
func (*DflPort) PortGetInfo ¶
PortGetInfo Retrieve information about the fpga port. Driver fills the info in provided struct dfl_fpga_port_info. * Return: 0 on success, -errno on failure.
func (*DflPort) PortGetRegionInfo ¶
func (f *DflPort) PortGetRegionInfo(index uint32) (ret PortRegionInfo, err error)
PortGetRegionInfo Retrieve information about the fpga port. * Retrieve information about a device memory region. * Caller provides struct dfl_fpga_port_region_info with index value set. * Driver returns the region info in other fields. * Return: 0 on success, -errno on failure.
func (*DflPort) PortReset ¶
PortReset Reset the FPGA Port and its AFU. No parameters are supported. Userspace can do Port reset at any time, e.g. during DMA or PR. But it should never cause any system level issue, only functional failure (e.g. DMA or PR operation failure) and be recoverable from the failure. * Return: 0 on success, -errno of failure.
type FME ¶
type FME interface { // PortPR does Partial Reconfiguration based on Port ID and Buffer (Image) // provided by caller. // * Return: 0 on success, -errno on failure. // * If DFL_FPGA_FME_PORT_PR returns -EIO, that indicates the HW has detected // some errors during PR, under this case, the user can fetch HW error info // from the status of FME's fpga manager. PortPR(uint32, []byte) error // GetPortsNum returns amount of FPGA Ports associated to this FME GetPortsNum() int // InterfaceUUID returns Interface UUID for FME GetInterfaceUUID() string // GetSocketID returns physical socket number, in case NUMA enumeration fails GetSocketID() (uint32, error) // GetBitstreamID returns FME bitstream id GetBitstreamID() string // GetBitstreamMetadata returns FME bitstream metadata GetBitstreamMetadata() string // contains filtered or unexported methods }
FME represent interfaces provided by management interface of FPGA.
type IntelFpgaFME ¶
type IntelFpgaFME struct { FME DevPath string SysFsPath string Name string PCIDevice *PCIDevice SocketID string Dev string CompatID string BitstreamID string BitstreamMetadata string PortsNum string }
IntelFpgaFME represent Intel FPGA FME device.
func (*IntelFpgaFME) CheckExtension ¶
func (f *IntelFpgaFME) CheckExtension() (int, error)
CheckExtension Check whether an extension is supported. * Return: 0 if not supported, otherwise the extension is supported.
func (*IntelFpgaFME) GetAPIVersion ¶
func (f *IntelFpgaFME) GetAPIVersion() (int, error)
GetAPIVersion Report the version of the driver API. * Return: Driver API Version.
func (*IntelFpgaFME) GetBitstreamID ¶
func (f *IntelFpgaFME) GetBitstreamID() string
GetBitstreamID returns FME bitstream id.
func (*IntelFpgaFME) GetBitstreamMetadata ¶
func (f *IntelFpgaFME) GetBitstreamMetadata() string
GetBitstreamMetadata returns FME bitstream metadata.
func (*IntelFpgaFME) GetDevPath ¶
func (f *IntelFpgaFME) GetDevPath() string
GetDevPath returns path to device node.
func (*IntelFpgaFME) GetInterfaceUUID ¶
func (f *IntelFpgaFME) GetInterfaceUUID() (id string)
GetInterfaceUUID returns Interface UUID for FME.
func (*IntelFpgaFME) GetName ¶
func (f *IntelFpgaFME) GetName() string
GetName returns simple FPGA name, derived from sysfs entry, can be used with /dev/ or /sys/bus/platform/.
func (*IntelFpgaFME) GetPCIDevice ¶
func (f *IntelFpgaFME) GetPCIDevice() (*PCIDevice, error)
GetPCIDevice returns PCIDevice for this device.
func (*IntelFpgaFME) GetPortsNum ¶
func (f *IntelFpgaFME) GetPortsNum() int
GetPortsNum returns amount of FPGA Ports associated to this FME.
func (*IntelFpgaFME) GetSocketID ¶
func (f *IntelFpgaFME) GetSocketID() (uint32, error)
GetSocketID returns physical socket number, in case NUMA enumeration fails.
func (*IntelFpgaFME) GetSysFsPath ¶
func (f *IntelFpgaFME) GetSysFsPath() string
GetSysFsPath returns sysfs entry for FPGA FME or Port (e.g. can be used for custom errors/perf items).
func (*IntelFpgaFME) PortPR ¶
func (f *IntelFpgaFME) PortPR(port uint32, bitstream []byte) error
PortPR does Partial Reconfiguration based on Port ID and Buffer (Image) provided by caller.
- Return: 0 on success, -errno on failure.
- If IntelFpga_FPGA_FME_PORT_PR returns -EIO, that indicates the HW has detected some errors during PR, under this case, the user can fetch HW error info from the status of FME's fpga manager.
type IntelFpgaFmeErrIrqSet ¶
type IntelFpgaFmeInfo ¶
type IntelFpgaFmePortAssign ¶
type IntelFpgaFmePortPR ¶
type IntelFpgaFmePortRelease ¶
type IntelFpgaPort ¶
type IntelFpgaPort struct { Port DevPath string SysFsPath string Name string PCIDevice *PCIDevice Dev string AFUID string ID string FME FME }
IntelFpgaPort represent IntelFpga FPGA Port device.
func (*IntelFpgaPort) CheckExtension ¶
func (f *IntelFpgaPort) CheckExtension() (int, error)
CheckExtension Check whether an extension is supported. * Return: 0 if not supported, otherwise the extension is supported.
func (*IntelFpgaPort) GetAPIVersion ¶
func (f *IntelFpgaPort) GetAPIVersion() (int, error)
GetAPIVersion Report the version of the driver API. * Return: Driver API Version.
func (*IntelFpgaPort) GetAcceleratorTypeUUID ¶
func (f *IntelFpgaPort) GetAcceleratorTypeUUID() string
GetAcceleratorTypeUUID returns AFU UUID for port.
func (*IntelFpgaPort) GetDevPath ¶
func (f *IntelFpgaPort) GetDevPath() string
GetDevPath returns path to device node.
func (*IntelFpgaPort) GetFME ¶
func (f *IntelFpgaPort) GetFME() (fme FME, err error)
GetFME returns FPGA FME device for this port.
func (*IntelFpgaPort) GetInterfaceUUID ¶
func (f *IntelFpgaPort) GetInterfaceUUID() (id string)
GetInterfaceUUID returns Interface UUID for FME.
func (*IntelFpgaPort) GetName ¶
func (f *IntelFpgaPort) GetName() string
GetName returns simple FPGA name, derived from sysfs entry, can be used with /dev/ or /sys/bus/platform/.
func (*IntelFpgaPort) GetPCIDevice ¶
func (f *IntelFpgaPort) GetPCIDevice() (*PCIDevice, error)
GetPCIDevice returns PCIDevice for this device.
func (*IntelFpgaPort) GetPortID ¶
func (f *IntelFpgaPort) GetPortID() (uint32, error)
GetPortID returns ID of the FPGA port within physical device.
func (*IntelFpgaPort) GetSysFsPath ¶
func (f *IntelFpgaPort) GetSysFsPath() string
GetSysFsPath returns sysfs entry for FPGA FME or Port (e.g. can be used for custom errors/perf items).
func (*IntelFpgaPort) PR ¶
func (f *IntelFpgaPort) PR(bs bitstream.File, dryRun bool) error
PR programs specified bitstream to port.
func (*IntelFpgaPort) PortGetInfo ¶
func (f *IntelFpgaPort) PortGetInfo() (ret PortInfo, err error)
PortGetInfo Retrieve information about the fpga port. Driver fills the info in provided struct IntelFpga_fpga_port_info. * Return: 0 on success, -errno on failure.
func (*IntelFpgaPort) PortGetRegionInfo ¶
func (f *IntelFpgaPort) PortGetRegionInfo(index uint32) (ret PortRegionInfo, err error)
PortGetRegionInfo Retrieve information about the fpga port. * Retrieve information about a device memory region. * Caller provides struct IntelFpga_fpga_port_region_info with index value set. * Driver returns the region info in other fields. * Return: 0 on success, -errno on failure.
func (*IntelFpgaPort) PortReset ¶
func (f *IntelFpgaPort) PortReset() error
PortReset Reset the FPGA Port and its AFU. No parameters are supported. Userspace can do Port reset at any time, e.g. during DMA or PR. But it should never cause any system level issue, only functional failure (e.g. DMA or PR operation failure) and be recoverable from the failure. * Return: 0 on success, -errno of failure.
type IntelFpgaPortDmaMap ¶
type IntelFpgaPortDmaUnmap ¶
type IntelFpgaPortErrIrqSet ¶
type IntelFpgaPortInfo ¶
type IntelFpgaPortRegionInfo ¶
type IntelFpgaPortUafuIrqSet ¶
type IntelFpgaPortUmsgCfg ¶
type PCIDevice ¶
type PCIDevice struct { SysFsPath string BDF string Vendor string Device string Class string CPUs string NUMA string VFs string TotalVFs string PhysFn *PCIDevice }
PCIDevice represents most valuable sysfs information about PCI device.
func NewPCIDevice ¶
NewPCIDevice returns sysfs entry for specified PCI device.
type Port ¶
type Port interface { // PortReset Reset the FPGA Port and its AFU. No parameters are supported. // Userspace can do Port reset at any time, e.g. during DMA or PR. But // it should never cause any system level issue, only functional failure // (e.g. DMA or PR operation failure) and be recoverable from the failure. // * Return: 0 on success, -errno of failure PortReset() error // PortGetInfo Retrieve information about the fpga port. // Driver fills the info in provided struct dfl_fpga_port_info. // * Return: 0 on success, -errno on failure. PortGetInfo() (PortInfo, error) // PortGetRegionInfo Retrieve information about the fpga port. // * Retrieve information about a device memory region. // * Caller provides struct dfl_fpga_port_region_info with index value set. // * Driver returns the region info in other fields. // * Return: 0 on success, -errno on failure. PortGetRegionInfo(index uint32) (PortRegionInfo, error) // GetFME returns FPGA FME device for this port GetFME() (FME, error) // GetPortID returns ID of the FPGA port within physical device GetPortID() (uint32, error) // GetAcceleratorTypeUUID returns AFU UUID for port GetAcceleratorTypeUUID() string // InterfaceUUID returns Interface UUID for FME GetInterfaceUUID() string // PR programs specified bitstream to port PR(bitstream.File, bool) error // contains filtered or unexported methods }
Port represent interfaces provided by AFU port of FPGA.
func NewIntelFpgaPort ¶
NewIntelFpgaPort Opens device.