€•Œsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ4/translations/zh_CN/driver-api/crypto/iaa/iaa-crypto”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/zh_TW/driver-api/crypto/iaa/iaa-crypto”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/it_IT/driver-api/crypto/iaa/iaa-crypto”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/ja_JP/driver-api/crypto/iaa/iaa-crypto”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/ko_KR/driver-api/crypto/iaa/iaa-crypto”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/pt_BR/driver-api/crypto/iaa/iaa-crypto”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/sp_SP/driver-api/crypto/iaa/iaa-crypto”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)�”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…”�”}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒN/var/lib/git/docbuild/linux/Documentation/driver-api/crypto/iaa/iaa-crypto.rst”h´KubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒ)IAA Compression Accelerator Crypto Driver”h]”hŒ)IAA Compression Accelerator Crypto Driver”…”�”}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ paragraph”“”)�”}”(hŒ)Tom Zanussi ”h]”(hŒ Tom Zanussi <”…”�”}”(hhßh²hh³Nh´NubhŒ reference”“”)�”}”(hŒtom.zanussi@linux.intel.com”h]”hŒtom.zanussi@linux.intel.com”…”�”}”(hhéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œ"mailto:tom.zanussi@linux.intel.com”uh1hçhhßubhŒ>”…”�”}”(hhßh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÞ)�”}”(hŒÊThe IAA crypto driver supports compression/decompression compatible with the DEFLATE compression standard described in RFC 1951, which is the compression/decompression algorithm exported by this module.”h]”hŒÊThe IAA crypto driver supports compression/decompression compatible with the DEFLATE compression standard described in RFC 1951, which is the compression/decompression algorithm exported by this module.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K hhÊh²hubhÞ)�”}”(hŒ(The IAA hardware spec can be found here:”h]”hŒ(The IAA hardware spec can be found here:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K hhÊh²hubhŒ block_quote”“”)�”}”(hŒ1https://cdrdv2.intel.com/v1/dl/getContent/721858 ”h]”hÞ)�”}”(hŒ0https://cdrdv2.intel.com/v1/dl/getContent/721858”h]”hè)�”}”(hj'h]”hŒ0https://cdrdv2.intel.com/v1/dl/getContent/721858”…”�”}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j'uh1hçhj%ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khj!ubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´KhhÊh²hubhÞ)�”}”(hŒoThe iaa_crypto driver is designed to work as a layer underneath higher-level compression devices such as zswap.”h]”hŒoThe iaa_crypto driver is designed to work as a layer underneath higher-level compression devices such as zswap.”…”�”}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÞ)�”}”(hŒ¶Users can select IAA compress/decompress acceleration by specifying one of the supported IAA compression algorithms in whatever facility allows compression algorithms to be selected.”h]”hŒ¶Users can select IAA compress/decompress acceleration by specifying one of the supported IAA compression algorithms in whatever facility allows compression algorithms to be selected.”…”�”}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÞ)�”}”(hŒ…For example, a zswap device can select the IAA 'fixed' mode represented by selecting the 'deflate-iaa' crypto compression algorithm::”h]”hŒŒFor example, a zswap device can select the IAA ‘fixed’ mode represented by selecting the ‘deflate-iaa’ crypto compression algorithm:”…”�”}”(hj_h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhŒ literal_block”“”)�”}”(hŒ<# echo deflate-iaa > /sys/module/zswap/parameters/compressor”h]”hŒ<# echo deflate-iaa > /sys/module/zswap/parameters/compressor”…”�”}”hjosbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´KhhÊh²hubhÞ)�”}”(hŒaThis will tell zswap to use the IAA 'fixed' compression mode for all compresses and decompresses.”h]”hŒeThis will tell zswap to use the IAA ‘fixed’ compression mode for all compresses and decompresses.”…”�”}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÞ)�”}”(hŒGCurrently, there is only one compression modes available, 'fixed' mode.”h]”hŒKCurrently, there is only one compression modes available, ‘fixed’ mode.”…”�”}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K!hhÊh²hubhÞ)�”}”(hXòThe 'fixed' compression mode implements the compression scheme specified by RFC 1951 and is given the crypto algorithm name 'deflate-iaa'. (Because the IAA hardware has a 4k history-window limitation, only buffers <= 4k, or that have been compressed using a <= 4k history window, are technically compliant with the deflate spec, which allows for a window of up to 32k. Because of this limitation, the IAA fixed mode deflate algorithm is given its own algorithm name rather than simply 'deflate').”h]”hXþThe ‘fixed’ compression mode implements the compression scheme specified by RFC 1951 and is given the crypto algorithm name ‘deflate-iaa’. (Because the IAA hardware has a 4k history-window limitation, only buffers <= 4k, or that have been compressed using a <= 4k history window, are technically compliant with the deflate spec, which allows for a window of up to 32k. Because of this limitation, the IAA fixed mode deflate algorithm is given its own algorithm name rather than simply ‘deflate’).”…”�”}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K$hhÊh²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒConfig options and other setup”h]”hŒConfig options and other setup”…”�”}”(hjªh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj§h²hh³hÇh´K/ubhÞ)�”}”(hŒLThe IAA crypto driver is available via menuconfig using the following path::”h]”hŒKThe IAA crypto driver is available via menuconfig using the following path:”…”�”}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K1hj§h²hubjn)�”}”(hŒ`Cryptographic API -> Hardware crypto devices -> Support for Intel(R) IAA Compression Accelerator”h]”hŒ`Cryptographic API -> Hardware crypto devices -> Support for Intel(R) IAA Compression Accelerator”…”�”}”hjÆsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´K4hj§h²hubhÞ)�”}”(hŒIIn the configuration file the option called CONFIG_CRYPTO_DEV_IAA_CRYPTO.”h]”hŒIIn the configuration file the option called CONFIG_CRYPTO_DEV_IAA_CRYPTO.”…”�”}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K6hj§h²hubhÞ)�”}”(hŒmThe IAA crypto driver also supports statistics, which are available via menuconfig using the following path::”h]”hŒlThe IAA crypto driver also supports statistics, which are available via menuconfig using the following path:”…”�”}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K8hj§h²hubjn)�”}”(hŒŽCryptographic API -> Hardware crypto devices -> Support for Intel(R) IAA Compression -> Enable Intel(R) IAA Compression Accelerator Statistics”h]”hŒŽCryptographic API -> Hardware crypto devices -> Support for Intel(R) IAA Compression -> Enable Intel(R) IAA Compression Accelerator Statistics”…”�”}”hjðsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´K;hj§h²hubhÞ)�”}”(hŒOIn the configuration file the option called CONFIG_CRYPTO_DEV_IAA_CRYPTO_STATS.”h]”hŒOIn the configuration file the option called CONFIG_CRYPTO_DEV_IAA_CRYPTO_STATS.”…”�”}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K=hj§h²hubhÞ)�”}”(hŒ5The following config options should also be enabled::”h]”hŒ4The following config options should also be enabled:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K?hj§h²hubjn)�”}”(hŒ¡CONFIG_IRQ_REMAP=y CONFIG_INTEL_IOMMU=y CONFIG_INTEL_IOMMU_SVM=y CONFIG_PCI_ATS=y CONFIG_PCI_PRI=y CONFIG_PCI_PASID=y CONFIG_INTEL_IDXD=m CONFIG_INTEL_IDXD_SVM=y”h]”hŒ¡CONFIG_IRQ_REMAP=y CONFIG_INTEL_IOMMU=y CONFIG_INTEL_IOMMU_SVM=y CONFIG_PCI_ATS=y CONFIG_PCI_PRI=y CONFIG_PCI_PASID=y CONFIG_INTEL_IDXD=m CONFIG_INTEL_IDXD_SVM=y”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´KAhj§h²hubhÞ)�”}”(hŒÄIAA is one of the first Intel accelerator IPs that can work in conjunction with the Intel IOMMU. There are multiple modes that exist for testing. Based on IOMMU configuration, there are 3 modes::”h]”hŒÃIAA is one of the first Intel accelerator IPs that can work in conjunction with the Intel IOMMU. There are multiple modes that exist for testing. Based on IOMMU configuration, there are 3 modes:”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KJhj§h²hubjn)�”}”(hŒ- Scalable - Legacy - No IOMMU”h]”hŒ- Scalable - Legacy - No IOMMU”…”�”}”hj6sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´KNhj§h²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ Scalable mode”h]”hŒ Scalable mode”…”�”}”(hjGh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjDh²hh³hÇh´KTubhÞ)�”}”(hŒqScalable mode supports Shared Virtual Memory (SVM or SVA). It is entered when using the kernel boot commandline::”h]”hŒpScalable mode supports Shared Virtual Memory (SVM or SVA). It is entered when using the kernel boot commandline:”…”�”}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KVhjDh²hubjn)�”}”(hŒintel_iommu=on,sm_on”h]”hŒintel_iommu=on,sm_on”…”�”}”hjcsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´KYhjDh²hubhÞ)�”}”(hŒwith VT-d turned on in BIOS.”h]”hŒwith VT-d turned on in BIOS.”…”�”}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K[hjDh²hubhÞ)�”}”(hŒOWith scalable mode, both shared and dedicated workqueues are available for use.”h]”hŒOWith scalable mode, both shared and dedicated workqueues are available for use.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K]hjDh²hubhÞ)�”}”(hŒBFor scalable mode, the following BIOS settings should be enabled::”h]”hŒAFor scalable mode, the following BIOS settings should be enabled:”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K`hjDh²hubjn)�”}”(hŒ©Socket Configuration > IIO Configuration > Intel VT for Directed I/O (VT-d) > Intel VT for Directed I/O Socket Configuration > IIO Configuration > PCIe ENQCMD > ENQCMDS”h]”hŒ©Socket Configuration > IIO Configuration > Intel VT for Directed I/O (VT-d) > Intel VT for Directed I/O Socket Configuration > IIO Configuration > PCIe ENQCMD > ENQCMDS”…”�”}”hj›sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´KbhjDh²hubeh}”(h]”Œ scalable-mode”ah ]”h"]”Œ scalable mode”ah$]”h&]”uh1hÈhj§h²hh³hÇh´KTubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ Legacy mode”h]”hŒ Legacy mode”…”�”}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj±h²hh³hÇh´KhubhÞ)�”}”(hŒ?Legacy mode is entered when using the kernel boot commandline::”h]”hŒ>Legacy mode is entered when using the kernel boot commandline:”…”�”}”(hjÂh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kjhj±h²hubjn)�”}”(hŒintel_iommu=off”h]”hŒintel_iommu=off”…”�”}”hjÐsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´Klhj±h²hubhÞ)�”}”(hŒ!or VT-d is not turned on in BIOS.”h]”hŒ!or VT-d is not turned on in BIOS.”…”�”}”(hjÞh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Knhj±h²hubhÞ)�”}”(hŒ¨If you have booted into Linux and not sure if VT-d is on, do a "dmesg | grep -i dmar". If you don't see a number of DMAR devices enumerated, most likely VT-d is not on.”h]”hŒ®If you have booted into Linux and not sure if VT-d is on, do a “dmesg | grep -i dmarâ€�. If you don’t see a number of DMAR devices enumerated, most likely VT-d is not on.”…”�”}”(hjìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kphj±h²hubhÞ)�”}”(hŒBWith legacy mode, only dedicated workqueues are available for use.”h]”hŒBWith legacy mode, only dedicated workqueues are available for use.”…”�”}”(hjúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kthj±h²hubeh}”(h]”Œ legacy-mode”ah ]”h"]”Œ legacy mode”ah$]”h&]”uh1hÈhj§h²hh³hÇh´KhubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ No IOMMU mode”h]”hŒ No IOMMU mode”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´KxubhÞ)�”}”(hŒANo IOMMU mode is entered when using the kernel boot commandline::”h]”hŒ@No IOMMU mode is entered when using the kernel boot commandline:”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kzhjh²hubjn)�”}”(hŒ iommu=off.”h]”hŒ iommu=off.”…”�”}”hj/sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´K|hjh²hubhÞ)�”}”(hŒDWith no IOMMU mode, only dedicated workqueues are available for use.”h]”hŒDWith no IOMMU mode, only dedicated workqueues are available for use.”…”�”}”(hj=h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K~hjh²hubeh}”(h]”Œ no-iommu-mode”ah ]”h"]”Œ no iommu mode”ah$]”h&]”uh1hÈhj§h²hh³hÇh´Kxubeh}”(h]”Œconfig-options-and-other-setup”ah ]”h"]”Œconfig options and other setup”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K/ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒUsage”h]”hŒUsage”…”�”}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj[h²hh³hÇh´K‚ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ accel-config”h]”hŒ accel-config”…”�”}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjlh²hh³hÇh´K…ubhÞ)�”}”(hXžWhen loaded, the iaa_crypto driver automatically creates a default configuration and enables it, and assigns default driver attributes. If a different configuration or set of driver attributes is required, the user must first disable the IAA devices and workqueues, reset the configuration, and then re-register the deflate-iaa algorithm with the crypto subsystem by removing and reinserting the iaa_crypto module.”h]”hXžWhen loaded, the iaa_crypto driver automatically creates a default configuration and enables it, and assigns default driver attributes. If a different configuration or set of driver attributes is required, the user must first disable the IAA devices and workqueues, reset the configuration, and then re-register the deflate-iaa algorithm with the crypto subsystem by removing and reinserting the iaa_crypto module.”…”�”}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K‡hjlh²hubhÞ)�”}”(hŒpThe :ref:`iaa_disable_script` in the 'Use Cases' section below can be used to disable the default configuration.”h]”(hŒThe ”…”�”}”(hj‹h²hh³Nh´Nubh)�”}”(hŒ:ref:`iaa_disable_script`”h]”hŒinline”“”)�”}”(hj•h]”hŒiaa_disable_script”…”�”}”(hj™h²hh³Nh´Nubah}”(h]”h ]”(Œxref”Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j—hj“ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œ driver-api/crypto/iaa/iaa-crypto”Œ refdomain”j¤Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆŒ reftarget”Œiaa_disable_script”uh1hh³hÇh´KŽhj‹ubhŒW in the ‘Use Cases’ section below can be used to disable the default configuration.”…”�”}”(hj‹h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KŽhjlh²hubhÞ)�”}”(hŒMSee :ref:`iaa_default_config` below for details of the default configuration.”h]”(hŒSee ”…”�”}”(hjÂh²hh³Nh´Nubh)�”}”(hŒ:ref:`iaa_default_config`”h]”j˜)�”}”(hjÌh]”hŒiaa_default_config”…”�”}”(hjÎh²hh³Nh´Nubah}”(h]”h ]”(j£Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j—hjÊubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j°Œ refdomain”jØŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj¶Œiaa_default_config”uh1hh³hÇh´K‘hjÂubhŒ0 below for details of the default configuration.”…”�”}”(hjÂh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K‘hjlh²hubhÞ)�”}”(hŒÏMore likely than not, however, and because of the complexity and configurability of the accelerator devices, the user will want to configure the device and manually enable the desired devices and workqueues.”h]”hŒÏMore likely than not, however, and because of the complexity and configurability of the accelerator devices, the user will want to configure the device and manually enable the desired devices and workqueues.”…”�”}”(hjôh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K”hjlh²hubhÞ)�”}”(hX™The userspace tool to help doing that is called accel-config. Using accel-config to configure device or loading a previously saved config is highly recommended. The device can be controlled via sysfs directly but comes with the warning that you should do this ONLY if you know exactly what you are doing. The following sections will not cover the sysfs interface but assumes you will be using accel-config.”h]”hX™The userspace tool to help doing that is called accel-config. Using accel-config to configure device or loading a previously saved config is highly recommended. The device can be controlled via sysfs directly but comes with the warning that you should do this ONLY if you know exactly what you are doing. The following sections will not cover the sysfs interface but assumes you will be using accel-config.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K™hjlh²hubhÞ)�”}”(hŒyThe :ref:`iaa_sysfs_config` section in the appendix below can be consulted for the sysfs interface details if interested.”h]”(hŒThe ”…”�”}”(hjh²hh³Nh´Nubh)�”}”(hŒ:ref:`iaa_sysfs_config`”h]”j˜)�”}”(hjh]”hŒiaa_sysfs_config”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”(j£Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j—hjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j°Œ refdomain”j&Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj¶Œiaa_sysfs_config”uh1hh³hÇh´K hjubhŒ^ section in the appendix below can be consulted for the sysfs interface details if interested.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K hjlh²hubhÞ)�”}”(hŒPThe accel-config tool along with instructions for building it can be found here:”h]”hŒPThe accel-config tool along with instructions for building it can be found here:”…”�”}”(hjBh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K£hjlh²hubj )�”}”(hŒ-https://github.com/intel/idxd-config/#readme ”h]”hÞ)�”}”(hŒ,https://github.com/intel/idxd-config/#readme”h]”hè)�”}”(hjVh]”hŒ,https://github.com/intel/idxd-config/#readme”…”�”}”(hjXh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”jVuh1hçhjTubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¦hjPubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´K¦hjlh²hubeh}”(h]”Œ accel-config”ah ]”h"]”Œ accel-config”ah$]”h&]”uh1hÈhj[h²hh³hÇh´K…ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ Typical usage”h]”hŒ Typical usage”…”�”}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjzh²hh³hÇh´K©ubhÞ)�”}”(hŒ³In order for the iaa_crypto module to actually do any compression/decompression work on behalf of a facility, one or more IAA workqueues need to be bound to the iaa_crypto driver.”h]”hŒ³In order for the iaa_crypto module to actually do any compression/decompression work on behalf of a facility, one or more IAA workqueues need to be bound to the iaa_crypto driver.”…”�”}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K«hjzh²hubhÞ)�”}”(hŒöFor instance, here's an example of configuring an IAA workqueue and binding it to the iaa_crypto driver (note that device names are specified as 'iax' rather than 'iaa' - this is because upstream still has the old 'iax' device naming in place) ::”h]”hXFor instance, here’s an example of configuring an IAA workqueue and binding it to the iaa_crypto driver (note that device names are specified as ‘iax’ rather than ‘iaa’ - this is because upstream still has the old ‘iax’ device naming in place)”…”�”}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¯hjzh²hubjn)�”}”(hXR# configure wq1.0 accel-config config-wq --group-id=0 --mode=dedicated --type=kernel --priority=10 --name="iaa_crypto" --driver-name="crypto" iax1/wq1.0 accel-config config-engine iax1/engine1.0 --group-id=0 # enable IAA device iax1 accel-config enable-device iax1 # enable wq1.0 on IAX device iax1 accel-config enable-wq iax1/wq1.0”h]”hXR# configure wq1.0 accel-config config-wq --group-id=0 --mode=dedicated --type=kernel --priority=10 --name="iaa_crypto" --driver-name="crypto" iax1/wq1.0 accel-config config-engine iax1/engine1.0 --group-id=0 # enable IAA device iax1 accel-config enable-device iax1 # enable wq1.0 on IAX device iax1 accel-config enable-wq iax1/wq1.0”…”�”}”hj§sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´K´hjzh²hubhÞ)�”}”(hXãWhenever a new workqueue is bound to or unbound from the iaa_crypto driver, the available workqueues are 'rebalanced' such that work submitted from a particular CPU is given to the most appropriate workqueue available. Current best practice is to configure and bind at least one workqueue for each IAA device, but as long as there is at least one workqueue configured and bound to any IAA device in the system, the iaa_crypto driver will work, albeit most likely not as efficiently.”h]”hXçWhenever a new workqueue is bound to or unbound from the iaa_crypto driver, the available workqueues are ‘rebalanced’ such that work submitted from a particular CPU is given to the most appropriate workqueue available. Current best practice is to configure and bind at least one workqueue for each IAA device, but as long as there is at least one workqueue configured and bound to any IAA device in the system, the iaa_crypto driver will work, albeit most likely not as efficiently.”…”�”}”(hjµh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÂhjzh²hubhÞ)�”}”(hŒ¾The IAA crypto algorigthms is operational and compression and decompression operations are fully enabled following the successful binding of the first IAA workqueue to the iaa_crypto driver.”h]”hŒ¾The IAA crypto algorigthms is operational and compression and decompression operations are fully enabled following the successful binding of the first IAA workqueue to the iaa_crypto driver.”…”�”}”(hjÃh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KËhjzh²hubhÞ)�”}”(hŒ»Similarly, the IAA crypto algorithm is not operational and compression and decompression operations are disabled following the unbinding of the last IAA worqueue to the iaa_crypto driver.”h]”hŒ»Similarly, the IAA crypto algorithm is not operational and compression and decompression operations are disabled following the unbinding of the last IAA worqueue to the iaa_crypto driver.”…”�”}”(hjÑh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÏhjzh²hubhÞ)�”}”(hŒ‘As a result, the IAA crypto algorithms and thus the IAA hardware are only available when one or more workques are bound to the iaa_crypto driver.”h]”hŒ‘As a result, the IAA crypto algorithms and thus the IAA hardware are only available when one or more workques are bound to the iaa_crypto driver.”…”�”}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÓhjzh²hubhÞ)�”}”(hŒ{When there are no IAA workqueues bound to the driver, the IAA crypto algorithms can be unregistered by removing the module.”h]”hŒ{When there are no IAA workqueues bound to the driver, the IAA crypto algorithms can be unregistered by removing the module.”…”�”}”(hjíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K×hjzh²hubeh}”(h]”Œ typical-usage”ah ]”h"]”Œ typical usage”ah$]”h&]”uh1hÈhj[h²hh³hÇh´K©ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒDriver attributes”h]”hŒDriver attributes”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´KÜubhÞ)�”}”(hX&There are a couple user-configurable driver attributes that can be used to configure various modes of operation. They're listed below, along with their default values. To set any of these attributes, echo the appropriate values to the attribute file located under /sys/bus/dsa/drivers/crypto/”h]”hX(There are a couple user-configurable driver attributes that can be used to configure various modes of operation. They’re listed below, along with their default values. To set any of these attributes, echo the appropriate values to the attribute file located under /sys/bus/dsa/drivers/crypto/”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÞhjh²hubhÞ)�”}”(hŒ¸The attribute settings at the time the IAA algorithms are registered are captured in each algorithm's crypto_ctx and used for all compresses and decompresses when using that algorithm.”h]”hŒºThe attribute settings at the time the IAA algorithms are registered are captured in each algorithm’s crypto_ctx and used for all compresses and decompresses when using that algorithm.”…”�”}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kähjh²hubhÞ)�”}”(hŒThe available attributes are:”h]”hŒThe available attributes are:”…”�”}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kèhjh²hubj )�”}”(hX› - verify_compress Toggle compression verification. If set, each compress will be internally decompressed and the contents verified, returning error codes if unsuccessful. This can be toggled with 0/1:: echo 0 > /sys/bus/dsa/drivers/crypto/verify_compress The default setting is '1' - verify all compresses. - sync_mode Select mode to be used to wait for completion of each compresses and decompress operation. The crypto async interface support implemented by iaa_crypto provides an implementation that satisfies the interface but does so in a synchronous manner - it fills and submits the IDXD descriptor and then loops around waiting for it to complete before returning. This isn't a problem at the moment, since all existing callers (e.g. zswap) wrap any asynchronous callees in a synchronous wrapper anyway. The iaa_crypto driver does however provide true asynchronous support for callers that can make use of it. In this mode, it fills and submits the IDXD descriptor, then returns immediately with -EINPROGRESS. The caller can then either poll for completion itself, which requires specific code in the caller which currently nothing in the upstream kernel implements, or go to sleep and wait for an interrupt signaling completion. This latter mode is supported by current users in the kernel such as zswap via synchronous wrappers. Although it is supported this mode is significantly slower than the synchronous mode that does the polling in the iaa_crypto driver previously mentioned. This mode can be enabled by writing 'async_irq' to the sync_mode iaa_crypto driver attribute:: echo async_irq > /sys/bus/dsa/drivers/crypto/sync_mode Async mode without interrupts (caller must poll) can be enabled by writing 'async' to it (please see Caveat):: echo async > /sys/bus/dsa/drivers/crypto/sync_mode The mode that does the polling in the iaa_crypto driver can be enabled by writing 'sync' to it:: echo sync > /sys/bus/dsa/drivers/crypto/sync_mode The default mode is 'sync'. Caveat: since the only mechanism that iaa_crypto currently implements for async polling without interrupts is via the 'sync' mode as described earlier, writing 'async' to '/sys/bus/dsa/drivers/crypto/sync_mode' will internally enable the 'sync' mode. This is to ensure correct iaa_crypto behavior until true async polling without interrupts is enabled in iaa_crypto. ”h]”hŒ bullet_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hX8verify_compress Toggle compression verification. If set, each compress will be internally decompressed and the contents verified, returning error codes if unsuccessful. This can be toggled with 0/1:: echo 0 > /sys/bus/dsa/drivers/crypto/verify_compress The default setting is '1' - verify all compresses. ”h]”(hÞ)�”}”(hŒverify_compress”h]”hŒverify_compress”…”�”}”(hjMh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KêhjIubhÞ)�”}”(hŒ¹Toggle compression verification. If set, each compress will be internally decompressed and the contents verified, returning error codes if unsuccessful. This can be toggled with 0/1::”h]”hŒ¸Toggle compression verification. If set, each compress will be internally decompressed and the contents verified, returning error codes if unsuccessful. This can be toggled with 0/1:”…”�”}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KìhjIubjn)�”}”(hŒ4echo 0 > /sys/bus/dsa/drivers/crypto/verify_compress”h]”hŒ4echo 0 > /sys/bus/dsa/drivers/crypto/verify_compress”…”�”}”hjisbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´KðhjIubhÞ)�”}”(hŒ3The default setting is '1' - verify all compresses.”h]”hŒ7The default setting is ‘1’ - verify all compresses.”…”�”}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KòhjIubeh}”(h]”h ]”h"]”h$]”h&]”uh1jGhjDubjH)�”}”(hX sync_mode Select mode to be used to wait for completion of each compresses and decompress operation. The crypto async interface support implemented by iaa_crypto provides an implementation that satisfies the interface but does so in a synchronous manner - it fills and submits the IDXD descriptor and then loops around waiting for it to complete before returning. This isn't a problem at the moment, since all existing callers (e.g. zswap) wrap any asynchronous callees in a synchronous wrapper anyway. The iaa_crypto driver does however provide true asynchronous support for callers that can make use of it. In this mode, it fills and submits the IDXD descriptor, then returns immediately with -EINPROGRESS. The caller can then either poll for completion itself, which requires specific code in the caller which currently nothing in the upstream kernel implements, or go to sleep and wait for an interrupt signaling completion. This latter mode is supported by current users in the kernel such as zswap via synchronous wrappers. Although it is supported this mode is significantly slower than the synchronous mode that does the polling in the iaa_crypto driver previously mentioned. This mode can be enabled by writing 'async_irq' to the sync_mode iaa_crypto driver attribute:: echo async_irq > /sys/bus/dsa/drivers/crypto/sync_mode Async mode without interrupts (caller must poll) can be enabled by writing 'async' to it (please see Caveat):: echo async > /sys/bus/dsa/drivers/crypto/sync_mode The mode that does the polling in the iaa_crypto driver can be enabled by writing 'sync' to it:: echo sync > /sys/bus/dsa/drivers/crypto/sync_mode The default mode is 'sync'. Caveat: since the only mechanism that iaa_crypto currently implements for async polling without interrupts is via the 'sync' mode as described earlier, writing 'async' to '/sys/bus/dsa/drivers/crypto/sync_mode' will internally enable the 'sync' mode. This is to ensure correct iaa_crypto behavior until true async polling without interrupts is enabled in iaa_crypto. ”h]”(hÞ)�”}”(hŒ sync_mode”h]”hŒ sync_mode”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kôhj‹ubhÞ)�”}”(hŒZSelect mode to be used to wait for completion of each compresses and decompress operation.”h]”hŒZSelect mode to be used to wait for completion of each compresses and decompress operation.”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Köhj‹ubhÞ)�”}”(hX’The crypto async interface support implemented by iaa_crypto provides an implementation that satisfies the interface but does so in a synchronous manner - it fills and submits the IDXD descriptor and then loops around waiting for it to complete before returning. This isn't a problem at the moment, since all existing callers (e.g. zswap) wrap any asynchronous callees in a synchronous wrapper anyway.”h]”hX”The crypto async interface support implemented by iaa_crypto provides an implementation that satisfies the interface but does so in a synchronous manner - it fills and submits the IDXD descriptor and then loops around waiting for it to complete before returning. This isn’t a problem at the moment, since all existing callers (e.g. zswap) wrap any asynchronous callees in a synchronous wrapper anyway.”…”�”}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kùhj‹ubhÞ)�”}”(hX¬The iaa_crypto driver does however provide true asynchronous support for callers that can make use of it. In this mode, it fills and submits the IDXD descriptor, then returns immediately with -EINPROGRESS. The caller can then either poll for completion itself, which requires specific code in the caller which currently nothing in the upstream kernel implements, or go to sleep and wait for an interrupt signaling completion. This latter mode is supported by current users in the kernel such as zswap via synchronous wrappers. Although it is supported this mode is significantly slower than the synchronous mode that does the polling in the iaa_crypto driver previously mentioned.”h]”hX¬The iaa_crypto driver does however provide true asynchronous support for callers that can make use of it. In this mode, it fills and submits the IDXD descriptor, then returns immediately with -EINPROGRESS. The caller can then either poll for completion itself, which requires specific code in the caller which currently nothing in the upstream kernel implements, or go to sleep and wait for an interrupt signaling completion. This latter mode is supported by current users in the kernel such as zswap via synchronous wrappers. Although it is supported this mode is significantly slower than the synchronous mode that does the polling in the iaa_crypto driver previously mentioned.”…”�”}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhj‹ubhÞ)�”}”(hŒ^This mode can be enabled by writing 'async_irq' to the sync_mode iaa_crypto driver attribute::”h]”hŒaThis mode can be enabled by writing ‘async_irq’ to the sync_mode iaa_crypto driver attribute:”…”�”}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M hj‹ubjn)�”}”(hŒ6echo async_irq > /sys/bus/dsa/drivers/crypto/sync_mode”h]”hŒ6echo async_irq > /sys/bus/dsa/drivers/crypto/sync_mode”…”�”}”hjÕsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´Mhj‹ubhÞ)�”}”(hŒnAsync mode without interrupts (caller must poll) can be enabled by writing 'async' to it (please see Caveat)::”h]”hŒqAsync mode without interrupts (caller must poll) can be enabled by writing ‘async’ to it (please see Caveat):”…”�”}”(hjãh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhj‹ubjn)�”}”(hŒ2echo async > /sys/bus/dsa/drivers/crypto/sync_mode”h]”hŒ2echo async > /sys/bus/dsa/drivers/crypto/sync_mode”…”�”}”hjñsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´Mhj‹ubhÞ)�”}”(hŒ`The mode that does the polling in the iaa_crypto driver can be enabled by writing 'sync' to it::”h]”hŒcThe mode that does the polling in the iaa_crypto driver can be enabled by writing ‘sync’ to it:”…”�”}”(hjÿh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhj‹ubjn)�”}”(hŒ1echo sync > /sys/bus/dsa/drivers/crypto/sync_mode”h]”hŒ1echo sync > /sys/bus/dsa/drivers/crypto/sync_mode”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´Mhj‹ubhÞ)�”}”(hŒThe default mode is 'sync'.”h]”hŒThe default mode is ‘sync’.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhj‹ubhÞ)�”}”(hXnCaveat: since the only mechanism that iaa_crypto currently implements for async polling without interrupts is via the 'sync' mode as described earlier, writing 'async' to '/sys/bus/dsa/drivers/crypto/sync_mode' will internally enable the 'sync' mode. This is to ensure correct iaa_crypto behavior until true async polling without interrupts is enabled in iaa_crypto.”h]”hX~Caveat: since the only mechanism that iaa_crypto currently implements for async polling without interrupts is via the ‘sync’ mode as described earlier, writing ‘async’ to ‘/sys/bus/dsa/drivers/crypto/sync_mode’ will internally enable the ‘sync’ mode. This is to ensure correct iaa_crypto behavior until true async polling without interrupts is enabled in iaa_crypto.”…”�”}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhj‹ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jGhjDubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jBh³hÇh´Kêhj>ubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÇh´Kêhjh²hubhŒtarget”“”)�”}”(hŒ.. _iaa_default_config:”h]”h}”(h]”h ]”h"]”h$]”h&]”Œrefid”Œiaa-default-config”uh1jKh´M%hjh²hh³hÇubeh}”(h]”Œdriver-attributes”ah ]”h"]”Œdriver attributes”ah$]”h&]”uh1hÈhj[h²hh³hÇh´KÜubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒIAA Default Configuration”h]”hŒIAA Default Configuration”…”�”}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjah²hh³hÇh´M(ubhÞ)�”}”(hŒ€When the iaa_crypto driver is loaded, each IAA device has a single work queue configured for it, with the following attributes::”h]”hŒWhen the iaa_crypto driver is loaded, each IAA device has a single work queue configured for it, with the following attributes:”…”�”}”(hjrh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M*hjah²hubjn)�”}”(hŒámode "dedicated" threshold 0 size Total WQ Size from WQCAP priority 10 type IDXD_WQT_KERNEL group 0 name "iaa_crypto" driver_name "crypto"”h]”hŒámode "dedicated" threshold 0 size Total WQ Size from WQCAP priority 10 type IDXD_WQT_KERNEL group 0 name "iaa_crypto" driver_name "crypto"”…”�”}”hj€sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´M-hjah²hubhÞ)�”}”(hŒ~The devices and workqueues are also enabled and therefore the driver is ready to be used without any additional configuration.”h]”hŒ~The devices and workqueues are also enabled and therefore the driver is ready to be used without any additional configuration.”…”�”}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M6hjah²hubhÞ)�”}”(hŒGThe default driver attributes in effect when the driver is loaded are::”h]”hŒFThe default driver attributes in effect when the driver is loaded are:”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M9hjah²hubjn)�”}”(hŒ,sync_mode "sync" verify_compress 1”h]”hŒ,sync_mode "sync" verify_compress 1”…”�”}”hjªsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´M;hjah²hubhÞ)�”}”(hX—In order to change either the device/work queue or driver attributes, the enabled devices and workqueues must first be disabled. In order to have the new configuration applied to the deflate-iaa crypto algorithm, it needs to be re-registered by removing and reinserting the iaa_crypto module. The :ref:`iaa_disable_script` in the 'Use Cases' section below can be used to disable the default configuration.”h]”(hX+In order to change either the device/work queue or driver attributes, the enabled devices and workqueues must first be disabled. In order to have the new configuration applied to the deflate-iaa crypto algorithm, it needs to be re-registered by removing and reinserting the iaa_crypto module. The ”…”�”}”(hj¸h²hh³Nh´Nubh)�”}”(hŒ:ref:`iaa_disable_script`”h]”j˜)�”}”(hjÂh]”hŒiaa_disable_script”…”�”}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”(j£Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j—hjÀubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j°Œ refdomain”jÎŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj¶Œiaa_disable_script”uh1hh³hÇh´M>hj¸ubhŒW in the ‘Use Cases’ section below can be used to disable the default configuration.”…”�”}”(hj¸h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M>hjah²hubeh}”(h]”(Œiaa-default-configuration”jXeh ]”h"]”(Œiaa default configuration”Œiaa_default_config”eh$]”h&]”uh1hÈhj[h²hh³hÇh´M(Œexpect_referenced_by_name”}”jðjMsŒexpect_referenced_by_id”}”jXjMsubeh}”(h]”Œusage”ah ]”h"]”Œusage”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K‚ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ Statistics”h]”hŒ Statistics”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÿh²hh³hÇh´MFubhÞ)�”}”(hŒ‹If the optional debugfs statistics support is enabled, the IAA crypto driver will generate statistics which can be accessed in debugfs at::”h]”hŒŠIf the optional debugfs statistics support is enabled, the IAA crypto driver will generate statistics which can be accessed in debugfs at:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MHhjÿh²hubjn)�”}”(hX# ls -al /sys/kernel/debug/iaa-crypto/ total 0 drwxr-xr-x 2 root root 0 Mar 3 07:55 . drwx------ 53 root root 0 Mar 3 07:55 .. -rw-r--r-- 1 root root 0 Mar 3 07:55 global_stats -rw-r--r-- 1 root root 0 Mar 3 07:55 stats_reset -rw-r--r-- 1 root root 0 Mar 3 07:55 wq_stats”h]”hX# ls -al /sys/kernel/debug/iaa-crypto/ total 0 drwxr-xr-x 2 root root 0 Mar 3 07:55 . drwx------ 53 root root 0 Mar 3 07:55 .. -rw-r--r-- 1 root root 0 Mar 3 07:55 global_stats -rw-r--r-- 1 root root 0 Mar 3 07:55 stats_reset -rw-r--r-- 1 root root 0 Mar 3 07:55 wq_stats”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´MKhjÿh²hubhÞ)�”}”(hŒlThe global_stats file shows a set of global statistics collected since the driver has been loaded or reset::”h]”hŒkThe global_stats file shows a set of global statistics collected since the driver has been loaded or reset:”…”�”}”(hj,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MShjÿh²hubjn)�”}”(hX*# cat global_stats global stats: total_comp_calls: 4300 total_decomp_calls: 4164 total_sw_decomp_calls: 0 total_comp_bytes_out: 5993989 total_decomp_bytes_in: 5993989 total_completion_einval_errors: 0 total_completion_timeout_errors: 0 total_completion_comp_buf_overflow_errors: 136”h]”hX*# cat global_stats global stats: total_comp_calls: 4300 total_decomp_calls: 4164 total_sw_decomp_calls: 0 total_comp_bytes_out: 5993989 total_decomp_bytes_in: 5993989 total_completion_einval_errors: 0 total_completion_timeout_errors: 0 total_completion_comp_buf_overflow_errors: 136”…”�”}”hj:sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´MVhjÿh²hubhÞ)�”}”(hŒiThe wq_stats file shows per-wq stats, a set for each iaa device and wq in addition to some global stats::”h]”hŒhThe wq_stats file shows per-wq stats, a set for each iaa device and wq in addition to some global stats:”…”�”}”(hjHh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mahjÿh²hubjn)�”}”(hXy# cat wq_stats iaa device: id: 1 n_wqs: 1 comp_calls: 0 comp_bytes: 0 decomp_calls: 0 decomp_bytes: 0 wqs: name: iaa_crypto comp_calls: 0 comp_bytes: 0 decomp_calls: 0 decomp_bytes: 0 iaa device: id: 3 n_wqs: 1 comp_calls: 0 comp_bytes: 0 decomp_calls: 0 decomp_bytes: 0 wqs: name: iaa_crypto comp_calls: 0 comp_bytes: 0 decomp_calls: 0 decomp_bytes: 0 iaa device: id: 5 n_wqs: 1 comp_calls: 1360 comp_bytes: 1999776 decomp_calls: 0 decomp_bytes: 0 wqs: name: iaa_crypto comp_calls: 1360 comp_bytes: 1999776 decomp_calls: 0 decomp_bytes: 0 iaa device: id: 7 n_wqs: 1 comp_calls: 2940 comp_bytes: 3994213 decomp_calls: 4164 decomp_bytes: 5993989 wqs: name: iaa_crypto comp_calls: 2940 comp_bytes: 3994213 decomp_calls: 4164 decomp_bytes: 5993989 ...”h]”hXy# cat wq_stats iaa device: id: 1 n_wqs: 1 comp_calls: 0 comp_bytes: 0 decomp_calls: 0 decomp_bytes: 0 wqs: name: iaa_crypto comp_calls: 0 comp_bytes: 0 decomp_calls: 0 decomp_bytes: 0 iaa device: id: 3 n_wqs: 1 comp_calls: 0 comp_bytes: 0 decomp_calls: 0 decomp_bytes: 0 wqs: name: iaa_crypto comp_calls: 0 comp_bytes: 0 decomp_calls: 0 decomp_bytes: 0 iaa device: id: 5 n_wqs: 1 comp_calls: 1360 comp_bytes: 1999776 decomp_calls: 0 decomp_bytes: 0 wqs: name: iaa_crypto comp_calls: 1360 comp_bytes: 1999776 decomp_calls: 0 decomp_bytes: 0 iaa device: id: 7 n_wqs: 1 comp_calls: 2940 comp_bytes: 3994213 decomp_calls: 4164 decomp_bytes: 5993989 wqs: name: iaa_crypto comp_calls: 2940 comp_bytes: 3994213 decomp_calls: 4164 decomp_bytes: 5993989 ...”…”�”}”hjVsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´Mdhjÿh²hubhÞ)�”}”(hŒZWriting to 'stats_reset' resets all the stats, including the per-device and per-wq stats::”h]”hŒ]Writing to ‘stats_reset’ resets all the stats, including the per-device and per-wq stats:”…”�”}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mžhjÿh²hubjn)�”}”(hX# echo 1 > stats_reset # cat wq_stats global stats: total_comp_calls: 0 total_decomp_calls: 0 total_comp_bytes_out: 0 total_decomp_bytes_in: 0 total_completion_einval_errors: 0 total_completion_timeout_errors: 0 total_completion_comp_buf_overflow_errors: 0 ...”h]”hX# echo 1 > stats_reset # cat wq_stats global stats: total_comp_calls: 0 total_decomp_calls: 0 total_comp_bytes_out: 0 total_decomp_bytes_in: 0 total_completion_einval_errors: 0 total_completion_timeout_errors: 0 total_completion_comp_buf_overflow_errors: 0 ...”…”�”}”hjrsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´M¡hjÿh²hubeh}”(h]”Œ statistics”ah ]”h"]”Œ statistics”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´MFubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ Use cases”h]”hŒ Use cases”…”�”}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjˆh²hh³hÇh´M¯ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒSimple zswap test”h]”hŒSimple zswap test”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj™h²hh³hÇh´M²ubhÞ)�”}”(hŒ�For this example, the kernel should be configured according to the dedicated mode options described above, and zswap should be enabled as well::”h]”hŒ�For this example, the kernel should be configured according to the dedicated mode options described above, and zswap should be enabled as well:”…”�”}”(hjªh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M´hj™h²hubjn)�”}”(hŒCONFIG_ZSWAP=y”h]”hŒCONFIG_ZSWAP=y”…”�”}”hj¸sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´M¸hj™h²hubhÞ)�”}”(hXThis is a simple test that uses iaa_compress as the compressor for a swap (zswap) device. It sets up the zswap device and then uses the memory_memadvise program listed below to forcibly swap out and in a specified number of pages, demonstrating both compress and decompress.”h]”hXThis is a simple test that uses iaa_compress as the compressor for a swap (zswap) device. It sets up the zswap device and then uses the memory_memadvise program listed below to forcibly swap out and in a specified number of pages, demonstrating both compress and decompress.”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mºhj™h²hubhÞ)�”}”(hŒ¢The zswap test expects the work queues for each IAA device on the system to be configured properly as a kernel workqueue with a workqueue driver_name of "crypto".”h]”hŒ¦The zswap test expects the work queues for each IAA device on the system to be configured properly as a kernel workqueue with a workqueue driver_name of “cryptoâ€�.”…”�”}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M¿hj™h²hubhÞ)�”}”(hŒ@The first step is to make sure the iaa_crypto module is loaded::”h]”hŒ?The first step is to make sure the iaa_crypto module is loaded:”…”�”}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MÃhj™h²hubjn)�”}”(hŒmodprobe iaa_crypto”h]”hŒmodprobe iaa_crypto”…”�”}”hjðsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´MÅhj™h²hubhÞ)�”}”(hXIf the IAA devices and workqueues haven't previously been disabled and reconfigured, then the default configuration should be in place and no further IAA configuration is necessary. See :ref:`iaa_default_config` below for details of the default configuration.”h]”(hŒ½If the IAA devices and workqueues haven’t previously been disabled and reconfigured, then the default configuration should be in place and no further IAA configuration is necessary. See ”…”�”}”(hjþh²hh³Nh´Nubh)�”}”(hŒ:ref:`iaa_default_config`”h]”j˜)�”}”(hjh]”hŒiaa_default_config”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”(j£Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j—hjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j°Œ refdomain”jŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj¶Œiaa_default_config”uh1hh³hÇh´MÇhjþubhŒ0 below for details of the default configuration.”…”�”}”(hjþh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MÇhj™h²hubhÞ)�”}”(hŒ[If the default configuration is in place, you should see the iaa devices and wq0s enabled::”h]”hŒZIf the default configuration is in place, you should see the iaa devices and wq0s enabled:”…”�”}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MÌhj™h²hubjn)�”}”(hŒa# cat /sys/bus/dsa/devices/iax1/state enabled # cat /sys/bus/dsa/devices/iax1/wq1.0/state enabled”h]”hŒa# cat /sys/bus/dsa/devices/iax1/state enabled # cat /sys/bus/dsa/devices/iax1/wq1.0/state enabled”…”�”}”hj>sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´MÏhj™h²hubhÞ)�”}”(hŒmTo demonstrate that the following steps work as expected, these commands can be used to enable debug output::”h]”hŒlTo demonstrate that the following steps work as expected, these commands can be used to enable debug output:”…”�”}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MÔhj™h²hubjn)�”}”(hŒ�# echo -n 'module iaa_crypto +p' > /sys/kernel/debug/dynamic_debug/control # echo -n 'module idxd +p' > /sys/kernel/debug/dynamic_debug/control”h]”hŒ�# echo -n 'module iaa_crypto +p' > /sys/kernel/debug/dynamic_debug/control # echo -n 'module idxd +p' > /sys/kernel/debug/dynamic_debug/control”…”�”}”hjZsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´M×hj™h²hubhÞ)�”}”(hŒ,Use the following commands to enable zswap::”h]”hŒ+Use the following commands to enable zswap:”…”�”}”(hjhh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MÚhj™h²hubjn)�”}”(hX`# echo 0 > /sys/module/zswap/parameters/enabled # echo 50 > /sys/module/zswap/parameters/max_pool_percent # echo deflate-iaa > /sys/module/zswap/parameters/compressor # echo 1 > /sys/module/zswap/parameters/enabled # echo 100 > /proc/sys/vm/swappiness # echo never > /sys/kernel/mm/transparent_hugepage/enabled # echo 1 > /proc/sys/vm/overcommit_memory”h]”hX`# echo 0 > /sys/module/zswap/parameters/enabled # echo 50 > /sys/module/zswap/parameters/max_pool_percent # echo deflate-iaa > /sys/module/zswap/parameters/compressor # echo 1 > /sys/module/zswap/parameters/enabled # echo 100 > /proc/sys/vm/swappiness # echo never > /sys/kernel/mm/transparent_hugepage/enabled # echo 1 > /proc/sys/vm/overcommit_memory”…”�”}”hjvsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´MÜhj™h²hubhÞ)�”}”(hŒ¦Now you can now run the zswap workload you want to measure. For example, using the memory_memadvise code below, the following command will swap in and out 100 pages::”h]”hŒ¥Now you can now run the zswap workload you want to measure. For example, using the memory_memadvise code below, the following command will swap in and out 100 pages:”…”�”}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mähj™h²hubjn)�”}”(hŒƒ./memory_madvise 100 Allocating 100 pages to swap in/out Swapping out 100 pages Swapping in 100 pages Swapped out and in 100 pages”h]”hŒƒ./memory_madvise 100 Allocating 100 pages to swap in/out Swapping out 100 pages Swapping in 100 pages Swapped out and in 100 pages”…”�”}”hj’sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´Mèhj™h²hubhÞ)�”}”(hŒAYou should see something like the following in the dmesg output::”h]”hŒ@You should see something like the following in the dmesg output:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mïhj™h²hubjn)�”}”(hXÔ[ 404.202972] idxd 0000:e7:02.0: iaa_comp_acompress: dma_map_sg, src_addr 223925c000, nr_sgs 1, req->src 00000000ee7cb5e6, req->slen 4096, sg_dma_len(sg) 4096 [ 404.202973] idxd 0000:e7:02.0: iaa_comp_acompress: dma_map_sg, dst_addr 21dadf8000, nr_sgs 1, req->dst 000000008d6acea8, req->dlen 4096, sg_dma_len(sg) 8192 [ 404.202975] idxd 0000:e7:02.0: iaa_compress: desc->src1_addr 223925c000, desc->src1_size 4096, desc->dst_addr 21dadf8000, desc->max_dst_size 4096, desc->src2_addr 2203543000, desc->src2_size 1568 [ 404.202981] idxd 0000:e7:02.0: iaa_compress_verify: (verify) desc->src1_addr 21dadf8000, desc->src1_size 228, desc->dst_addr 223925c000, desc->max_dst_size 4096, desc->src2_addr 0, desc->src2_size 0 ...”h]”hXÔ[ 404.202972] idxd 0000:e7:02.0: iaa_comp_acompress: dma_map_sg, src_addr 223925c000, nr_sgs 1, req->src 00000000ee7cb5e6, req->slen 4096, sg_dma_len(sg) 4096 [ 404.202973] idxd 0000:e7:02.0: iaa_comp_acompress: dma_map_sg, dst_addr 21dadf8000, nr_sgs 1, req->dst 000000008d6acea8, req->dlen 4096, sg_dma_len(sg) 8192 [ 404.202975] idxd 0000:e7:02.0: iaa_compress: desc->src1_addr 223925c000, desc->src1_size 4096, desc->dst_addr 21dadf8000, desc->max_dst_size 4096, desc->src2_addr 2203543000, desc->src2_size 1568 [ 404.202981] idxd 0000:e7:02.0: iaa_compress_verify: (verify) desc->src1_addr 21dadf8000, desc->src1_size 228, desc->dst_addr 223925c000, desc->max_dst_size 4096, desc->src2_addr 0, desc->src2_size 0 ...”…”�”}”hj®sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´Mñhj™h²hubhÞ)�”}”(hŒžNow that basic functionality has been demonstrated, the defaults can be erased and replaced with a different configuration. To do that, first disable zswap::”h]”hŒ�Now that basic functionality has been demonstrated, the defaults can be erased and replaced with a different configuration. To do that, first disable zswap:”…”�”}”(hj¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M÷hj™h²hubjn)�”}”(hX# echo lzo > /sys/module/zswap/parameters/compressor # swapoff -a # echo 0 > /sys/module/zswap/parameters/accept_threshold_percent # echo 0 > /sys/module/zswap/parameters/max_pool_percent # echo 0 > /sys/module/zswap/parameters/enabled # echo 0 > /sys/module/zswap/parameters/enabled”h]”hX# echo lzo > /sys/module/zswap/parameters/compressor # swapoff -a # echo 0 > /sys/module/zswap/parameters/accept_threshold_percent # echo 0 > /sys/module/zswap/parameters/max_pool_percent # echo 0 > /sys/module/zswap/parameters/enabled # echo 0 > /sys/module/zswap/parameters/enabled”…”�”}”hjÊsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´Mûhj™h²hubhÞ)�”}”(hŒmThen run the :ref:`iaa_disable_script` in the 'Use Cases' section below to disable the default configuration.”h]”(hŒ Then run the ”…”�”}”(hjØh²hh³Nh´Nubh)�”}”(hŒ:ref:`iaa_disable_script`”h]”j˜)�”}”(hjâh]”hŒiaa_disable_script”…”�”}”(hjäh²hh³Nh´Nubah}”(h]”h ]”(j£Œstd”Œstd-ref”eh"]”h$]”h&]”uh1j—hjàubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j°Œ refdomain”jîŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj¶Œiaa_disable_script”uh1hh³hÇh´MhjØubhŒK in the ‘Use Cases’ section below to disable the default configuration.”…”�”}”(hjØh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhj™h²hubhÞ)�”}”(hŒFinally turn swap back on::”h]”hŒFinally turn swap back on:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhj™h²hubjn)�”}”(hŒ # swapon -a”h]”hŒ # swapon -a”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´Mhj™h²hubhÞ)�”}”(hŒ€Following all that the IAA device(s) can now be re-configured and enabled as desired for further testing. Below is one example.”h]”hŒ€Following all that the IAA device(s) can now be re-configured and enabled as desired for further testing. Below is one example.”…”�”}”(hj& h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M hj™h²hubhÞ)�”}”(hŒ¢The zswap test expects the work queues for each IAA device on the system to be configured properly as a kernel workqueue with a workqueue driver_name of "crypto".”h]”hŒ¦The zswap test expects the work queues for each IAA device on the system to be configured properly as a kernel workqueue with a workqueue driver_name of “cryptoâ€�.”…”�”}”(hj4 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M hj™h²hubhÞ)�”}”(hŒ*The below script automatically does that::”h]”hŒ)The below script automatically does that:”…”�”}”(hjB h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhj™h²hubjn)�”}”(hXÕ#!/bin/bash echo "IAA devices:" lspci -d:0cfe echo "# IAA devices:" lspci -d:0cfe | wc -l # # count iaa instances # iaa_dev_id="0cfe" num_iaa=$(lspci -d:${iaa_dev_id} | wc -l) echo "Found ${num_iaa} IAA instances" # # disable iaa wqs and devices # echo "Disable IAA" for ((i = 1; i < ${num_iaa} * 2; i += 2)); do echo disable wq iax${i}/wq${i}.0 accel-config disable-wq iax${i}/wq${i}.0 echo disable iaa iax${i} accel-config disable-device iax${i} done echo "End Disable IAA" echo "Reload iaa_crypto module" rmmod iaa_crypto modprobe iaa_crypto echo "End Reload iaa_crypto module" # # configure iaa wqs and devices # echo "Configure IAA" for ((i = 1; i < ${num_iaa} * 2; i += 2)); do accel-config config-wq --group-id=0 --mode=dedicated --wq-size=128 --priority=10 --type=kernel --name="iaa_crypto" --driver-name="crypto" iax${i}/wq${i}.0 accel-config config-engine iax${i}/engine${i}.0 --group-id=0 done echo "End Configure IAA" # # enable iaa wqs and devices # echo "Enable IAA" for ((i = 1; i < ${num_iaa} * 2; i += 2)); do echo enable iaa iax${i} accel-config enable-device iax${i} echo enable wq iax${i}/wq${i}.0 accel-config enable-wq iax${i}/wq${i}.0 done echo "End Enable IAA"”h]”hXÕ#!/bin/bash echo "IAA devices:" lspci -d:0cfe echo "# IAA devices:" lspci -d:0cfe | wc -l # # count iaa instances # iaa_dev_id="0cfe" num_iaa=$(lspci -d:${iaa_dev_id} | wc -l) echo "Found ${num_iaa} IAA instances" # # disable iaa wqs and devices # echo "Disable IAA" for ((i = 1; i < ${num_iaa} * 2; i += 2)); do echo disable wq iax${i}/wq${i}.0 accel-config disable-wq iax${i}/wq${i}.0 echo disable iaa iax${i} accel-config disable-device iax${i} done echo "End Disable IAA" echo "Reload iaa_crypto module" rmmod iaa_crypto modprobe iaa_crypto echo "End Reload iaa_crypto module" # # configure iaa wqs and devices # echo "Configure IAA" for ((i = 1; i < ${num_iaa} * 2; i += 2)); do accel-config config-wq --group-id=0 --mode=dedicated --wq-size=128 --priority=10 --type=kernel --name="iaa_crypto" --driver-name="crypto" iax${i}/wq${i}.0 accel-config config-engine iax${i}/engine${i}.0 --group-id=0 done echo "End Configure IAA" # # enable iaa wqs and devices # echo "Enable IAA" for ((i = 1; i < ${num_iaa} * 2; i += 2)); do echo enable iaa iax${i} accel-config enable-device iax${i} echo enable wq iax${i}/wq${i}.0 accel-config enable-wq iax${i}/wq${i}.0 done echo "End Enable IAA"”…”�”}”hjP sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´Mhj™h²hubhÞ)�”}”(hŒåWhen the workqueues are bound to the iaa_crypto driver, you should see something similar to the following in dmesg output if you've enabled debug output (echo -n 'module iaa_crypto +p' > /sys/kernel/debug/dynamic_debug/control)::”h]”hŒêWhen the workqueues are bound to the iaa_crypto driver, you should see something similar to the following in dmesg output if you’ve enabled debug output (echo -n ‘module iaa_crypto +p’ > /sys/kernel/debug/dynamic_debug/control):”…”�”}”(hj^ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MNhj™h²hubjn)�”}”(hXr[ 60.752344] idxd 0000:f6:02.0: add_iaa_wq: added wq 000000004068d14d to iaa 00000000c9585ba2, n_wq 1 [ 60.752346] iaa_crypto: rebalance_wq_table: nr_nodes=2, nr_cpus 160, nr_iaa 8, cpus_per_iaa 20 [ 60.752347] iaa_crypto: rebalance_wq_table: iaa=0 [ 60.752349] idxd 0000:6a:02.0: request_iaa_wq: getting wq from iaa_device 0000000042d7bc52 (0) [ 60.752350] idxd 0000:6a:02.0: request_iaa_wq: returning unused wq 00000000c8bb4452 (0) from iaa device 0000000042d7bc52 (0) [ 60.752352] iaa_crypto: rebalance_wq_table: assigned wq for cpu=0, node=0 = wq 00000000c8bb4452 [ 60.752354] iaa_crypto: rebalance_wq_table: iaa=0 [ 60.752355] idxd 0000:6a:02.0: request_iaa_wq: getting wq from iaa_device 0000000042d7bc52 (0) [ 60.752356] idxd 0000:6a:02.0: request_iaa_wq: returning unused wq 00000000c8bb4452 (0) from iaa device 0000000042d7bc52 (0) [ 60.752358] iaa_crypto: rebalance_wq_table: assigned wq for cpu=1, node=0 = wq 00000000c8bb4452 [ 60.752359] iaa_crypto: rebalance_wq_table: iaa=0 [ 60.752360] idxd 0000:6a:02.0: request_iaa_wq: getting wq from iaa_device 0000000042d7bc52 (0) [ 60.752361] idxd 0000:6a:02.0: request_iaa_wq: returning unused wq 00000000c8bb4452 (0) from iaa device 0000000042d7bc52 (0) [ 60.752362] iaa_crypto: rebalance_wq_table: assigned wq for cpu=2, node=0 = wq 00000000c8bb4452 [ 60.752364] iaa_crypto: rebalance_wq_table: iaa=0 . . .”h]”hXr[ 60.752344] idxd 0000:f6:02.0: add_iaa_wq: added wq 000000004068d14d to iaa 00000000c9585ba2, n_wq 1 [ 60.752346] iaa_crypto: rebalance_wq_table: nr_nodes=2, nr_cpus 160, nr_iaa 8, cpus_per_iaa 20 [ 60.752347] iaa_crypto: rebalance_wq_table: iaa=0 [ 60.752349] idxd 0000:6a:02.0: request_iaa_wq: getting wq from iaa_device 0000000042d7bc52 (0) [ 60.752350] idxd 0000:6a:02.0: request_iaa_wq: returning unused wq 00000000c8bb4452 (0) from iaa device 0000000042d7bc52 (0) [ 60.752352] iaa_crypto: rebalance_wq_table: assigned wq for cpu=0, node=0 = wq 00000000c8bb4452 [ 60.752354] iaa_crypto: rebalance_wq_table: iaa=0 [ 60.752355] idxd 0000:6a:02.0: request_iaa_wq: getting wq from iaa_device 0000000042d7bc52 (0) [ 60.752356] idxd 0000:6a:02.0: request_iaa_wq: returning unused wq 00000000c8bb4452 (0) from iaa device 0000000042d7bc52 (0) [ 60.752358] iaa_crypto: rebalance_wq_table: assigned wq for cpu=1, node=0 = wq 00000000c8bb4452 [ 60.752359] iaa_crypto: rebalance_wq_table: iaa=0 [ 60.752360] idxd 0000:6a:02.0: request_iaa_wq: getting wq from iaa_device 0000000042d7bc52 (0) [ 60.752361] idxd 0000:6a:02.0: request_iaa_wq: returning unused wq 00000000c8bb4452 (0) from iaa device 0000000042d7bc52 (0) [ 60.752362] iaa_crypto: rebalance_wq_table: assigned wq for cpu=2, node=0 = wq 00000000c8bb4452 [ 60.752364] iaa_crypto: rebalance_wq_table: iaa=0 . . .”…”�”}”hjl sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´MShj™h²hubhÞ)�”}”(hŒÓOnce the workqueues and devices have been enabled, the IAA crypto algorithms are enabled and available. When the IAA crypto algorithms have been successfully enabled, you should see the following dmesg output::”h]”hŒÒOnce the workqueues and devices have been enabled, the IAA crypto algorithms are enabled and available. When the IAA crypto algorithms have been successfully enabled, you should see the following dmesg output:”…”�”}”(hjz h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mfhj™h²hubjn)�”}”(hŒD[ 64.893759] iaa_crypto: iaa_crypto_enable: iaa_crypto now ENABLED”h]”hŒD[ 64.893759] iaa_crypto: iaa_crypto_enable: iaa_crypto now ENABLED”…”�”}”hjˆ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´Mkhj™h²hubhÞ)�”}”(hŒdNow run the following zswap-specific setup commands to have zswap use the 'fixed' compression mode::”h]”hŒgNow run the following zswap-specific setup commands to have zswap use the ‘fixed’ compression mode:”…”�”}”(hj– h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mmhj™h²hubjn)�”}”(hXSecho 0 > /sys/module/zswap/parameters/enabled echo 50 > /sys/module/zswap/parameters/max_pool_percent echo deflate-iaa > /sys/module/zswap/parameters/compressor echo 1 > /sys/module/zswap/parameters/enabled echo 100 > /proc/sys/vm/swappiness echo never > /sys/kernel/mm/transparent_hugepage/enabled echo 1 > /proc/sys/vm/overcommit_memory”h]”hXSecho 0 > /sys/module/zswap/parameters/enabled echo 50 > /sys/module/zswap/parameters/max_pool_percent echo deflate-iaa > /sys/module/zswap/parameters/compressor echo 1 > /sys/module/zswap/parameters/enabled echo 100 > /proc/sys/vm/swappiness echo never > /sys/kernel/mm/transparent_hugepage/enabled echo 1 > /proc/sys/vm/overcommit_memory”…”�”}”hj¤ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´Mphj™h²hubhÞ)�”}”(hŒšFinally, you can now run the zswap workload you want to measure. For example, using the code below, the following command will swap in and out 100 pages::”h]”hŒ™Finally, you can now run the zswap workload you want to measure. For example, using the code below, the following command will swap in and out 100 pages:”…”�”}”(hj² h²hh³Nh´Nubah}”(h]”h ]”•Yeh"]”h$]”h&]”uh1hÝh³hÇh´Myhj™h²hubjn)�”}”(hŒƒ./memory_madvise 100 Allocating 100 pages to swap in/out Swapping out 100 pages Swapping in 100 pages Swapped out and in 100 pages”h]”hŒƒ./memory_madvise 100 Allocating 100 pages to swap in/out Swapping out 100 pages Swapping in 100 pages Swapped out and in 100 pages”…”�”}”hjÀ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´M}hj™h²hubhÞ)�”}”(hŒ«You should see something like the following in the dmesg output if you've enabled debug output (echo -n 'module iaa_crypto +p' > /sys/kernel/debug/dynamic_debug/control)::”h]”hŒ°You should see something like the following in the dmesg output if you’ve enabled debug output (echo -n ‘module iaa_crypto +p’ > /sys/kernel/debug/dynamic_debug/control):”…”�”}”(hjÎ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M„hj™h²hubjn)�”}”(hXÌ[ 404.202972] idxd 0000:e7:02.0: iaa_comp_acompress: dma_map_sg, src_addr 223925c000, nr_sgs 1, req->src 00000000ee7cb5e6, req->slen 4096, sg_dma_len(sg) 4096 [ 404.202973] idxd 0000:e7:02.0: iaa_comp_acompress: dma_map_sg, dst_addr 21dadf8000, nr_sgs 1, req->dst 000000008d6acea8, req->dlen 4096, sg_dma_len(sg) 8192 [ 404.202975] idxd 0000:e7:02.0: iaa_compress: desc->src1_addr 223925c000, desc->src1_size 4096, desc->dst_addr 21dadf8000, desc->max_dst_size 4096, desc->src2_addr 2203543000, desc->src2_size 1568 [ 404.202981] idxd 0000:e7:02.0: iaa_compress_verify: (verify) desc->src1_addr 21dadf8000, desc->src1_size 228, desc->dst_addr 223925c000, desc->max_dst_size 4096, desc->src2_addr 0, desc->src2_size 0 [ 409.203227] idxd 0000:e7:02.0: iaa_comp_adecompress: dma_map_sg, src_addr 21ddd8b100, nr_sgs 1, req->src 0000000084adab64, req->slen 228, sg_dma_len(sg) 228 [ 409.203235] idxd 0000:e7:02.0: iaa_comp_adecompress: dma_map_sg, dst_addr 21ee3dc000, nr_sgs 1, req->dst 000000004e2990d0, req->dlen 4096, sg_dma_len(sg) 4096 [ 409.203239] idxd 0000:e7:02.0: iaa_decompress: desc->src1_addr 21ddd8b100, desc->src1_size 228, desc->dst_addr 21ee3dc000, desc->max_dst_size 4096, desc->src2_addr 0, desc->src2_size 0 [ 409.203254] idxd 0000:e7:02.0: iaa_comp_adecompress: dma_map_sg, src_addr 21ddd8b100, nr_sgs 1, req->src 0000000084adab64, req->slen 228, sg_dma_len(sg) 228 [ 409.203256] idxd 0000:e7:02.0: iaa_comp_adecompress: dma_map_sg, dst_addr 21f1551000, nr_sgs 1, req->dst 000000004e2990d0, req->dlen 4096, sg_dma_len(sg) 4096 [ 409.203257] idxd 0000:e7:02.0: iaa_decompress: desc->src1_addr 21ddd8b100, desc->src1_size 228, desc->dst_addr 21f1551000, desc->max_dst_size 4096, desc->src2_addr 0, desc->src2_size 0”h]”hXÌ[ 404.202972] idxd 0000:e7:02.0: iaa_comp_acompress: dma_map_sg, src_addr 223925c000, nr_sgs 1, req->src 00000000ee7cb5e6, req->slen 4096, sg_dma_len(sg) 4096 [ 404.202973] idxd 0000:e7:02.0: iaa_comp_acompress: dma_map_sg, dst_addr 21dadf8000, nr_sgs 1, req->dst 000000008d6acea8, req->dlen 4096, sg_dma_len(sg) 8192 [ 404.202975] idxd 0000:e7:02.0: iaa_compress: desc->src1_addr 223925c000, desc->src1_size 4096, desc->dst_addr 21dadf8000, desc->max_dst_size 4096, desc->src2_addr 2203543000, desc->src2_size 1568 [ 404.202981] idxd 0000:e7:02.0: iaa_compress_verify: (verify) desc->src1_addr 21dadf8000, desc->src1_size 228, desc->dst_addr 223925c000, desc->max_dst_size 4096, desc->src2_addr 0, desc->src2_size 0 [ 409.203227] idxd 0000:e7:02.0: iaa_comp_adecompress: dma_map_sg, src_addr 21ddd8b100, nr_sgs 1, req->src 0000000084adab64, req->slen 228, sg_dma_len(sg) 228 [ 409.203235] idxd 0000:e7:02.0: iaa_comp_adecompress: dma_map_sg, dst_addr 21ee3dc000, nr_sgs 1, req->dst 000000004e2990d0, req->dlen 4096, sg_dma_len(sg) 4096 [ 409.203239] idxd 0000:e7:02.0: iaa_decompress: desc->src1_addr 21ddd8b100, desc->src1_size 228, desc->dst_addr 21ee3dc000, desc->max_dst_size 4096, desc->src2_addr 0, desc->src2_size 0 [ 409.203254] idxd 0000:e7:02.0: iaa_comp_adecompress: dma_map_sg, src_addr 21ddd8b100, nr_sgs 1, req->src 0000000084adab64, req->slen 228, sg_dma_len(sg) 228 [ 409.203256] idxd 0000:e7:02.0: iaa_comp_adecompress: dma_map_sg, dst_addr 21f1551000, nr_sgs 1, req->dst 000000004e2990d0, req->dlen 4096, sg_dma_len(sg) 4096 [ 409.203257] idxd 0000:e7:02.0: iaa_decompress: desc->src1_addr 21ddd8b100, desc->src1_size 228, desc->dst_addr 21f1551000, desc->max_dst_size 4096, desc->src2_addr 0, desc->src2_size 0”…”�”}”hjÜ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´Mˆhj™h²hubhÞ)�”}”(hŒÅIn order to unregister the IAA crypto algorithms, and register new ones using different parameters, any users of the current algorithm should be stopped and the IAA workqueues and devices disabled.”h]”hŒÅIn order to unregister the IAA crypto algorithms, and register new ones using different parameters, any users of the current algorithm should be stopped and the IAA workqueues and devices disabled.”…”�”}”(hjê h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M“hj™h²hubhÞ)�”}”(hŒ„In the case of zswap, remove the IAA crypto algorithm as the compressor and turn off swap (to remove all references to iaa_crypto)::”h]”hŒƒIn the case of zswap, remove the IAA crypto algorithm as the compressor and turn off swap (to remove all references to iaa_crypto):”…”�”}”(hjø h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M—hj™h²hubjn)�”}”(hŒâecho lzo > /sys/module/zswap/parameters/compressor swapoff -a echo 0 > /sys/module/zswap/parameters/accept_threshold_percent echo 0 > /sys/module/zswap/parameters/max_pool_percent echo 0 > /sys/module/zswap/parameters/enabled”h]”hŒâecho lzo > /sys/module/zswap/parameters/compressor swapoff -a echo 0 > /sys/module/zswap/parameters/accept_threshold_percent echo 0 > /sys/module/zswap/parameters/max_pool_percent echo 0 > /sys/module/zswap/parameters/enabled”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´M›hj™h²hubhÞ)�”}”(hŒ_Once zswap is disabled and no longer using iaa_crypto, the IAA wqs and devices can be disabled.”h]”hŒ_Once zswap is disabled and no longer using iaa_crypto, the IAA wqs and devices can be disabled.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M¢hj™h²hubjL)�”}”(hŒ.. _iaa_disable_script:”h]”h}”(h]”h ]”h"]”h$]”h&]”jWŒiaa-disable-script”uh1jKh´M¥hj™h²hh³hÇubeh}”(h]”Œsimple-zswap-test”ah ]”h"]”Œsimple zswap test”ah$]”h&]”uh1hÈhjˆh²hh³hÇh´M²ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒIAA disable script”h]”hŒIAA disable script”…”�”}”(hj8 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj5 h²hh³hÇh´M¨ubhÞ)�”}”(hŒ*The below script automatically does that::”h]”hŒ)The below script automatically does that:”…”�”}”(hjF h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mªhj5 h²hubjn)�”}”(hXð#!/bin/bash echo "IAA devices:" lspci -d:0cfe echo "# IAA devices:" lspci -d:0cfe | wc -l # # count iaa instances # iaa_dev_id="0cfe" num_iaa=$(lspci -d:${iaa_dev_id} | wc -l) echo "Found ${num_iaa} IAA instances" # # disable iaa wqs and devices # echo "Disable IAA" for ((i = 1; i < ${num_iaa} * 2; i += 2)); do echo disable wq iax${i}/wq${i}.0 accel-config disable-wq iax${i}/wq${i}.0 echo disable iaa iax${i} accel-config disable-device iax${i} done echo "End Disable IAA"”h]”hXð#!/bin/bash echo "IAA devices:" lspci -d:0cfe echo "# IAA devices:" lspci -d:0cfe | wc -l # # count iaa instances # iaa_dev_id="0cfe" num_iaa=$(lspci -d:${iaa_dev_id} | wc -l) echo "Found ${num_iaa} IAA instances" # # disable iaa wqs and devices # echo "Disable IAA" for ((i = 1; i < ${num_iaa} * 2; i += 2)); do echo disable wq iax${i}/wq${i}.0 accel-config disable-wq iax${i}/wq${i}.0 echo disable iaa iax${i} accel-config disable-device iax${i} done echo "End Disable IAA"”…”�”}”hjT sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´M¬hj5 h²hubhÞ)�”}”(hŒvFinally, at this point the iaa_crypto module can be removed, which will unregister the current IAA crypto algorithms::”h]”hŒuFinally, at this point the iaa_crypto module can be removed, which will unregister the current IAA crypto algorithms:”…”�”}”(hjb h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MÈhj5 h²hubjn)�”}”(hŒrmmod iaa_crypto”h]”hŒrmmod iaa_crypto”…”�”}”hjp sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´MËhj5 h²hubhÞ)�”}”(hŒ=memory_madvise.c (gcc -o memory_memadvise memory_madvise.c)::”h]”hŒ #include #include #include #include #include #ifndef MADV_PAGEOUT #define MADV_PAGEOUT 21 /* force pages out immediately */ #endif #define PG_SZ 4096 int main(int argc, char **argv) { int i, nr_pages = 1; int64_t *dump_ptr; char *addr, *a; int loop = 1; if (argc > 1) nr_pages = atoi(argv[1]); printf("Allocating %d pages to swap in/out\n", nr_pages); /* allocate pages */ addr = mmap(NULL, nr_pages * PG_SZ, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); *addr = 1; /* initialize data in page to all '*' chars */ memset(addr, '*', nr_pages * PG_SZ); printf("Swapping out %d pages\n", nr_pages); /* Tell kernel to swap it out */ madvise(addr, nr_pages * PG_SZ, MADV_PAGEOUT); while (loop > 0) { /* Wait for swap out to finish */ sleep(5); a = addr; printf("Swapping in %d pages\n", nr_pages); /* Access the page ... this will swap it back in again */ for (i = 0; i < nr_pages; i++) { if (a[0] != '*') { printf("Bad data from decompress!!!!!\n"); dump_ptr = (int64_t *)a; for (int j = 0; j < 100; j++) { printf(" page %d data: %#llx\n", i, *dump_ptr); dump_ptr++; } } a += PG_SZ; } loop --; } printf("Swapped out and in %d pages\n", nr_pages);”h]”hXâ#include #include #include #include #include #include #ifndef MADV_PAGEOUT #define MADV_PAGEOUT 21 /* force pages out immediately */ #endif #define PG_SZ 4096 int main(int argc, char **argv) { int i, nr_pages = 1; int64_t *dump_ptr; char *addr, *a; int loop = 1; if (argc > 1) nr_pages = atoi(argv[1]); printf("Allocating %d pages to swap in/out\n", nr_pages); /* allocate pages */ addr = mmap(NULL, nr_pages * PG_SZ, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0); *addr = 1; /* initialize data in page to all '*' chars */ memset(addr, '*', nr_pages * PG_SZ); printf("Swapping out %d pages\n", nr_pages); /* Tell kernel to swap it out */ madvise(addr, nr_pages * PG_SZ, MADV_PAGEOUT); while (loop > 0) { /* Wait for swap out to finish */ sleep(5); a = addr; printf("Swapping in %d pages\n", nr_pages); /* Access the page ... this will swap it back in again */ for (i = 0; i < nr_pages; i++) { if (a[0] != '*') { printf("Bad data from decompress!!!!!\n"); dump_ptr = (int64_t *)a; for (int j = 0; j < 100; j++) { printf(" page %d data: %#llx\n", i, *dump_ptr); dump_ptr++; } } a += PG_SZ; } loop --; } printf("Swapped out and in %d pages\n", nr_pages);”…”�”}”hjŒ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´MÐhj5 h²hubeh}”(h]”(j, Œid1”eh ]”h"]”(Œiaa disable script”Œiaa_disable_script”eh$]”h&]”uh1hÈhjˆh²hh³hÇh´M¨jó}”j  j" sjõ}”j, j" subeh}”(h]”Œ use-cases”ah ]”h"]”Œ use cases”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´M¯ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒAppendix”h]”hŒAppendix”…”�”}”(hj° h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj­ h²hh³hÇh´MubjL)�”}”(hŒ.. _iaa_sysfs_config:”h]”h}”(h]”h ]”h"]”h$]”h&]”jWŒiaa-sysfs-config”uh1jKh´Mhj­ h²hh³hÇubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒIAA sysfs config interface”h]”hŒIAA sysfs config interface”…”�”}”(hjÌ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÉ h²hh³hÇh´MubhÞ)�”}”(hXJBelow is a description of the IAA sysfs interface, which as mentioned in the main document, should only be used if you know exactly what you are doing. Even then, there's no compelling reason to use it directly since accel-config can do everything the sysfs interface can and in fact accel-config is based on it under the covers.”h]”hXLBelow is a description of the IAA sysfs interface, which as mentioned in the main document, should only be used if you know exactly what you are doing. Even then, there’s no compelling reason to use it directly since accel-config can do everything the sysfs interface can and in fact accel-config is based on it under the covers.”…”�”}”(hjÚ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MhjÉ h²hubhÞ)�”}”(hXgThe 'IAA config path' is /sys/bus/dsa/devices and contains subdirectories representing each IAA device, workqueue, engine, and group. Note that in the sysfs interface, the IAA devices are actually named using iax e.g. iax1, iax3, etc. (Note that IAA devices are the odd-numbered devices; the even-numbered devices are DSA devices and can be ignored for IAA).”h]”hXkThe ‘IAA config path’ is /sys/bus/dsa/devices and contains subdirectories representing each IAA device, workqueue, engine, and group. Note that in the sysfs interface, the IAA devices are actually named using iax e.g. iax1, iax3, etc. (Note that IAA devices are the odd-numbered devices; the even-numbered devices are DSA devices and can be ignored for IAA).”…”�”}”(hjè h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MhjÉ h²hubhÞ)�”}”(hŒuThe 'IAA device bind path' is /sys/bus/dsa/drivers/idxd/bind and is the file that is written to enable an IAA device.”h]”hŒyThe ‘IAA device bind path’ is /sys/bus/dsa/drivers/idxd/bind and is the file that is written to enable an IAA device.”…”�”}”(hjö h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M&hjÉ h²hubhÞ)�”}”(hŒ}The 'IAA workqueue bind path' is /sys/bus/dsa/drivers/crypto/bind and is the file that is written to enable an IAA workqueue.”h]”hŒ�The ‘IAA workqueue bind path’ is /sys/bus/dsa/drivers/crypto/bind and is the file that is written to enable an IAA workqueue.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M)hjÉ h²hubhÞ)�”}”(hŒ�Similarly /sys/bus/dsa/drivers/idxd/unbind and /sys/bus/dsa/drivers/crypto/unbind are used to disable IAA devices and workqueues.”h]”hŒ�Similarly /sys/bus/dsa/drivers/idxd/unbind and /sys/bus/dsa/drivers/crypto/unbind are used to disable IAA devices and workqueues.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M,hjÉ h²hubhÞ)�”}”(hŒRThe basic sequence of commands needed to set up the IAA devices and workqueues is:”h]”hŒRThe basic sequence of commands needed to set up the IAA devices and workqueues is:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M0hjÉ h²hubhŒdefinition_list”“”)�”}”(hhh]”hŒdefinition_list_item”“”)�”}”(hX³For each device:: 1) Disable any workqueues enabled on the device. For example to disable workques 0 and 1 on IAA device 3:: # echo wq3.0 > /sys/bus/dsa/drivers/crypto/unbind # echo wq3.1 > /sys/bus/dsa/drivers/crypto/unbind 2) Disable the device. For example to disable IAA device 3:: # echo iax3 > /sys/bus/dsa/drivers/idxd/unbind 3) configure the desired workqueues. For example, to configure workqueue 3 on IAA device 3:: # echo dedicated > /sys/bus/dsa/devices/iax3/wq3.3/mode # echo 128 > /sys/bus/dsa/devices/iax3/wq3.3/size # echo 0 > /sys/bus/dsa/devices/iax3/wq3.3/group_id # echo 10 > /sys/bus/dsa/devices/iax3/wq3.3/priority # echo "kernel" > /sys/bus/dsa/devices/iax3/wq3.3/type # echo "iaa_crypto" > /sys/bus/dsa/devices/iax3/wq3.3/name # echo "crypto" > /sys/bus/dsa/devices/iax3/wq3.3/driver_name 4) Enable the device. For example to enable IAA device 3:: # echo iax3 > /sys/bus/dsa/drivers/idxd/bind 5) Enable the desired workqueues on the device. For example to enable workques 0 and 1 on IAA device 3:: # echo wq3.0 > /sys/bus/dsa/drivers/crypto/bind # echo wq3.1 > /sys/bus/dsa/drivers/crypto/bind”h]”(hŒterm”“”)�”}”(hŒFor each device::”h]”hŒFor each device::”…”�”}”(hj; h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j9 h³hÇh´MPhj5 ubhŒ definition”“”)�”}”(hhh]”hŒenumerated_list”“”)�”}”(hhh]”(jH)�”}”(hŒÒDisable any workqueues enabled on the device. For example to disable workques 0 and 1 on IAA device 3:: # echo wq3.0 > /sys/bus/dsa/drivers/crypto/unbind # echo wq3.1 > /sys/bus/dsa/drivers/crypto/unbind ”h]”(hÞ)�”}”(hŒhDisable any workqueues enabled on the device. For example to disable workques 0 and 1 on IAA device 3::”h]”hŒgDisable any workqueues enabled on the device. For example to disable workques 0 and 1 on IAA device 3:”…”�”}”(hjW h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M4hjS ubjn)�”}”(hŒc# echo wq3.0 > /sys/bus/dsa/drivers/crypto/unbind # echo wq3.1 > /sys/bus/dsa/drivers/crypto/unbind”h]”hŒc# echo wq3.0 > /sys/bus/dsa/drivers/crypto/unbind # echo wq3.1 > /sys/bus/dsa/drivers/crypto/unbind”…”�”}”hje sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´M7hjS ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jGhjP ubjH)�”}”(hŒlDisable the device. For example to disable IAA device 3:: # echo iax3 > /sys/bus/dsa/drivers/idxd/unbind ”h]”(hÞ)�”}”(hŒ9Disable the device. For example to disable IAA device 3::”h]”hŒ8Disable the device. For example to disable IAA device 3:”…”�”}”(hj} h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M:hjy ubjn)�”}”(hŒ.# echo iax3 > /sys/bus/dsa/drivers/idxd/unbind”h]”hŒ.# echo iax3 > /sys/bus/dsa/drivers/idxd/unbind”…”�”}”hj‹ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´M<hjy ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jGhjP ubjH)�”}”(hXíconfigure the desired workqueues. For example, to configure workqueue 3 on IAA device 3:: # echo dedicated > /sys/bus/dsa/devices/iax3/wq3.3/mode # echo 128 > /sys/bus/dsa/devices/iax3/wq3.3/size # echo 0 > /sys/bus/dsa/devices/iax3/wq3.3/group_id # echo 10 > /sys/bus/dsa/devices/iax3/wq3.3/priority # echo "kernel" > /sys/bus/dsa/devices/iax3/wq3.3/type # echo "iaa_crypto" > /sys/bus/dsa/devices/iax3/wq3.3/name # echo "crypto" > /sys/bus/dsa/devices/iax3/wq3.3/driver_name ”h]”(hÞ)�”}”(hŒZconfigure the desired workqueues. For example, to configure workqueue 3 on IAA device 3::”h]”hŒYconfigure the desired workqueues. For example, to configure workqueue 3 on IAA device 3:”…”�”}”(hj£ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M>hjŸ ubjn)�”}”(hX‚# echo dedicated > /sys/bus/dsa/devices/iax3/wq3.3/mode # echo 128 > /sys/bus/dsa/devices/iax3/wq3.3/size # echo 0 > /sys/bus/dsa/devices/iax3/wq3.3/group_id # echo 10 > /sys/bus/dsa/devices/iax3/wq3.3/priority # echo "kernel" > /sys/bus/dsa/devices/iax3/wq3.3/type # echo "iaa_crypto" > /sys/bus/dsa/devices/iax3/wq3.3/name # echo "crypto" > /sys/bus/dsa/devices/iax3/wq3.3/driver_name”h]”hX‚# echo dedicated > /sys/bus/dsa/devices/iax3/wq3.3/mode # echo 128 > /sys/bus/dsa/devices/iax3/wq3.3/size # echo 0 > /sys/bus/dsa/devices/iax3/wq3.3/group_id # echo 10 > /sys/bus/dsa/devices/iax3/wq3.3/priority # echo "kernel" > /sys/bus/dsa/devices/iax3/wq3.3/type # echo "iaa_crypto" > /sys/bus/dsa/devices/iax3/wq3.3/name # echo "crypto" > /sys/bus/dsa/devices/iax3/wq3.3/driver_name”…”�”}”hj± sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´MAhjŸ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jGhjP ubjH)�”}”(hŒhEnable the device. For example to enable IAA device 3:: # echo iax3 > /sys/bus/dsa/drivers/idxd/bind ”h]”(hÞ)�”}”(hŒ7Enable the device. For example to enable IAA device 3::”h]”hŒ6Enable the device. For example to enable IAA device 3:”…”�”}”(hjÉ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MIhjÅ ubjn)�”}”(hŒ,# echo iax3 > /sys/bus/dsa/drivers/idxd/bind”h]”hŒ,# echo iax3 > /sys/bus/dsa/drivers/idxd/bind”…”�”}”hj× sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´MKhjÅ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jGhjP ubjH)�”}”(hŒËEnable the desired workqueues on the device. For example to enable workques 0 and 1 on IAA device 3:: # echo wq3.0 > /sys/bus/dsa/drivers/crypto/bind # echo wq3.1 > /sys/bus/dsa/drivers/crypto/bind”h]”(hÞ)�”}”(hŒfEnable the desired workqueues on the device. For example to enable workques 0 and 1 on IAA device 3::”h]”hŒeEnable the desired workqueues on the device. For example to enable workques 0 and 1 on IAA device 3:”…”�”}”(hjï h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MMhjë ubjn)�”}”(hŒ_# echo wq3.0 > /sys/bus/dsa/drivers/crypto/bind # echo wq3.1 > /sys/bus/dsa/drivers/crypto/bind”h]”hŒ_# echo wq3.0 > /sys/bus/dsa/drivers/crypto/bind # echo wq3.1 > /sys/bus/dsa/drivers/crypto/bind”…”�”}”hjý sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jmh³hÇh´MPhjë ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jGhjP ubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ)”uh1jN hjK ubah}”(h]”h ]”h"]”h$]”h&]”uh1jI hj5 ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j3 h³hÇh´MPhj0 ubah}”(h]”h ]”h"]”h$]”h&]”uh1j. hjÉ h²hh³Nh´Nubeh}”(h]”(Œiaa-sysfs-config-interface”jÈ eh ]”h"]”(Œiaa sysfs config interface”Œiaa_sysfs_config”eh$]”h&]”uh1hÈhj­ h²hh³hÇh´Mjó}”j4 j¾ sjõ}”jÈ j¾ subeh}”(h]”Œappendix”ah ]”h"]”Œappendix”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´Mubeh}”(h]”Œ)iaa-compression-accelerator-crypto-driver”ah ]”h"]”Œ)iaa compression accelerator crypto driver”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jl Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”(jX]”jMaj, ]”j" ajÈ ]”j¾ auŒnameids”}”(jF jC jXjUj®j«j j jPjMjüjùjwjtjjýj^j[jðjXjïjìj…j‚jª j§ j2 j/ j  j, jŸ jœ j> j; j4 jÈ j3 j0 uŒ nametypes”}”(jF ‰jX‰j®‰j ‰jP‰jü‰jw‰j‰j^‰jðˆjï‰j…‰jª ‰j2 ‰j  ˆjŸ ‰j> ‰j4 ˆj3 ‰uh}”(jC hÊjUj§j«jDj j±jMjjùj[jtjljýjzj[jjXjajìjaj‚jÿj§ jˆj/ j™j, j5 jœ j5 j; j­ jÈ jÉ j0 jÉ uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”jz Ks…”R”Œparse_messages”]”hŒsystem_message”“”)�”}”(hhh]”hÞ)�”}”(hŒ`Blank line missing before literal block (after the "::")? Interpreted as a definition list item.”h]”hŒdBlank line missing before literal block (after the “::â€�)? Interpreted as a definition list item.”…”�”}”(hjÖ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjÓ ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œline”MQŒsource”hÇuh1jÑ hjK ubaŒtransform_messages”]”(jÒ )�”}”(hhh]”hÞ)�”}”(hhh]”hŒ8Hyperlink target "iaa-default-config" is not referenced.”…”�”}”hjô sbah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjñ ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”jì Œsource”hÇŒline”M%uh1jÑ ubjÒ )�”}”(hhh]”hÞ)�”}”(hhh]”hŒ8Hyperlink target "iaa-disable-script" is not referenced.”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhj ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”jì Œsource”hÇŒline”M¥uh1jÑ ubjÒ )�”}”(hhh]”hÞ)�”}”(hhh]”hŒ6Hyperlink target "iaa-sysfs-config" is not referenced.”…”�”}”hj( sbah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhj% ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”jì Œsource”hÇŒline”Muh1jÑ ubeŒ transformer”NŒ include_log”]”Œ decoration”Nh²hub.