(sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget/translations/zh_CN/fpga/dflmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/zh_TW/fpga/dflmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/it_IT/fpga/dflmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/ja_JP/fpga/dflmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/ko_KR/fpga/dflmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/sp_SP/fpga/dflmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h1FPGA Device Feature List (DFL) Framework Overviewh]h1FPGA Device Feature List (DFL) Framework Overview}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhh6/var/lib/git/docbuild/linux/Documentation/fpga/dfl.rsthKubh paragraph)}(hAuthors:h]hAuthors:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh bullet_list)}(hhh](h list_item)}(h'Enno Luebbers h]h)}(hhh](hEnno Luebbers <}(hhhhhNhNubh reference)}(henno.luebbers@intel.comh]henno.luebbers@intel.com}(hhhhhNhNubah}(h]h ]h"]h$]h&]refurimailto:enno.luebbers@intel.comuh1hhhubh>}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(h/Xiao Guangrong h]h)}(hhh](hXiao Guangrong <}(hhhhhNhNubh)}(hguangrong.xiao@linux.intel.comh]hguangrong.xiao@linux.intel.com}(hjhhhNhNubah}(h]h ]h"]h$]h&]refuri%mailto:guangrong.xiao@linux.intel.comuh1hhhubh>}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hWu Hao h]h)}(hj(h](hWu Hao <}(hj*hhhNhNubh)}(hhao.wu@intel.comh]hhao.wu@intel.com}(hj1hhhNhNubah}(h]h ]h"]h$]h&]refurimailto:hao.wu@intel.comuh1hhj*ubh>}(hj*hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK hj&ubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hXu Yilun h]h)}(hXu Yilun h](h Xu Yilun <}(hjUhhhNhNubh)}(hyilun.xu@intel.comh]hyilun.xu@intel.com}(hj]hhhNhNubah}(h]h ]h"]h$]h&]refurimailto:yilun.xu@intel.comuh1hhjUubh>}(hjUhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK hjQubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubeh}(h]h ]h"]h$]h&]bullet-uh1hhhhKhhhhubh)}(hXThe Device Feature List (DFL) FPGA framework (and drivers according to this framework) hides the very details of low layer hardware and provides unified interfaces to userspace. Applications could use these interfaces to configure, enumerate, open and access FPGA accelerators on platforms which implement the DFL in the device memory. Besides this, the DFL framework enables system level management functions such as FPGA reconfiguration.h]hXThe Device Feature List (DFL) FPGA framework (and drivers according to this framework) hides the very details of low layer hardware and provides unified interfaces to userspace. Applications could use these interfaces to configure, enumerate, open and access FPGA accelerators on platforms which implement the DFL in the device memory. Besides this, the DFL framework enables system level management functions such as FPGA reconfiguration.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hhh](h)}(h"Device Feature List (DFL) Overviewh]h"Device Feature List (DFL) Overview}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXODevice Feature List (DFL) defines a linked list of feature headers within the device MMIO space to provide an extensible way of adding features. Software can walk through these predefined data structures to enumerate FPGA features: FPGA Interface Unit (FIU), Accelerated Function Unit (AFU) and Private Features, as illustrated below::h]hXNDevice Feature List (DFL) defines a linked list of feature headers within the device MMIO space to provide an extensible way of adding features. Software can walk through these predefined data structures to enumerate FPGA features: FPGA Interface Unit (FIU), Accelerated Function Unit (AFU) and Private Features, as illustrated below:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh literal_block)}(hXF Header Header Header Header +----------+ +-->+----------+ +-->+----------+ +-->+----------+ | Type | | | Type | | | Type | | | Type | | FIU | | | Private | | | Private | | | Private | +----------+ | | Feature | | | Feature | | | Feature | | Next_DFH |--+ +----------+ | +----------+ | +----------+ +----------+ | Next_DFH |--+ | Next_DFH |--+ | Next_DFH |--> NULL | ID | +----------+ +----------+ +----------+ +----------+ | ID | | ID | | ID | | Next_AFU |--+ +----------+ +----------+ +----------+ +----------+ | | Feature | | Feature | | Feature | | Header | | | Register | | Register | | Register | | Register | | | Set | | Set | | Set | | Set | | +----------+ +----------+ +----------+ +----------+ | Header +-->+----------+ | Type | | AFU | +----------+ | Next_DFH |--> NULL +----------+ | GUID | +----------+ | Header | | Register | | Set | +----------+h]hXF Header Header Header Header +----------+ +-->+----------+ +-->+----------+ +-->+----------+ | Type | | | Type | | | Type | | | Type | | FIU | | | Private | | | Private | | | Private | +----------+ | | Feature | | | Feature | | | Feature | | Next_DFH |--+ +----------+ | +----------+ | +----------+ +----------+ | Next_DFH |--+ | Next_DFH |--+ | Next_DFH |--> NULL | ID | +----------+ +----------+ +----------+ +----------+ | ID | | ID | | ID | | Next_AFU |--+ +----------+ +----------+ +----------+ +----------+ | | Feature | | Feature | | Feature | | Header | | | Register | | Register | | Register | | Register | | | Set | | Set | | Set | | Set | | +----------+ +----------+ +----------+ +----------+ | Header +-->+----------+ | Type | | AFU | +----------+ | Next_DFH |--> NULL +----------+ | GUID | +----------+ | Header | | Register | | Set | +----------+}hjsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jhhhKhjhhubh)}(hFPGA Interface Unit (FIU) represents a standalone functional unit for the interface to FPGA, e.g. the FPGA Management Engine (FME) and Port (more descriptions on FME and Port in later sections).h]hFPGA Interface Unit (FIU) represents a standalone functional unit for the interface to FPGA, e.g. the FPGA Management Engine (FME) and Port (more descriptions on FME and Port in later sections).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjhhubh)}(hAccelerated Function Unit (AFU) represents an FPGA programmable region and always connects to a FIU (e.g. a Port) as its child as illustrated above.h]hAccelerated Function Unit (AFU) represents an FPGA programmable region and always connects to a FIU (e.g. a Port) as its child as illustrated above.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKREV - The revision of the feature associated with this header.h]h)}(hjh]h>REV - The revision of the feature associated with this header.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKehjubah}(h]h ]h"]h$]h&]uh1hhjTubh)}(h0ID - The feature ID if Type is private feature. h]h)}(h/ID - The feature ID if Type is private feature.h]h/ID - The feature ID if Type is private feature.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhjubah}(h]h ]h"]h$]h&]uh1hhjTubeh}(h]h ]h"]h$]h&]j*uh1hhhhK^hjBubeh}(h]h ]h"]h$]h&]uh1hhj?hhhNhNubh)}(hOffset 0x08 * GUID_L - Least significant 64 bits of a 128-bit Globally Unique Identifier (present only if Type is FME or AFU). h](h)}(h Offset 0x08h]h Offset 0x08}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhjubh)}(hhh]h)}(hqGUID_L - Least significant 64 bits of a 128-bit Globally Unique Identifier (present only if Type is FME or AFU). h]h)}(hpGUID_L - Least significant 64 bits of a 128-bit Globally Unique Identifier (present only if Type is FME or AFU).h]hpGUID_L - Least significant 64 bits of a 128-bit Globally Unique Identifier (present only if Type is FME or AFU).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]jjuh1hhhhKjhjubeh}(h]h ]h"]h$]h&]uh1hhj?hhhNhNubh)}(hOffset 0x10 * GUID_H - Most significant 64 bits of a 128-bit Globally Unique Identifier (present only if Type is FME or AFU). h](h)}(h Offset 0x10h]h Offset 0x10}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhj@ubh)}(hhh]h)}(hqGUID_H - Most significant 64 bits of a 128-bit Globally Unique Identifier (present only if Type is FME or AFU). h]h)}(hoGUID_H - Most significant 64 bits of a 128-bit Globally Unique Identifier (present only if Type is FME or AFU).h]hoGUID_H - Most significant 64 bits of a 128-bit Globally Unique Identifier (present only if Type is FME or AFU).}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohjUubah}(h]h ]h"]h$]h&]uh1hhjRubah}(h]h ]h"]h$]h&]jjuh1hhhhKohj@ubeh}(h]h ]h"]h$]h&]uh1hhj?hhhNhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhK\hjhhubeh}(h]device-feature-header-version-0ah ]h"]!device feature header - version 0ah$]h&]uh1hhhhhhhhKOubh)}(hhh](h)}(h!Device Feature Header - Version 1h]h!Device Feature Header - Version 1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKtubh)}(hPVersion 1 (DFHv1) of the Device Feature Header adds the following functionality:h]hPVersion 1 (DFHv1) of the Device Feature Header adds the following functionality:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKuhjhhubh)}(hhh](h)}(h_Provides a standardized mechanism for features to describe parameters/capabilities to software.h]h)}(h_Provides a standardized mechanism for features to describe parameters/capabilities to software.h]h_Provides a standardized mechanism for features to describe parameters/capabilities to software.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKwhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h2Standardize the use of a GUID for all DFHv1 types.h]h)}(hjh]h2Standardize the use of a GUID for all DFHv1 types.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKyhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hJDecouples the DFH location from the register space of the feature itself. h]h)}(hIDecouples the DFH location from the register space of the feature itself.h]hIDecouples the DFH location from the register space of the feature itself.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKzhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhKwhjhhubh)}(hAll multi-byte quantities in DFHv1 are little-endian. The format of Version 1 of the Device Feature Header (DFH) is shown below::h]hAll multi-byte quantities in DFHv1 are little-endian. The format of Version 1 of the Device Feature Header (DFH) is shown below:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK|hjhhubj)}(hX+-----------------------------------------------------------------------+ |63 Type 60|59 DFH VER 52|51 Rsvd 41|40 EOL|39 Next 16|15 REV 12|11 ID 0| 0x00 +-----------------------------------------------------------------------+ |63 GUID_L 0| 0x08 +-----------------------------------------------------------------------+ |63 GUID_H 0| 0x10 +-----------------------------------------------------------------------+ |63 Reg Address/Offset 1| Rel 0| 0x18 +-----------------------------------------------------------------------+ |63 Reg Size 32|Params 31|30 Group 16|15 Instance 0| 0x20 +-----------------------------------------------------------------------+ |63 Next 35|34RSV33|EOP32|31 Param Version 16|15 Param ID 0| 0x28 +-----------------------------------------------------------------------+ |63 Parameter Data 0| 0x30 +-----------------------------------------------------------------------+ ... +-----------------------------------------------------------------------+ |63 Next 35|34RSV33|EOP32|31 Param Version 16|15 Param ID 0| +-----------------------------------------------------------------------+ |63 Parameter Data 0| +-----------------------------------------------------------------------+h]hX+-----------------------------------------------------------------------+ |63 Type 60|59 DFH VER 52|51 Rsvd 41|40 EOL|39 Next 16|15 REV 12|11 ID 0| 0x00 +-----------------------------------------------------------------------+ |63 GUID_L 0| 0x08 +-----------------------------------------------------------------------+ |63 GUID_H 0| 0x10 +-----------------------------------------------------------------------+ |63 Reg Address/Offset 1| Rel 0| 0x18 +-----------------------------------------------------------------------+ |63 Reg Size 32|Params 31|30 Group 16|15 Instance 0| 0x20 +-----------------------------------------------------------------------+ |63 Next 35|34RSV33|EOP32|31 Param Version 16|15 Param ID 0| 0x28 +-----------------------------------------------------------------------+ |63 Parameter Data 0| 0x30 +-----------------------------------------------------------------------+ ... +-----------------------------------------------------------------------+ |63 Next 35|34RSV33|EOP32|31 Param Version 16|15 Param ID 0| +-----------------------------------------------------------------------+ |63 Parameter Data 0| +-----------------------------------------------------------------------+}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhKhjhhubh)}(hhh](h)}(hXOffset 0x00 * Type - The type of DFH (e.g. FME, AFU, or private feature). * DFH VER - The version of the DFH. * Rsvd - Currently unused. * EOL - Set if the DFH is the end of the Device Feature List (DFL). * Next - The offset in bytes of the next DFH in the DFL from the DFH start, and the start of a DFH must be aligned to an 8 byte boundary. If EOL is set, Next is the size of MMIO of the last feature in the list. * REV - The revision of the feature associated with this header. * ID - The feature ID if Type is private feature. h](h)}(h Offset 0x00h]h Offset 0x00}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hhh](h)}(h;Type - The type of DFH (e.g. FME, AFU, or private feature).h]h)}(hj,h]h;Type - The type of DFH (e.g. FME, AFU, or private feature).}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj*ubah}(h]h ]h"]h$]h&]uh1hhj'ubh)}(h!DFH VER - The version of the DFH.h]h)}(hjCh]h!DFH VER - The version of the DFH.}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjAubah}(h]h ]h"]h$]h&]uh1hhj'ubh)}(hRsvd - Currently unused.h]h)}(hjZh]hRsvd - Currently unused.}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjXubah}(h]h ]h"]h$]h&]uh1hhj'ubh)}(hAEOL - Set if the DFH is the end of the Device Feature List (DFL).h]h)}(hjqh]hAEOL - Set if the DFH is the end of the Device Feature List (DFL).}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjoubah}(h]h ]h"]h$]h&]uh1hhj'ubh)}(hNext - The offset in bytes of the next DFH in the DFL from the DFH start, and the start of a DFH must be aligned to an 8 byte boundary. If EOL is set, Next is the size of MMIO of the last feature in the list.h]h)}(hNext - The offset in bytes of the next DFH in the DFL from the DFH start, and the start of a DFH must be aligned to an 8 byte boundary. If EOL is set, Next is the size of MMIO of the last feature in the list.h]hNext - The offset in bytes of the next DFH in the DFL from the DFH start, and the start of a DFH must be aligned to an 8 byte boundary. If EOL is set, Next is the size of MMIO of the last feature in the list.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj'ubh)}(h>REV - The revision of the feature associated with this header.h]h)}(hjh]h>REV - The revision of the feature associated with this header.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj'ubh)}(h0ID - The feature ID if Type is private feature. h]h)}(h/ID - The feature ID if Type is private feature.h]h/ID - The feature ID if Type is private feature.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj'ubeh}(h]h ]h"]h$]h&]jjuh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1hhjhhhNhNubh)}(h[Offset 0x08 * GUID_L - Least significant 64 bits of a 128-bit Globally Unique Identifier. h](h)}(h Offset 0x08h]h Offset 0x08}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hhh]h)}(hLGUID_L - Least significant 64 bits of a 128-bit Globally Unique Identifier. h]h)}(hKGUID_L - Least significant 64 bits of a 128-bit Globally Unique Identifier.h]hKGUID_L - Least significant 64 bits of a 128-bit Globally Unique Identifier.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]jjuh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1hhjhhhNhNubh)}(hZOffset 0x10 * GUID_H - Most significant 64 bits of a 128-bit Globally Unique Identifier. h](h)}(h Offset 0x10h]h Offset 0x10}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hhh]h)}(hKGUID_H - Most significant 64 bits of a 128-bit Globally Unique Identifier. h]h)}(hJGUID_H - Most significant 64 bits of a 128-bit Globally Unique Identifier.h]hJGUID_H - Most significant 64 bits of a 128-bit Globally Unique Identifier.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj'ubah}(h]h ]h"]h$]h&]uh1hhj$ubah}(h]h ]h"]h$]h&]jjuh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1hhjhhhNhNubh)}(hOffset 0x18 * Reg Address/Offset - If Rel bit is set, then the value is the high 63 bits of a 16-bit aligned absolute address of the feature's registers. Otherwise the value is the offset from the start of the DFH of the feature's registers. h](h)}(h Offset 0x18h]h Offset 0x18}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjKubh)}(hhh]h)}(hReg Address/Offset - If Rel bit is set, then the value is the high 63 bits of a 16-bit aligned absolute address of the feature's registers. Otherwise the value is the offset from the start of the DFH of the feature's registers. h]h)}(hReg Address/Offset - If Rel bit is set, then the value is the high 63 bits of a 16-bit aligned absolute address of the feature's registers. Otherwise the value is the offset from the start of the DFH of the feature's registers.h]hReg Address/Offset - If Rel bit is set, then the value is the high 63 bits of a 16-bit aligned absolute address of the feature’s registers. Otherwise the value is the offset from the start of the DFH of the feature’s registers.}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj`ubah}(h]h ]h"]h$]h&]uh1hhj]ubah}(h]h ]h"]h$]h&]jjuh1hhhhKhjKubeh}(h]h ]h"]h$]h&]uh1hhjhhhNhNubh)}(hOffset 0x20 * Reg Size - Size of feature's register set in bytes. * Params - Set if DFH has a list of parameter blocks. * Group - Id of group if feature is part of a group. * Instance - Id of feature instance within a group. h](h)}(h Offset 0x20h]h Offset 0x20}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hhh](h)}(h3Reg Size - Size of feature's register set in bytes.h]h)}(hjh]h5Reg Size - Size of feature’s register set in bytes.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(h3Params - Set if DFH has a list of parameter blocks.h]h)}(hjh]h3Params - Set if DFH has a list of parameter blocks.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(h2Group - Id of group if feature is part of a group.h]h)}(hjh]h2Group - Id of group if feature is part of a group.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(h2Instance - Id of feature instance within a group. h]h)}(h1Instance - Id of feature instance within a group.h]h1Instance - Id of feature instance within a group.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]jjuh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1hhjhhhNhNubh)}(hOffset 0x28 if feature has parameters * Next - Offset to the next parameter block in 8 byte words. If EOP set, size in 8 byte words of last parameter. * Param Version - Version of Param ID. * Param ID - ID of parameter. h](h)}(h%Offset 0x28 if feature has parametersh]h%Offset 0x28 if feature has parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hhh](h)}(hnNext - Offset to the next parameter block in 8 byte words. If EOP set, size in 8 byte words of last parameter.h]h)}(hnNext - Offset to the next parameter block in 8 byte words. If EOP set, size in 8 byte words of last parameter.h]hnNext - Offset to the next parameter block in 8 byte words. If EOP set, size in 8 byte words of last parameter.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(h$Param Version - Version of Param ID.h]h)}(hj1h]h$Param Version - Version of Param ID.}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj/ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hParam ID - ID of parameter. h]h)}(hParam ID - ID of parameter.h]hParam ID - ID of parameter.}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjFubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]jjuh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1hhjhhhNhNubh)}(hwOffset 0x30 * Parameter Data - Parameter data whose size and format is defined by version and ID of the parameter. h](h)}(h Offset 0x30h]h Offset 0x30}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjjubh)}(hhh]h)}(hfParameter Data - Parameter data whose size and format is defined by version and ID of the parameter. h]h)}(hdParameter Data - Parameter data whose size and format is defined by version and ID of the parameter.h]hdParameter Data - Parameter data whose size and format is defined by version and ID of the parameter.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj|ubah}(h]h ]h"]h$]h&]jjuh1hhhhKhjjubeh}(h]h ]h"]h$]h&]uh1hhjhhhNhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhKhjhhubeh}(h]device-feature-header-version-1ah ]h"]!device feature header - version 1ah$]h&]uh1hhhhhhhhKtubh)}(hhh](h)}(h"FIU - FME (FPGA Management Engine)h]h"FIU - FME (FPGA Management Engine)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hzThe FPGA Management Engine performs reconfiguration and other infrastructure functions. Each FPGA device only has one FME.h]hzThe FPGA Management Engine performs reconfiguration and other infrastructure functions. Each FPGA device only has one FME.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hkUser-space applications can acquire exclusive access to the FME using open(), and release it using close().h]hkUser-space applications can acquire exclusive access to the FME using open(), and release it using close().}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h3The following functions are exposed through ioctls:h]h3The following functions are exposed through ioctls:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hhh](h)}(h1Get driver API version (DFL_FPGA_GET_API_VERSION)h]h)}(hjh]h1Get driver API version (DFL_FPGA_GET_API_VERSION)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h/Check for extensions (DFL_FPGA_CHECK_EXTENSION)h]h)}(hjh]h/Check for extensions (DFL_FPGA_CHECK_EXTENSION)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h(Program bitstream (DFL_FPGA_FME_PORT_PR)h]h)}(hjh]h(Program bitstream (DFL_FPGA_FME_PORT_PR)}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h,Assign port to PF (DFL_FPGA_FME_PORT_ASSIGN)h]h)}(hj6h]h,Assign port to PF (DFL_FPGA_FME_PORT_ASSIGN)}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj4ubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h0Release port from PF (DFL_FPGA_FME_PORT_RELEASE)h]h)}(hjMh]h0Release port from PF (DFL_FPGA_FME_PORT_RELEASE)}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjKubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hEGet number of irqs of FME global error (DFL_FPGA_FME_ERR_GET_IRQ_NUM)h]h)}(hjdh]hEGet number of irqs of FME global error (DFL_FPGA_FME_ERR_GET_IRQ_NUM)}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjbubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h?Set interrupt trigger for FME error (DFL_FPGA_FME_ERR_SET_IRQ) h]h)}(h>Set interrupt trigger for FME error (DFL_FPGA_FME_ERR_SET_IRQ)h]h>Set interrupt trigger for FME error (DFL_FPGA_FME_ERR_SET_IRQ)}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjyubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhKhjhhubh)}(hUMore functions are exposed through sysfs (/sys/class/fpga_region/regionX/dfl-fme.n/):h]hUMore functions are exposed through sysfs (/sys/class/fpga_region/regionX/dfl-fme.n/):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh block_quote)}(hXRead bitstream ID (bitstream_id) bitstream_id indicates version of the static FPGA region. Read bitstream metadata (bitstream_metadata) bitstream_metadata includes detailed information of static FPGA region, e.g. synthesis date and seed. Read number of ports (ports_num) one FPGA device may have more than one port, this sysfs interface indicates how many ports the FPGA device has. Global error reporting management (errors/) error reporting sysfs interfaces allow user to read errors detected by the hardware, and clear the logged errors. Power management (dfl_fme_power hwmon) power management hwmon sysfs interfaces allow user to read power management information (power consumption, thresholds, threshold status, limits, etc.) and configure power thresholds for different throttling levels. Thermal management (dfl_fme_thermal hwmon) thermal management hwmon sysfs interfaces allow user to read thermal management information (current temperature, thresholds, threshold status, etc.). Performance reporting performance counters are exposed through perf PMU APIs. Standard perf tool can be used to monitor all available perf events. Please see performance counter section below for more detailed information. h]hdefinition_list)}(hhh](hdefinition_list_item)}(h[Read bitstream ID (bitstream_id) bitstream_id indicates version of the static FPGA region. h](hterm)}(h Read bitstream ID (bitstream_id)h]h Read bitstream ID (bitstream_id)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubh definition)}(hhh]h)}(h9bitstream_id indicates version of the static FPGA region.h]h9bitstream_id indicates version of the static FPGA region.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hRead bitstream metadata (bitstream_metadata) bitstream_metadata includes detailed information of static FPGA region, e.g. synthesis date and seed. h](j)}(h,Read bitstream metadata (bitstream_metadata)h]h,Read bitstream metadata (bitstream_metadata)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hhh]h)}(hebitstream_metadata includes detailed information of static FPGA region, e.g. synthesis date and seed.h]hebitstream_metadata includes detailed information of static FPGA region, e.g. synthesis date and seed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hRead number of ports (ports_num) one FPGA device may have more than one port, this sysfs interface indicates how many ports the FPGA device has. h](j)}(h Read number of ports (ports_num)h]h Read number of ports (ports_num)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hhh]h)}(hoone FPGA device may have more than one port, this sysfs interface indicates how many ports the FPGA device has.h]hoone FPGA device may have more than one port, this sysfs interface indicates how many ports the FPGA device has.}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj&ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hGlobal error reporting management (errors/) error reporting sysfs interfaces allow user to read errors detected by the hardware, and clear the logged errors. h](j)}(h+Global error reporting management (errors/)h]h+Global error reporting management (errors/)}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjCubj)}(hhh]h)}(hqerror reporting sysfs interfaces allow user to read errors detected by the hardware, and clear the logged errors.h]hqerror reporting sysfs interfaces allow user to read errors detected by the hardware, and clear the logged errors.}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjUubah}(h]h ]h"]h$]h&]uh1jhjCubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hPower management (dfl_fme_power hwmon) power management hwmon sysfs interfaces allow user to read power management information (power consumption, thresholds, threshold status, limits, etc.) and configure power thresholds for different throttling levels. h](j)}(h&Power management (dfl_fme_power hwmon)h]h&Power management (dfl_fme_power hwmon)}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjrubj)}(hhh]h)}(hpower management hwmon sysfs interfaces allow user to read power management information (power consumption, thresholds, threshold status, limits, etc.) and configure power thresholds for different throttling levels.h]hpower management hwmon sysfs interfaces allow user to read power management information (power consumption, thresholds, threshold status, limits, etc.) and configure power thresholds for different throttling levels.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjrubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hThermal management (dfl_fme_thermal hwmon) thermal management hwmon sysfs interfaces allow user to read thermal management information (current temperature, thresholds, threshold status, etc.). h](j)}(h*Thermal management (dfl_fme_thermal hwmon)h]h*Thermal management (dfl_fme_thermal hwmon)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hhh]h)}(hthermal management hwmon sysfs interfaces allow user to read thermal management information (current temperature, thresholds, threshold status, etc.).h]hthermal management hwmon sysfs interfaces allow user to read thermal management information (current temperature, thresholds, threshold status, etc.).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hPerformance reporting performance counters are exposed through perf PMU APIs. Standard perf tool can be used to monitor all available perf events. Please see performance counter section below for more detailed information. h](j)}(hPerformance reportingh]hPerformance reporting}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hhh]h)}(hperformance counters are exposed through perf PMU APIs. Standard perf tool can be used to monitor all available perf events. Please see performance counter section below for more detailed information.h]hperformance counters are exposed through perf PMU APIs. Standard perf tool can be used to monitor all available perf events. Please see performance counter section below for more detailed information.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjhhubeh}(h]fiu-fme-fpga-management-engineah ]h"]"fiu - fme (fpga management engine)ah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h FIU - PORTh]h FIU - PORT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hX)A port represents the interface between the static FPGA fabric and a partially reconfigurable region containing an AFU. It controls the communication from SW to the accelerator and exposes features such as reset and debug. Each FPGA device may have more than one port, but always one AFU per port.h]hX)A port represents the interface between the static FPGA fabric and a partially reconfigurable region containing an AFU. It controls the communication from SW to the accelerator and exposes features such as reset and debug. Each FPGA device may have more than one port, but always one AFU per port.}(hj$ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubeh}(h]fiu-portah ]h"] fiu - portah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hAFUh]hAFU}(hj= hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj: hhhhhMubh)}(h~An AFU is attached to a port FIU and exposes a fixed length MMIO region to be used for accelerator-specific control registers.h]h~An AFU is attached to a port FIU and exposes a fixed length MMIO region to be used for accelerator-specific control registers.}(hjK hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj: hhubh)}(hUser-space applications can acquire exclusive access to an AFU attached to a port by using open() on the port device node and release it using close().h]hUser-space applications can acquire exclusive access to an AFU attached to a port by using open() on the port device node and release it using close().}(hjY hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj: hhubh)}(h3The following functions are exposed through ioctls:h]h3The following functions are exposed through ioctls:}(hjg hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj: hhubh)}(hhh](h)}(h1Get driver API version (DFL_FPGA_GET_API_VERSION)h]h)}(hjz h]h1Get driver API version (DFL_FPGA_GET_API_VERSION)}(hj| hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjx ubah}(h]h ]h"]h$]h&]uh1hhju hhhhhNubh)}(h/Check for extensions (DFL_FPGA_CHECK_EXTENSION)h]h)}(hj h]h/Check for extensions (DFL_FPGA_CHECK_EXTENSION)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj ubah}(h]h ]h"]h$]h&]uh1hhju hhhhhNubh)}(h&Get port info (DFL_FPGA_PORT_GET_INFO)h]h)}(hj h]h&Get port info (DFL_FPGA_PORT_GET_INFO)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj ubah}(h]h ]h"]h$]h&]uh1hhju hhhhhNubh)}(h4Get MMIO region info (DFL_FPGA_PORT_GET_REGION_INFO)h]h)}(hj h]h4Get MMIO region info (DFL_FPGA_PORT_GET_REGION_INFO)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1hhju hhhhhNubh)}(h&Map DMA buffer (DFL_FPGA_PORT_DMA_MAP)h]h)}(hj h]h&Map DMA buffer (DFL_FPGA_PORT_DMA_MAP)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1hhju hhhhhNubh)}(h*Unmap DMA buffer (DFL_FPGA_PORT_DMA_UNMAP)h]h)}(hj h]h*Unmap DMA buffer (DFL_FPGA_PORT_DMA_UNMAP)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1hhju hhhhhNubh)}(hReset AFU (DFL_FPGA_PORT_RESET)h]h)}(hj h]hReset AFU (DFL_FPGA_PORT_RESET)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1hhju hhhhhNubh)}(h@Get number of irqs of port error (DFL_FPGA_PORT_ERR_GET_IRQ_NUM)h]h)}(hj h]h@Get number of irqs of port error (DFL_FPGA_PORT_ERR_GET_IRQ_NUM)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1hhju hhhhhNubh)}(h@Set interrupt trigger for port error (DFL_FPGA_PORT_ERR_SET_IRQ)h]h)}(hj2 h]h@Set interrupt trigger for port error (DFL_FPGA_PORT_ERR_SET_IRQ)}(hj4 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj0 ubah}(h]h ]h"]h$]h&]uh1hhju hhhhhNubh)}(h;Get number of irqs of UINT (DFL_FPGA_PORT_UINT_GET_IRQ_NUM)h]h)}(hjI h]h;Get number of irqs of UINT (DFL_FPGA_PORT_UINT_GET_IRQ_NUM)}(hjK hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjG ubah}(h]h ]h"]h$]h&]uh1hhju hhhhhNubh)}(h//):h]h[More functions are exposed through sysfs: (/sys/class/fpga_region///):}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj: hhubj)}(hXRead Accelerator GUID (afu_id) afu_id indicates which PR bitstream is programmed to this AFU. Error reporting (errors/) error reporting sysfs interfaces allow user to read port/afu errors detected by the hardware, and clear the logged errors. h]j)}(hhh](j)}(h^Read Accelerator GUID (afu_id) afu_id indicates which PR bitstream is programmed to this AFU. h](j)}(hRead Accelerator GUID (afu_id)h]hRead Accelerator GUID (afu_id)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM#hj ubj)}(hhh]h)}(h>afu_id indicates which PR bitstream is programmed to this AFU.h]h>afu_id indicates which PR bitstream is programmed to this AFU.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM#hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhM#hj ubj)}(hError reporting (errors/) error reporting sysfs interfaces allow user to read port/afu errors detected by the hardware, and clear the logged errors. h](j)}(hError reporting (errors/)h]hError reporting (errors/)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM(hj ubj)}(hhh]h)}(hzerror reporting sysfs interfaces allow user to read port/afu errors detected by the hardware, and clear the logged errors.h]hzerror reporting sysfs interfaces allow user to read port/afu errors detected by the hardware, and clear the logged errors.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM&hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhM(hj ubeh}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhhhM"hj: hhubeh}(h]afuah ]h"]afuah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hDFL Framework Overviewh]hDFL Framework Overview}(hjL hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjI hhhhhM+ubj)}(hX +----------+ +--------+ +--------+ +--------+ | FME | | AFU | | AFU | | AFU | | Module | | Module | | Module | | Module | +----------+ +--------+ +--------+ +--------+ +-----------------------+ | FPGA Container Device | Device Feature List | (FPGA Base Region) | Framework +-----------------------+ ------------------------------------------------------------------ +----------------------------+ | FPGA DFL Device Module | | (e.g. PCIE/Platform Device)| +----------------------------+ +------------------------+ | FPGA Hardware Device | +------------------------+h]hX +----------+ +--------+ +--------+ +--------+ | FME | | AFU | | AFU | | AFU | | Module | | Module | | Module | | Module | +----------+ +--------+ +--------+ +--------+ +-----------------------+ | FPGA Container Device | Device Feature List | (FPGA Base Region) | Framework +-----------------------+ ------------------------------------------------------------------ +----------------------------+ | FPGA DFL Device Module | | (e.g. PCIE/Platform Device)| +----------------------------+ +------------------------+ | FPGA Hardware Device | +------------------------+}hjZ sbah}(h]h ]h"]h$]h&]jjuh1jhhhM/hjI hhubh)}(hXDFL framework in kernel provides common interfaces to create container device (FPGA base region), discover feature devices and their private features from the given Device Feature Lists and create platform devices for feature devices (e.g. FME, Port and AFU) with related resources under the container device. It also abstracts operations for the private features and exposes common ops to feature device drivers.h]hXDFL framework in kernel provides common interfaces to create container device (FPGA base region), discover feature devices and their private features from the given Device Feature Lists and create platform devices for feature devices (e.g. FME, Port and AFU) with related resources under the container device. It also abstracts operations for the private features and exposes common ops to feature device drivers.}(hjh hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM@hjI hhubh)}(hXThe FPGA DFL Device could be different hardware, e.g. PCIe device, platform device and etc. Its driver module is always loaded first once the device is created by the system. This driver plays an infrastructural role in the driver architecture. It locates the DFLs in the device memory, handles them and related resources to common interfaces from DFL framework for enumeration. (Please refer to drivers/fpga/dfl.c for detailed enumeration APIs).h]hXThe FPGA DFL Device could be different hardware, e.g. PCIe device, platform device and etc. Its driver module is always loaded first once the device is created by the system. This driver plays an infrastructural role in the driver architecture. It locates the DFLs in the device memory, handles them and related resources to common interfaces from DFL framework for enumeration. (Please refer to drivers/fpga/dfl.c for detailed enumeration APIs).}(hjv hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMGhjI hhubh)}(hThe FPGA Management Engine (FME) driver is a platform driver which is loaded automatically after FME platform device creation from the DFL device module. It provides the key features for FPGA management, including:h]hThe FPGA Management Engine (FME) driver is a platform driver which is loaded automatically after FME platform device creation from the DFL device module. It provides the key features for FPGA management, including:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMNhjI hhubj)}(hXa) Expose static FPGA region information, e.g. version and metadata. Users can read related information via sysfs interfaces exposed by FME driver. b) Partial Reconfiguration. The FME driver creates FPGA manager, FPGA bridges and FPGA regions during PR sub feature initialization. Once it receives a DFL_FPGA_FME_PORT_PR ioctl from user, it invokes the common interface function from FPGA Region to complete the partial reconfiguration of the PR bitstream to the given port. h]henumerated_list)}(hhh](h)}(hExpose static FPGA region information, e.g. version and metadata. Users can read related information via sysfs interfaces exposed by FME driver. h]h)}(hExpose static FPGA region information, e.g. version and metadata. Users can read related information via sysfs interfaces exposed by FME driver.h]hExpose static FPGA region information, e.g. version and metadata. Users can read related information via sysfs interfaces exposed by FME driver.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMRhj ubah}(h]h ]h"]h$]h&]uh1hhj ubh)}(hXDPartial Reconfiguration. The FME driver creates FPGA manager, FPGA bridges and FPGA regions during PR sub feature initialization. Once it receives a DFL_FPGA_FME_PORT_PR ioctl from user, it invokes the common interface function from FPGA Region to complete the partial reconfiguration of the PR bitstream to the given port. h]h)}(hXCPartial Reconfiguration. The FME driver creates FPGA manager, FPGA bridges and FPGA regions during PR sub feature initialization. Once it receives a DFL_FPGA_FME_PORT_PR ioctl from user, it invokes the common interface function from FPGA Region to complete the partial reconfiguration of the PR bitstream to the given port.h]hXCPartial Reconfiguration. The FME driver creates FPGA manager, FPGA bridges and FPGA regions during PR sub feature initialization. Once it receives a DFL_FPGA_FME_PORT_PR ioctl from user, it invokes the common interface function from FPGA Region to complete the partial reconfiguration of the PR bitstream to the given port.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMVhj ubah}(h]h ]h"]h$]h&]uh1hhj ubeh}(h]h ]h"]h$]h&]enumtype loweralphaprefixhsuffix)uh1j hj ubah}(h]h ]h"]h$]h&]uh1jhhhMRhjI hhubh)}(hX`Similar to the FME driver, the FPGA Accelerated Function Unit (AFU) driver is probed once the AFU platform device is created. The main function of this module is to provide an interface for userspace applications to access the individual accelerators, including basic reset control on port, AFU MMIO region export, dma buffer mapping service functions.h]hX`Similar to the FME driver, the FPGA Accelerated Function Unit (AFU) driver is probed once the AFU platform device is created. The main function of this module is to provide an interface for userspace applications to access the individual accelerators, including basic reset control on port, AFU MMIO region export, dma buffer mapping service functions.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM\hjI hhubh)}(hX After feature platform devices creation, matched platform drivers will be loaded automatically to handle different functionalities. Please refer to next sections for detailed information on functional units which have been already implemented under this DFL framework.h]hX After feature platform devices creation, matched platform drivers will be loaded automatically to handle different functionalities. Please refer to next sections for detailed information on functional units which have been already implemented under this DFL framework.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMbhjI hhubeh}(h]dfl-framework-overviewah ]h"]dfl framework overviewah$]h&]uh1hhhhhhhhM+ubh)}(hhh](h)}(hPartial Reconfigurationh]hPartial Reconfiguration}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMiubh)}(hXEAs mentioned above, accelerators can be reconfigured through partial reconfiguration of a PR bitstream file. The PR bitstream file must have been generated for the exact static FPGA region and targeted reconfigurable region (port) of the FPGA, otherwise, the reconfiguration operation will fail and possibly cause system instability. This compatibility can be checked by comparing the compatibility ID noted in the header of PR bitstream file against the compat_id exposed by the target FPGA region. This check is usually done by userspace before calling the reconfiguration IOCTL.h]hXEAs mentioned above, accelerators can be reconfigured through partial reconfiguration of a PR bitstream file. The PR bitstream file must have been generated for the exact static FPGA region and targeted reconfigurable region (port) of the FPGA, otherwise, the reconfiguration operation will fail and possibly cause system instability. This compatibility can be checked by comparing the compatibility ID noted in the header of PR bitstream file against the compat_id exposed by the target FPGA region. This check is usually done by userspace before calling the reconfiguration IOCTL.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMjhj hhubeh}(h]partial-reconfigurationah ]h"]partial reconfigurationah$]h&]uh1hhhhhhhhMiubh)}(hhh](h)}(h FPGA virtualization - PCIe SRIOVh]h FPGA virtualization - PCIe SRIOV}(hj* hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj' hhhhhMuubh)}(hThis section describes the virtualization support on DFL based FPGA device to enable accessing an accelerator from applications running in a virtual machine (VM). This section only describes the PCIe based FPGA device with SRIOV support.h]hThis section describes the virtualization support on DFL based FPGA device to enable accessing an accelerator from applications running in a virtual machine (VM). This section only describes the PCIe based FPGA device with SRIOV support.}(hj8 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMvhj' hhubh)}(hpFeatures supported by the particular FPGA device are exposed through Device Feature Lists, as illustrated below:h]hpFeatures supported by the particular FPGA device are exposed through Device Feature Lists, as illustrated below:}(hjF hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMzhj' hhubj)}(hX +-------------------------------+ +-------------+ | PF | | VF | +-------------------------------+ +-------------+ ^ ^ ^ ^ | | | | +-----|------------|---------|--------------|-------+ | | | | | | | +-----+ +-------+ +-------+ +-------+ | | | FME | | Port0 | | Port1 | | Port2 | | | +-----+ +-------+ +-------+ +-------+ | | ^ ^ ^ | | | | | | | +-------+ +------+ +-------+ | | | AFU | | AFU | | AFU | | | +-------+ +------+ +-------+ | | | | DFL based FPGA PCIe Device | +---------------------------------------------------+h]hX +-------------------------------+ +-------------+ | PF | | VF | +-------------------------------+ +-------------+ ^ ^ ^ ^ | | | | +-----|------------|---------|--------------|-------+ | | | | | | | +-----+ +-------+ +-------+ +-------+ | | | FME | | Port0 | | Port1 | | Port2 | | | +-----+ +-------+ +-------+ +-------+ | | ^ ^ ^ | | | | | | | +-------+ +------+ +-------+ | | | AFU | | AFU | | AFU | | | +-------+ +------+ +-------+ | | | | DFL based FPGA PCIe Device | +---------------------------------------------------+W}hjT sbah}(h]h ]h"]h$]h&]jjuh1jhhhMhj' hhubh)}(h:FME is always accessed through the physical function (PF).h]h:FME is always accessed through the physical function (PF).}(hjb hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj' hhubh)}(hX!Ports (and related AFUs) are accessed via PF by default, but could be exposed through virtual function (VF) devices via PCIe SRIOV. Each VF only contains 1 Port and 1 AFU for isolation. Users could assign individual VFs (accelerators) created via PCIe SRIOV interface, to virtual machines.h]hX!Ports (and related AFUs) are accessed via PF by default, but could be exposed through virtual function (VF) devices via PCIe SRIOV. Each VF only contains 1 Port and 1 AFU for isolation. Users could assign individual VFs (accelerators) created via PCIe SRIOV interface, to virtual machines.}(hjp hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj' hhubh)}(hGThe driver organization in virtualization case is illustrated below: ::h]hDThe driver organization in virtualization case is illustrated below:}(hj~ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj' hhubj)}(hX +-------++------++------+ | | FME || FME || FME | | | FPGA || FPGA || FPGA | | |Manager||Bridge||Region| | +-------++------++------+ | +-----------------------+ +--------+ | +--------+ | FME | | AFU | | | AFU | | Module | | Module | | | Module | +-----------------------+ +--------+ | +--------+ +-----------------------+ | +-----------------------+ | FPGA Container Device | | | FPGA Container Device | | (FPGA Base Region) | | | (FPGA Base Region) | +-----------------------+ | +-----------------------+ +------------------+ | +------------------+ | FPGA PCIE Module | | Virtual | FPGA PCIE Module | +------------------+ Host | Machine +------------------+ -------------------------------------- | ------------------------------ +---------------+ | +---------------+ | PCI PF Device | | | PCI VF Device | +---------------+ | +---------------+h]hX +-------++------++------+ | | FME || FME || FME | | | FPGA || FPGA || FPGA | | |Manager||Bridge||Region| | +-------++------++------+ | +-----------------------+ +--------+ | +--------+ | FME | | AFU | | | AFU | | Module | | Module | | | Module | +-----------------------+ +--------+ | +--------+ +-----------------------+ | +-----------------------+ | FPGA Container Device | | | FPGA Container Device | | (FPGA Base Region) | | | (FPGA Base Region) | +-----------------------+ | +-----------------------+ +------------------+ | +------------------+ | FPGA PCIE Module | | Virtual | FPGA PCIE Module | +------------------+ Host | Machine +------------------+ -------------------------------------- | ------------------------------ +---------------+ | +---------------+ | PCI PF Device | | | PCI VF Device | +---------------+ | +---------------+}hj sbah}(h]h ]h"]h$]h&]jjuh1jhhhMhj' hhubh)}(haFPGA PCIe device driver is always loaded first once an FPGA PCIe PF or VF device is detected. It:h]haFPGA PCIe device driver is always loaded first once an FPGA PCIe PF or VF device is detected. It:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj' hhubh)}(hhh](h)}(hcFinishes enumeration on both FPGA PCIe PF and VF device using common interfaces from DFL framework.h]h)}(hcFinishes enumeration on both FPGA PCIe PF and VF device using common interfaces from DFL framework.h]hcFinishes enumeration on both FPGA PCIe PF and VF device using common interfaces from DFL framework.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(hSupports SRIOV. h]h)}(hSupports SRIOV.h]hSupports SRIOV.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhMhj' hhubh)}(hThe FME device driver plays a management role in this driver architecture, it provides ioctls to release Port from PF and assign Port to PF. After release a port from PF, then it's safe to expose this port through a VF via PCIe SRIOV sysfs interface.h]hThe FME device driver plays a management role in this driver architecture, it provides ioctls to release Port from PF and assign Port to PF. After release a port from PF, then it’s safe to expose this port through a VF via PCIe SRIOV sysfs interface.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj' hhubh)}(hTo enable accessing an accelerator from applications running in a VM, the respective AFU's port needs to be assigned to a VF using the following steps:h]hTo enable accessing an accelerator from applications running in a VM, the respective AFU’s port needs to be assigned to a VF using the following steps:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj' hhubj )}(hhh](h)}(hThe PF owns all AFU ports by default. Any port that needs to be reassigned to a VF must first be released through the DFL_FPGA_FME_PORT_RELEASE ioctl on the FME device. h]h)}(hThe PF owns all AFU ports by default. Any port that needs to be reassigned to a VF must first be released through the DFL_FPGA_FME_PORT_RELEASE ioctl on the FME device.h]hThe PF owns all AFU ports by default. Any port that needs to be reassigned to a VF must first be released through the DFL_FPGA_FME_PORT_RELEASE ioctl on the FME device.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(hOnce N ports are released from PF, then user can use command below to enable SRIOV and VFs. Each VF owns only one Port with AFU. :: echo N > $PCI_DEVICE_PATH/sriov_numvfs h](h)}(hOnce N ports are released from PF, then user can use command below to enable SRIOV and VFs. Each VF owns only one Port with AFU.h]hOnce N ports are released from PF, then user can use command below to enable SRIOV and VFs. Each VF owns only one Port with AFU.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubj)}(h&echo N > $PCI_DEVICE_PATH/sriov_numvfsh]h&echo N > $PCI_DEVICE_PATH/sriov_numvfs}hj* sbah}(h]h ]h"]h$]h&]jjuh1jhhhMhj ubeh}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(hPass through the VFs to VMs h]h)}(hPass through the VFs to VMsh]hPass through the VFs to VMs}(hjB hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj> ubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(h^The AFU under VF is accessible from applications in VM (using the same driver inside the VF). h]h)}(h]The AFU under VF is accessible from applications in VM (using the same driver inside the VF).h]h]The AFU under VF is accessible from applications in VM (using the same driver inside the VF).}(hjZ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjV ubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubeh}(h]h ]h"]h$]h&]j arabicj hj .uh1j hj' hhhhhMubh)}(hqNote that an FME can't be assigned to a VF, thus PR and other management functions are only available via the PF.h]hsNote that an FME can’t be assigned to a VF, thus PR and other management functions are only available via the PF.}(hjv hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj' hhubeh}(h]fpga-virtualization-pcie-sriovah ]h"] fpga virtualization - pcie sriovah$]h&]uh1hhhhhhhhMuubh)}(hhh](h)}(hDevice enumerationh]hDevice enumeration}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMubh)}(hyThis section introduces how applications enumerate the fpga device from the sysfs hierarchy under /sys/class/fpga_region.h]hyThis section introduces how applications enumerate the fpga device from the sysfs hierarchy under /sys/class/fpga_region.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(h~In the example below, two DFL based FPGA devices are installed in the host. Each fpga device has one FME and two ports (AFUs).h]h~In the example below, two DFL based FPGA devices are installed in the host. Each fpga device has one FME and two ports (AFUs).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(h8FPGA regions are created under /sys/class/fpga_region/::h]h7FPGA regions are created under /sys/class/fpga_region/:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(h`/sys/class/fpga_region/region0 /sys/class/fpga_region/region1 /sys/class/fpga_region/region2 ...h]h`/sys/class/fpga_region/region0 /sys/class/fpga_region/region1 /sys/class/fpga_region/region2 ...}hj sbah}(h]h ]h"]h$]h&]jjuh1jhhhMhj hhubh)}(hApplication needs to search each regionX folder, if feature device is found, (e.g. "dfl-port.n" or "dfl-fme.m" is found), then it's the base fpga region which represents the FPGA device.h]hApplication needs to search each regionX folder, if feature device is found, (e.g. “dfl-port.n” or “dfl-fme.m” is found), then it’s the base fpga region which represents the FPGA device.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hDEach base region has one FME and two ports (AFUs) as child devices::h]hCEach base region has one FME and two ports (AFUs) as child devices:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(hX/sys/class/fpga_region/region0/dfl-fme.0 /sys/class/fpga_region/region0/dfl-port.0 /sys/class/fpga_region/region0/dfl-port.1 ... /sys/class/fpga_region/region3/dfl-fme.1 /sys/class/fpga_region/region3/dfl-port.2 /sys/class/fpga_region/region3/dfl-port.3 ...h]hX/sys/class/fpga_region/region0/dfl-fme.0 /sys/class/fpga_region/region0/dfl-port.0 /sys/class/fpga_region/region0/dfl-port.1 ... /sys/class/fpga_region/region3/dfl-fme.1 /sys/class/fpga_region/region3/dfl-port.2 /sys/class/fpga_region/region3/dfl-port.3 ...}hj sbah}(h]h ]h"]h$]h&]jjuh1jhhhMhj hhubh)}(h?In general, the FME/AFU sysfs interfaces are named as follows::h]h>In general, the FME/AFU sysfs interfaces are named as follows:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(h\/sys/class/fpga_region/// /sys/class/fpga_region///h]h\/sys/class/fpga_region/// /sys/class/fpga_region///}hj sbah}(h]h ]h"]h$]h&]jjuh1jhhhMhj hhubh)}(hTwith 'n' consecutively numbering all FMEs and 'm' consecutively numbering all ports.h]h\with ‘n’ consecutively numbering all FMEs and ‘m’ consecutively numbering all ports.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hGThe device nodes used for ioctl() or mmap() can be referenced through::h]hFThe device nodes used for ioctl() or mmap() can be referenced through:}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(hb/sys/class/fpga_region///dev /sys/class/fpga_region///devh]hb/sys/class/fpga_region///dev /sys/class/fpga_region///dev}hj7sbah}(h]h ]h"]h$]h&]jjuh1jhhhMhj hhubeh}(h]device-enumerationah ]h"]device enumerationah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hPerformance Countersh]hPerformance Counters}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjMhhhhhMubh)}(hXPerformance reporting is one private feature implemented in FME. It could supports several independent, system-wide, device counter sets in hardware to monitor and count for performance events, including "basic", "cache", "fabric", "vtd" and "vtd_sip" counters. Users could use standard perf tool to monitor FPGA cache hit/miss rate, transaction number, interface clock counter of AFU and other FPGA performance events.h]hXPerformance reporting is one private feature implemented in FME. It could supports several independent, system-wide, device counter sets in hardware to monitor and count for performance events, including “basic”, “cache”, “fabric”, “vtd” and “vtd_sip” counters. Users could use standard perf tool to monitor FPGA cache hit/miss rate, transaction number, interface clock counter of AFU and other FPGA performance events.}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjMhhubh)}(hDifferent FPGA devices may have different counter sets, depending on hardware implementation. E.g., some discrete FPGA cards don't have any cache. User could use "perf list" to check which perf events are supported by target hardware.h]hDifferent FPGA devices may have different counter sets, depending on hardware implementation. E.g., some discrete FPGA cards don’t have any cache. User could use “perf list” to check which perf events are supported by target hardware.}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjMhhubh)}(hIn order to allow user to use standard perf API to access these performance counters, driver creates a perf PMU, and related sysfs interfaces in /sys/bus/event_source/devices/dfl_fme* to describe available perf events and configuration options.h]hIn order to allow user to use standard perf API to access these performance counters, driver creates a perf PMU, and related sysfs interfaces in /sys/bus/event_source/devices/dfl_fme* to describe available perf events and configuration options.}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjMhhubh)}(hXOThe "format" directory describes the format of the config field of struct perf_event_attr. There are 3 bitfields for config: "evtype" defines which type the perf event belongs to; "event" is the identity of the event within its category; "portid" is introduced to decide counters set to monitor on FPGA overall data or a specific port.h]hX_The “format” directory describes the format of the config field of struct perf_event_attr. There are 3 bitfields for config: “evtype” defines which type the perf event belongs to; “event” is the identity of the event within its category; “portid” is introduced to decide counters set to monitor on FPGA overall data or a specific port.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjMhhubh)}(hXXThe "events" directory describes the configuration templates for all available events which can be used with perf tool directly. For example, fab_mmio_read has the configuration "event=0x06,evtype=0x02,portid=0xff", which shows this event belongs to fabric type (0x02), the local event id is 0x06 and it is for overall monitoring (portid=0xff).h]hX`The “events” directory describes the configuration templates for all available events which can be used with perf tool directly. For example, fab_mmio_read has the configuration “event=0x06,evtype=0x02,portid=0xff”, which shows this event belongs to fabric type (0x02), the local event id is 0x06 and it is for overall monitoring (portid=0xff).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjMhhubh)}(hExample usage of perf::h]hExample usage of perf:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjMhhubj)}(hXt$# perf list |grep dfl_fme dfl_fme0/fab_mmio_read/ [Kernel PMU event] <...> dfl_fme0/fab_port_mmio_read,portid=?/ [Kernel PMU event] <...> $# perf stat -a -e dfl_fme0/fab_mmio_read/ or $# perf stat -a -e dfl_fme0/event=0x06,evtype=0x02,portid=0xff/ or $# perf stat -a -e dfl_fme0/config=0xff2006/ h]hXt$# perf list |grep dfl_fme dfl_fme0/fab_mmio_read/ [Kernel PMU event] <...> dfl_fme0/fab_port_mmio_read,portid=?/ [Kernel PMU event] <...> $# perf stat -a -e dfl_fme0/fab_mmio_read/ or $# perf stat -a -e dfl_fme0/event=0x06,evtype=0x02,portid=0xff/ or $# perf stat -a -e dfl_fme0/config=0xff2006/ }hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhM hjMhhubh)}(hAnother example, fab_port_mmio_read monitors mmio read of a specific port. So its configuration template is "event=0x06,evtype=0x01,portid=?". The portid should be explicitly set.h]hAnother example, fab_port_mmio_read monitors mmio read of a specific port. So its configuration template is “event=0x06,evtype=0x01,portid=?”. The portid should be explicitly set.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM-hjMhhubh)}(hIts usage of perf::h]hIts usage of perf:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM1hjMhhubj)}(h$# perf stat -a -e dfl_fme0/fab_port_mmio_read,portid=0x0/ or $# perf stat -a -e dfl_fme0/event=0x06,evtype=0x02,portid=0x0/ or $# perf stat -a -e dfl_fme0/config=0x2006/ h]h$# perf stat -a -e dfl_fme0/fab_port_mmio_read,portid=0x0/ or $# perf stat -a -e dfl_fme0/event=0x06,evtype=0x02,portid=0x0/ or $# perf stat -a -e dfl_fme0/config=0x2006/ }hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhM3hjMhhubh)}(hX6Please note for fabric counters, overall perf events (fab_*) and port perf events (fab_port_*) actually share one set of counters in hardware, so it can't monitor both at the same time. If this set of counters is configured to monitor overall data, then per port perf data is not supported. See below example::h]hX7Please note for fabric counters, overall perf events (fab_*) and port perf events (fab_port_*) actually share one set of counters in hardware, so it can’t monitor both at the same time. If this set of counters is configured to monitor overall data, then per port perf data is not supported. See below example:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM9hjMhhubj)}(hXM$# perf stat -e dfl_fme0/fab_mmio_read/,dfl_fme0/fab_port_mmio_write,\ portid=0/ sleep 1 Performance counter stats for 'system wide': 3 dfl_fme0/fab_mmio_read/ dfl_fme0/fab_port_mmio_write,portid=0x0/ 1.001750904 seconds time elapsedh]hXM$# perf stat -e dfl_fme0/fab_mmio_read/,dfl_fme0/fab_port_mmio_write,\ portid=0/ sleep 1 Performance counter stats for 'system wide': 3 dfl_fme0/fab_mmio_read/ dfl_fme0/fab_port_mmio_write,portid=0x0/ 1.001750904 seconds time elapsed}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhM>hjMhhubh)}(hThe driver also provides a "cpumask" sysfs attribute, which contains only one CPU id used to access these perf events. Counting on multiple CPU is not allowed since they are system-wide counters on FPGA device.h]hThe driver also provides a “cpumask” sysfs attribute, which contains only one CPU id used to access these perf events. Counting on multiple CPU is not allowed since they are system-wide counters on FPGA device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMHhjMhhubh)}(hNThe current driver does not support sampling. So "perf record" is unsupported.h]hRThe current driver does not support sampling. So “perf record” is unsupported.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMLhjMhhubeh}(h]performance-countersah ]h"]performance countersah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hInterrupt supporth]hInterrupt support}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj*hhhhhMPubh)}(hX4Some FME and AFU private features are able to generate interrupts. As mentioned above, users could call ioctl (DFL_FPGA_*_GET_IRQ_NUM) to know whether or how many interrupts are supported for this private feature. Drivers also implement an eventfd based interrupt handling mechanism for users to get notified when interrupt happens. Users could set eventfds to driver via ioctl (DFL_FPGA_*_SET_IRQ), and then poll/select on these eventfds waiting for notification. In Current DFL, 3 sub features (Port error, FME global error and AFU interrupt) support interrupts.h]hX4Some FME and AFU private features are able to generate interrupts. As mentioned above, users could call ioctl (DFL_FPGA_*_GET_IRQ_NUM) to know whether or how many interrupts are supported for this private feature. Drivers also implement an eventfd based interrupt handling mechanism for users to get notified when interrupt happens. Users could set eventfds to driver via ioctl (DFL_FPGA_*_SET_IRQ), and then poll/select on these eventfds waiting for notification. In Current DFL, 3 sub features (Port error, FME global error and AFU interrupt) support interrupts.}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMQhj*hhubeh}(h]interrupt-supportah ]h"]interrupt supportah$]h&]uh1hhhhhhhhMPubh)}(hhh](h)}(hAdd new FIUs supporth]hAdd new FIUs support}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhjQhhhhhM]ubh)}(hXIt's possible that developers made some new function blocks (FIUs) under this DFL framework, then new platform device driver needs to be developed for the new feature dev (FIU) following the same way as existing feature dev drivers (e.g. FME and Port/AFU platform device driver). Besides that, it requires modification on DFL framework enumeration code too, for new FIU type detection and related platform devices creation.h]hXIt’s possible that developers made some new function blocks (FIUs) under this DFL framework, then new platform device driver needs to be developed for the new feature dev (FIU) following the same way as existing feature dev drivers (e.g. FME and Port/AFU platform device driver). Besides that, it requires modification on DFL framework enumeration code too, for new FIU type detection and related platform devices creation.}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM^hjQhhubeh}(h]add-new-fius-supportah ]h"]add new fius supportah$]h&]uh1hhhhhhhhM]ubh)}(hhh](h)}(h Add new private features supporth]h Add new private features support}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjxhhhhhMgubh)}(hXIn some cases, we may need to add some new private features to existing FIUs (e.g. FME or Port). Developers don't need to touch enumeration code in DFL framework, as each private feature will be parsed automatically and related mmio resources can be found under FIU platform device created by DFL framework. Developer only needs to provide a sub feature driver with matched feature id. FME Partial Reconfiguration Sub Feature driver (see drivers/fpga/dfl-fme-pr.c) could be a reference.h]hXIn some cases, we may need to add some new private features to existing FIUs (e.g. FME or Port). Developers don’t need to touch enumeration code in DFL framework, as each private feature will be parsed automatically and related mmio resources can be found under FIU platform device created by DFL framework. Developer only needs to provide a sub feature driver with matched feature id. FME Partial Reconfiguration Sub Feature driver (see drivers/fpga/dfl-fme-pr.c) could be a reference.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhhjxhhubh)}(hPlease refer to below link to existing feature id table and guide for new feature ids application. https://github.com/OPAE/dfl-feature-idh](hcPlease refer to below link to existing feature id table and guide for new feature ids application. }(hjhhhNhNubh)}(h&https://github.com/OPAE/dfl-feature-idh]h&https://github.com/OPAE/dfl-feature-id}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhMphjxhhubeh}(h] add-new-private-features-supportah ]h"] add new private features supportah$]h&]uh1hhhhhhhhMgubh)}(hhh](h)}(h Location of DFLs on a PCI Deviceh]h Location of DFLs on a PCI Device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMvubh)}(hXThe original method for finding a DFL on a PCI device assumed the start of the first DFL to offset 0 of bar 0. If the first node of the DFL is an FME, then further DFLs in the port(s) are specified in FME header registers. Alternatively, a PCIe vendor specific capability structure can be used to specify the location of all the DFLs on the device, providing flexibility for the type of starting node in the DFL. Intel has reserved the VSEC ID of 0x43 for this purpose. The vendor specific data begins with a 4 byte vendor specific register for the number of DFLs followed 4 byte Offset/BIR vendor specific registers for each DFL. Bits 2:0 of Offset/BIR register indicates the BAR, and bits 31:3 form the 8 byte aligned offset where bits 2:0 are zero. ::h]hXThe original method for finding a DFL on a PCI device assumed the start of the first DFL to offset 0 of bar 0. If the first node of the DFL is an FME, then further DFLs in the port(s) are specified in FME header registers. Alternatively, a PCIe vendor specific capability structure can be used to specify the location of all the DFLs on the device, providing flexibility for the type of starting node in the DFL. Intel has reserved the VSEC ID of 0x43 for this purpose. The vendor specific data begins with a 4 byte vendor specific register for the number of DFLs followed 4 byte Offset/BIR vendor specific registers for each DFL. Bits 2:0 of Offset/BIR register indicates the BAR, and bits 31:3 form the 8 byte aligned offset where bits 2:0 are zero.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMwhjhhubj)}(hX +----------------------------+ |31 Number of DFLS 0| +----------------------------+ |31 Offset 3|2 BIR 0| +----------------------------+ . . . +----------------------------+ |31 Offset 3|2 BIR 0| +----------------------------+h]hX +----------------------------+ |31 Number of DFLS 0| +----------------------------+ |31 Offset 3|2 BIR 0| +----------------------------+ . . . +----------------------------+ |31 Offset 3|2 BIR 0| +----------------------------+}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhMhjhhubh)}(hBeing able to specify more than one DFL per BAR has been considered, but it was determined the use case did not provide value. Specifying a single DFL per BAR simplifies the implementation and allows for extra error checking.h]hBeing able to specify more than one DFL per BAR has been considered, but it was determined the use case did not provide value. Specifying a single DFL per BAR simplifies the implementation and allows for extra error checking.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h] location-of-dfls-on-a-pci-deviceah ]h"] location of dfls on a pci deviceah$]h&]uh1hhhhhhhhMvubh)}(hhh](h)}(h(Userspace driver support for DFL devicesh]h(Userspace driver support for DFL devices}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hXThe purpose of an FPGA is to be reprogrammed with newly developed hardware components. New hardware can instantiate a new private feature in the DFL, and then present a DFL device in the system. In some cases users may need a userspace driver for the DFL device:h]hXThe purpose of an FPGA is to be reprogrammed with newly developed hardware components. New hardware can instantiate a new private feature in the DFL, and then present a DFL device in the system. In some cases users may need a userspace driver for the DFL device:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hhh](h)}(h>Users may need to run some diagnostic test for their hardware.h]h)}(hj#h]h>Users may need to run some diagnostic test for their hardware.}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj!ubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h4Users may prototype the kernel driver in user space.h]h)}(hj:h]h4Users may prototype the kernel driver in user space.}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj8ubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hmSome hardware is designed for specific purposes and does not fit into one of the standard kernel subsystems. h]h)}(hlSome hardware is designed for specific purposes and does not fit into one of the standard kernel subsystems.h]hlSome hardware is designed for specific purposes and does not fit into one of the standard kernel subsystems.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjOubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhMhjhhubh)}(hThis requires direct access to MMIO space and interrupt handling from userspace. The uio_dfl module exposes the UIO device interfaces for this purpose.h]hThis requires direct access to MMIO space and interrupt handling from userspace. The uio_dfl module exposes the UIO device interfaces for this purpose.}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hCurrently the uio_dfl driver only supports the Ether Group sub feature, which has no irq in hardware. So the interrupt handling is not added in this driver.h]hCurrently the uio_dfl driver only supports the Ether Group sub feature, which has no irq in hardware. So the interrupt handling is not added in this driver.}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hUIO_DFL should be selected to enable the uio_dfl module driver. To support a new DFL feature via UIO direct access, its feature id should be added to the driver's id_table.h]hUIO_DFL should be selected to enable the uio_dfl module driver. To support a new DFL feature via UIO direct access, its feature id should be added to the driver’s id_table.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h](userspace-driver-support-for-dfl-devicesah ]h"](userspace driver support for dfl devicesah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hOpen discussionh]hOpen discussion}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hFME driver exports one ioctl (DFL_FPGA_FME_PORT_PR) for partial reconfiguration to user now. In the future, if unified user interfaces for reconfiguration are added, FME driver should switch to them from ioctl interface.h]hFME driver exports one ioctl (DFL_FPGA_FME_PORT_PR) for partial reconfiguration to user now. In the future, if unified user interfaces for reconfiguration are added, FME driver should switch to them from ioctl interface.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]open-discussionah ]h"]open discussionah$]h&]uh1hhhhhhhhMubeh}(h]/fpga-device-feature-list-dfl-framework-overviewah ]h"]1fpga device feature list (dfl) framework overviewah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jjjj jjjjj j j7 j4 jF jC j j j$ j! j j jJjGj'j$jNjKjujrjjjjjjjju nametypes}(jjjjj j7 jF j j$ j jJj'jNjujjjjuh}(jhj jjjjjj jj4 j jC j: j jI j! j j j' jGj j$jMjKj*jrjQjjxjjjjjju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]hsystem_message)}(hhh]h)}(hfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.h]hhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjUubah}(h]h ]h"]h$]h&]levelKtypeINFOlineMsourcehuh1jShj' hhhhhMubatransform_messages] transformerN include_log] decorationNhhub.