ksphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftargetA/translations/zh_CN/networking/device_drivers/ethernet/amazon/enamodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftargetA/translations/zh_TW/networking/device_drivers/ethernet/amazon/enamodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftargetA/translations/it_IT/networking/device_drivers/ethernet/amazon/enamodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftargetA/translations/ja_JP/networking/device_drivers/ethernet/amazon/enamodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftargetA/translations/ko_KR/networking/device_drivers/ethernet/amazon/enamodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftargetA/translations/sp_SP/networking/device_drivers/ethernet/amazon/enamodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh[/var/lib/git/docbuild/linux/Documentation/networking/device_drivers/ethernet/amazon/ena.rsthKubhsection)}(hhh](htitle)}(hhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hhhhubeh}(h]overviewah ]h"]overviewah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h#ENA Source Code Directory Structureh]h#ENA Source Code Directory Structure}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjThhhhhK+ubhtable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1johjlubjp)}(hhh]h}(h]h ]h"]h$]h&]colwidthKubah}(h]h ]h"]h$]h&]uh1jhj;ubj)}(hhh]h)}(hdebugfs files.h]hdebugfs files.}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK=hjUubah}(h]h ]h"]h$]h&]uh1jhj;ubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjlubeh}(h]h ]h"]h$]h&]colsKuh1jjhjgubah}(h]h ]h"]h$]h&]uh1jehjThhhhhNubeh}(h]#ena-source-code-directory-structureah ]h"]#ena source code directory structureah$]h&]uh1hhhhhhhhK+ubh)}(hhh](h)}(hManagement Interface:h]hManagement Interface:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKAubh)}(h0ENA management interface is exposed by means of:h]h0ENA management interface is exposed by means of:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKChjhhubh bullet_list)}(hhh](h list_item)}(hPCIe Configuration Spaceh]h)}(hjh]hPCIe Configuration Space}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hDevice Registersh]h)}(hjh]hDevice Registers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKFhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h1Admin Queue (AQ) and Admin Completion Queue (ACQ)h]h)}(hjh]h1Admin Queue (AQ) and Admin Completion Queue (ACQ)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h-Asynchronous Event Notification Queue (AENQ) h]h)}(h,Asynchronous Event Notification Queue (AENQ)h]h,Asynchronous Event Notification Queue (AENQ)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKHhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]bullet-uh1jhhhKEhjhhubh)}(hENA device MMIO Registers are accessed only during driver initialization and are not used during further normal device operation.h]hENA device MMIO Registers are accessed only during driver initialization and are not used during further normal device operation.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhjhhubh)}(hqAQ is used for submitting management commands, and the results/responses are reported asynchronously through ACQ.h]hqAQ is used for submitting management commands, and the results/responses are reported asynchronously through ACQ.}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhjhhubh)}(hENA introduces a small set of management commands with room for vendor-specific extensions. Most of the management operations are framed in a generic Get/Set feature command.h]hENA introduces a small set of management commands with room for vendor-specific extensions. Most of the management operations are framed in a generic Get/Set feature command.}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKQhjhhubh)}(h1The following admin queue commands are supported:h]h1The following admin queue commands are supported:}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKUhjhhubj)}(hhh](j)}(hCreate I/O submission queueh]h)}(hjUh]hCreate I/O submission queue}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKWhjSubah}(h]h ]h"]h$]h&]uh1jhjPhhhhhNubj)}(hCreate I/O completion queueh]h)}(hjlh]hCreate I/O completion queue}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKXhjjubah}(h]h ]h"]h$]h&]uh1jhjPhhhhhNubj)}(hDestroy I/O submission queueh]h)}(hjh]hDestroy I/O submission queue}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKYhjubah}(h]h ]h"]h$]h&]uh1jhjPhhhhhNubj)}(hDestroy I/O completion queueh]h)}(hjh]hDestroy I/O completion queue}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKZhjubah}(h]h ]h"]h$]h&]uh1jhjPhhhhhNubj)}(h Get featureh]h)}(hjh]h Get feature}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK[hjubah}(h]h ]h"]h$]h&]uh1jhjPhhhhhNubj)}(h Set featureh]h)}(hjh]h Set feature}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK\hjubah}(h]h ]h"]h$]h&]uh1jhjPhhhhhNubj)}(hConfigure AENQh]h)}(hjh]hConfigure AENQ}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK]hjubah}(h]h ]h"]h$]h&]uh1jhjPhhhhhNubj)}(hGet statistics h]h)}(hGet statisticsh]hGet statistics}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK^hjubah}(h]h ]h"]h$]h&]uh1jhjPhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhKWhjhhubh)}(hORefer to ena_admin_defs.h for the list of supported Get/Set Feature properties.h]hORefer to ena_admin_defs.h for the list of supported Get/Set Feature properties.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK`hjhhubh)}(hXThe Asynchronous Event Notification Queue (AENQ) is a uni-directional queue used by the ENA device to send to the driver events that cannot be reported using ACQ. AENQ events are subdivided into groups. Each group may have multiple syndromes, as shown belowh]hXThe Asynchronous Event Notification Queue (AENQ) is a uni-directional queue used by the ENA device to send to the driver events that cannot be reported using ACQ. AENQ events are subdivided into groups. Each group may have multiple syndromes, as shown below}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKchjhhubh)}(hThe events are:h]hThe events are:}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhjhhubjf)}(hhh]jk)}(hhh](jp)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1johj?ubjp)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1johj?ubhthead)}(hhh]j)}(hhh](j)}(hhh]h)}(hGrouph]hGroup}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKkhj^ubah}(h]h ]h"]h$]h&]uh1jhj[ubj)}(hhh]h)}(hSyndromeh]hSyndrome}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKkhjuubah}(h]h ]h"]h$]h&]uh1jhj[ubeh}(h]h ]h"]h$]h&]uh1jhjXubah}(h]h ]h"]h$]h&]uh1jVhj?ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(hLink state changeh]hLink state change}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h**X**h]hstrong)}(hjh]hX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKmhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h Fatal errorh]h Fatal error}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKnhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h**X**h]j)}(hjh]hX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKnhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h Notificationh]h Notification}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohj ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hSuspend traffich]hSuspend traffic}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohj7ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h Notificationh]h Notification}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKphjWubah}(h]h ]h"]h$]h&]uh1jhjTubj)}(hhh]h)}(hResume traffich]hResume traffic}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKphjnubah}(h]h ]h"]h$]h&]uh1jhjTubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h Keep-Aliveh]h Keep-Alive}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKqhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h**X**h]j)}(hjh]hX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKqhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj?ubeh}(h]h ]h"]h$]h&]colsKuh1jjhj<ubah}(h]h ]h"]h$]h&]uh1jehjhhhhhNubh)}(h)ACQ and AENQ share the same MSI-X vector.h]h)ACQ and AENQ share the same MSI-X vector.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKthjhhubh)}(hXBKeep-Alive is a special mechanism that allows monitoring the device's health. A Keep-Alive event is delivered by the device every second. The driver maintains a watchdog (WD) handler which logs the current state and statistics. If the keep-alive events aren't delivered as expected the WD resets the device and the driver.h]hXFKeep-Alive is a special mechanism that allows monitoring the device’s health. A Keep-Alive event is delivered by the device every second. The driver maintains a watchdog (WD) handler which logs the current state and statistics. If the keep-alive events aren’t delivered as expected the WD resets the device and the driver.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKvhjhhubeh}(h]management-interfaceah ]h"]management interface:ah$]h&]uh1hhhhhhhhKAubh)}(hhh](h)}(hData Path Interfaceh]hData Path Interface}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK}ubh)}(hI/O operations are based on Tx and Rx Submission Queues (Tx SQ and Rx SQ correspondingly). Each SQ has a completion queue (CQ) associated with it.h]hI/O operations are based on Tx and Rx Submission Queues (Tx SQ and Rx SQ correspondingly). Each SQ has a completion queue (CQ) associated with it.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hRThe SQs and CQs are implemented as descriptor rings in contiguous physical memory.h]hRThe SQs and CQs are implemented as descriptor rings in contiguous physical memory.}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h=The ENA driver supports two Queue Operation modes for Tx SQs:h]h=The ENA driver supports two Queue Operation modes for Tx SQs:}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hhh](j)}(h**Regular mode:** In this mode the Tx SQs reside in the host's memory. The ENA device fetches the ENA Tx descriptors and packet data from host memory. h]h)}(h**Regular mode:** In this mode the Tx SQs reside in the host's memory. The ENA device fetches the ENA Tx descriptors and packet data from host memory.h](j)}(h**Regular mode:**h]h Regular mode:}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjDubh In this mode the Tx SQs reside in the host’s memory. The ENA device fetches the ENA Tx descriptors and packet data from host memory.}(hjDhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj@ubah}(h]h ]h"]h$]h&]uh1jhj=hhhhhNubj)}(hX7**Low Latency Queue (LLQ) mode or "push-mode":** In this mode the driver pushes the transmit descriptors and the first 96 bytes of the packet directly to the ENA device memory space. The rest of the packet payload is fetched by the device. For this operation mode, the driver uses a dedicated PCI device memory BAR, which is mapped with write-combine capability. **Note that** not all ENA devices support LLQ, and this feature is negotiated with the device upon initialization. If the ENA device does not support LLQ mode, the driver falls back to the regular mode. h](h)}(hXj**Low Latency Queue (LLQ) mode or "push-mode":** In this mode the driver pushes the transmit descriptors and the first 96 bytes of the packet directly to the ENA device memory space. The rest of the packet payload is fetched by the device. For this operation mode, the driver uses a dedicated PCI device memory BAR, which is mapped with write-combine capability.h](j)}(h0**Low Latency Queue (LLQ) mode or "push-mode":**h]h0Low Latency Queue (LLQ) mode or “push-mode”:}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjjubhX: In this mode the driver pushes the transmit descriptors and the first 96 bytes of the packet directly to the ENA device memory space. The rest of the packet payload is fetched by the device. For this operation mode, the driver uses a dedicated PCI device memory BAR, which is mapped with write-combine capability.}(hjjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjfubh)}(h**Note that** not all ENA devices support LLQ, and this feature is negotiated with the device upon initialization. If the ENA device does not support LLQ mode, the driver falls back to the regular mode.h](j)}(h **Note that**h]h Note that}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh not all ENA devices support LLQ, and this feature is negotiated with the device upon initialization. If the ENA device does not support LLQ mode, the driver falls back to the regular mode.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjfubeh}(h]h ]h"]h$]h&]uh1jhj=hhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhKhjhhubh)}(h)The Rx SQs support only the regular mode.h]h)The Rx SQs support only the regular mode.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hNThe driver supports multi-queue for both Tx and Rx. This has various benefits:h]hNThe driver supports multi-queue for both Tx and Rx. This has various benefits:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hhh](j)}(hDReduced CPU/thread/process contention on a given Ethernet interface.h]h)}(hjh]hDReduced CPU/thread/process contention on a given Ethernet interface.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hmCache miss rate on completion is reduced, particularly for data cache lines that hold the sk_buff structures.h]h)}(hmCache miss rate on completion is reduced, particularly for data cache lines that hold the sk_buff structures.h]hmCache miss rate on completion is reduced, particularly for data cache lines that hold the sk_buff structures.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hCIncreased process-level parallelism when handling received packets.h]h)}(hjh]hCIncreased process-level parallelism when handling received packets.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hIncreased data cache hit rate, by steering kernel processing of packets to the CPU, where the application thread consuming the packet is running.h]h)}(hIncreased data cache hit rate, by steering kernel processing of packets to the CPU, where the application thread consuming the packet is running.h]hIncreased data cache hit rate, by steering kernel processing of packets to the CPU, where the application thread consuming the packet is running.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h$In hardware interrupt re-direction. h]h)}(h#In hardware interrupt re-direction.h]h#In hardware interrupt re-direction.}(hj/ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj+ ubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhKhjhhubeh}(h]data-path-interfaceah ]h"]data path interfaceah$]h&]uh1hhhhhhhhK}ubh)}(hhh](h)}(hInterrupt Modesh]hInterrupt Modes}(hjT hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjQ hhhhhKubh)}(hThe driver assigns a single MSI-X vector per queue pair (for both Tx and Rx directions). The driver assigns an additional dedicated MSI-X vector for management (for ACQ and AENQ).h]hThe driver assigns a single MSI-X vector per queue pair (for both Tx and Rx directions). The driver assigns an additional dedicated MSI-X vector for management (for ACQ and AENQ).}(hjb hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjQ hhubh)}(hX$Management interrupt registration is performed when the Linux kernel probes the adapter, and it is de-registered when the adapter is removed. I/O queue interrupt registration is performed when the Linux interface of the adapter is opened, and it is de-registered when the interface is closed.h]hX$Management interrupt registration is performed when the Linux kernel probes the adapter, and it is de-registered when the adapter is removed. I/O queue interrupt registration is performed when the Linux interface of the adapter is opened, and it is de-registered when the interface is closed.}(hjp hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjQ hhubh)}(h#The management interrupt is named::h]h"The management interrupt is named:}(hj~ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjQ hhubh literal_block)}(h,ena-mgmnt@pci:h]h,ena-mgmnt@pci:}hj sbah}(h]h ]h"]h$]h&]hhuh1j hhhKhjQ hhubh)}(h0and for each queue pair, an interrupt is named::h]h/and for each queue pair, an interrupt is named:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjQ hhubj )}(h$-Tx-Rx-h]h$-Tx-Rx-}hj sbah}(h]h ]h"]h$]h&]hhuh1j hhhKhjQ hhubh)}(hXThe ENA device operates in auto-mask and auto-clear interrupt modes. That is, once MSI-X is delivered to the host, its Cause bit is automatically cleared and the interrupt is masked. The interrupt is unmasked by the driver after NAPI processing is complete.h]hXThe ENA device operates in auto-mask and auto-clear interrupt modes. That is, once MSI-X is delivered to the host, its Cause bit is automatically cleared and the interrupt is masked. The interrupt is unmasked by the driver after NAPI processing is complete.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjQ hhubeh}(h]interrupt-modesah ]h"]interrupt modesah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hInterrupt Moderationh]hInterrupt Moderation}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hXENA driver and device can operate in conventional or adaptive interrupt moderation mode.h]hXENA driver and device can operate in conventional or adaptive interrupt moderation mode.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hX**In conventional mode** the driver instructs device to postpone interrupt posting according to static interrupt delay value. The interrupt delay value can be configured through `ethtool(8)`. The following `ethtool` parameters are supported by the driver: ``tx-usecs``, ``rx-usecs``h](j)}(h**In conventional mode**h]hIn conventional mode}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh the driver instructs device to postpone interrupt posting according to static interrupt delay value. The interrupt delay value can be configured through }(hj hhhNhNubhtitle_reference)}(h `ethtool(8)`h]h ethtool(8)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh. The following }(hj hhhNhNubj )}(h `ethtool`h]hethtool}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh) parameters are supported by the driver: }(hj hhhNhNubhliteral)}(h ``tx-usecs``h]htx-usecs}(hj+ hhhNhNubah}(h]h ]h"]h$]h&]uh1j) hj ubh, }(hj hhhNhNubj* )}(h ``rx-usecs``h]hrx-usecs}(hj= hhhNhNubah}(h]h ]h"]h$]h&]uh1j) hj ubeh}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(h**In adaptive interrupt** moderation mode the interrupt delay value is updated by the driver dynamically and adjusted every NAPI cycle according to the traffic nature.h](j)}(h**In adaptive interrupt**h]hIn adaptive interrupt}(hjU hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQ ubh moderation mode the interrupt delay value is updated by the driver dynamically and adjusted every NAPI cycle according to the traffic nature.}(hjQ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hgAdaptive coalescing can be switched on/off through `ethtool(8)`'s :code:`adaptive_rx on|off` parameter.h](h3Adaptive coalescing can be switched on/off through }(hjm hhhNhNubj )}(h `ethtool(8)`h]h ethtool(8)}(hju hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjm ubh’s }(hjm hhhNhNubj* )}(h:code:`adaptive_rx on|off`h]hadaptive_rx on|off}(hj hhhNhNubah}(h]h ]codeah"]h$]h&]languagehuh1j) hjm ubh parameter.}(hjm hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hoMore information about Adaptive Interrupt Moderation (DIM) can be found in Documentation/networking/net_dim.rsth]hoMore information about Adaptive Interrupt Moderation (DIM) can be found in Documentation/networking/net_dim.rst}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubhtarget)}(h.. _`RX copybreak`:h]h}(h]h ]h"]h$]h&]j rx-copybreakuh1j hKhj hhhh referencedKubeh}(h]interrupt-moderationah ]h"]interrupt moderationah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h RX copybreakh]h RX copybreak}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hThe rx_copybreak is initialized by default to ENA_DEFAULT_RX_COPYBREAK and can be configured by the ETHTOOL_STUNABLE command of the SIOCETHTOOL ioctl.h]hThe rx_copybreak is initialized by default to ENA_DEFAULT_RX_COPYBREAK and can be configured by the ETHTOOL_STUNABLE command of the SIOCETHTOOL ioctl.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hThis option controls the maximum packet length for which the RX descriptor it was received on would be recycled. When a packet smaller than RX copybreak bytes is received, it is copied into a new memory buffer and the RX descriptor is returned to HW.h]hThis option controls the maximum packet length for which the RX descriptor it was received on would be recycled. When a packet smaller than RX copybreak bytes is received, it is copied into a new memory buffer and the RX descriptor is returned to HW.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj )}(h .. _`PHC`:h]h}(h]h ]h"]h$]h&]jjuh1j hKhj hhhhj Kubeh}(h](j id1eh ]h"] rx copybreakah$] rx copybreakah&]uh1hhhhhhhhKj Kexpect_referenced_by_name}j j sexpect_referenced_by_id}j j subh)}(hhh](h)}(hPTP Hardware Clock (PHC)h]hPTP Hardware Clock (PHC)}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubj )}(hf.. _`ptp-userspace-api`: https://docs.kernel.org/driver-api/ptp.html#ptp-hardware-clock-user-space-apih]h}(h]ptp-userspace-apiah ]h"]ptp-userspace-apiah$]h&]refuriMhttps://docs.kernel.org/driver-api/ptp.html#ptp-hardware-clock-user-space-apiuh1j hKhj hhhhj Kubj )}(hc.. _`testptp`: https://elixir.bootlin.com/linux/latest/source/tools/testing/selftests/ptp/testptp.ch]h}(h]testptpah ]h"]testptpah$]h&]j& Thttps://elixir.bootlin.com/linux/latest/source/tools/testing/selftests/ptp/testptp.cuh1j hKhj hhhhj Kubh)}(hlENA Linux driver supports PTP hardware clock providing timestamp reference to achieve nanosecond resolution.h]hlENA Linux driver supports PTP hardware clock providing timestamp reference to achieve nanosecond resolution.}(hj5 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(h**PHC support**h]j)}(hjE h]h PHC support}(hjG hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjC ubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hgPHC depends on the PTP module, which needs to be either loaded as a module or compiled into the kernel.h]hgPHC depends on the PTP module, which needs to be either loaded as a module or compiled into the kernel.}(hjZ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(h$Verify if the PTP module is present:h]h$Verify if the PTP module is present:}(hjh hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj )}(h=grep -w '^CONFIG_PTP_1588_CLOCK=[ym]' /boot/config-`uname -r`h]h=grep -w '^CONFIG_PTP_1588_CLOCK=[ym]' /boot/config-`uname -r`}hjv sbah}(h]h ]h"]h$]h&]hhforcelanguageshellhighlight_args}uh1j hhhKhj hhubj)}(hhh]j)}(hLIf no output is provided, the ENA driver cannot be loaded with PHC support. h]h)}(hKIf no output is provided, the ENA driver cannot be loaded with PHC support.h]hKIf no output is provided, the ENA driver cannot be loaded with PHC support.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubah}(h]h ]h"]h$]h&]jjuh1jhhhKhj hhubh)}(h**PHC activation**h]j)}(hj h]hPHC activation}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hyThe feature is turned off by default, in order to turn the feature on, the ENA driver can be loaded in the following way:h]hyThe feature is turned off by default, in order to turn the feature on, the ENA driver can be loaded in the following way:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(hhh]j)}(h devlink: h]h)}(hdevlink:h]hdevlink:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubah}(h]h ]h"]h$]h&]jjuh1jhhhKhj hhubj )}(hX,sudo devlink dev param set pci/ name enable_phc value true cmode driverinit sudo devlink dev reload pci/ # for example: sudo devlink dev param set pci/0000:00:06.0 name enable_phc value true cmode driverinit sudo devlink dev reload pci/0000:00:06.0h]hX,sudo devlink dev param set pci/ name enable_phc value true cmode driverinit sudo devlink dev reload pci/ # for example: sudo devlink dev param set pci/0000:00:06.0 name enable_phc value true cmode driverinit sudo devlink dev reload pci/0000:00:06.0}hj sbah}(h]h ]h"]h$]h&]hhj j shellj }uh1j hhhKhj hhubh)}(h4All available PTP clock sources can be tracked here:h]h4All available PTP clock sources can be tracked here:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj )}(hls /sys/class/ptph]hls /sys/class/ptp}hj sbah}(h]h ]h"]h$]h&]hhj j shellj }uh1j hhhM hj hhubh)}(h;PHC support and capabilities can be verified using ethtool:h]h;PHC support and capabilities can be verified using ethtool:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj hhubj )}(hethtool -T h]hethtool -T }hj, sbah}(h]h ]h"]h$]h&]hhj j shellj }uh1j hhhMhj hhubh)}(h**PHC timestamp**h]j)}(hj> h]h PHC timestamp}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj< ubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(hTTo retrieve PHC timestamp, use `ptp-userspace-api`_, usage example using `testptp`_:h](hTo retrieve PHC timestamp, use }(hjS hhhNhNubj)}(h`ptp-userspace-api`_h]hptp-userspace-api}(hj[ hhhNhNubah}(h]h ]h"]h$]h&]nameptp-userspace-apij& j' uh1jhjS jKubh, usage example using }(hjS hhhNhNubj)}(h `testptp`_h]htestptp}(hjo hhhNhNubah}(h]h ]h"]h$]h&]nametestptpj& j4 uh1jhjS jKubh:}(hjS hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj )}(h[testptp -d /dev/ptp$(ethtool -T | awk '/PTP Hardware Clock:/ {print $NF}') -k 1h]h[testptp -d /dev/ptp$(ethtool -T | awk '/PTP Hardware Clock:/ {print $NF}') -k 1}hj sbah}(h]h ]h"]h$]h&]hhj j shellj }uh1j hhhMhj hhubh)}(hX]PHC get time requests should be within reasonable bounds, avoid excessive utilization to ensure optimal performance and efficiency. The ENA device restricts the frequency of PHC get time requests to a maximum of 125 requests per second. If this limit is surpassed, the get time request will fail, leading to an increment in the phc_err_ts statistic.h]hX]PHC get time requests should be within reasonable bounds, avoid excessive utilization to ensure optimal performance and efficiency. The ENA device restricts the frequency of PHC get time requests to a maximum of 125 requests per second. If this limit is surpassed, the get time request will fail, leading to an increment in the phc_err_ts statistic.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubh)}(h**PHC statistics**h]j)}(hj h]hPHC statistics}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhM!hj hhubh)}(h0PHC can be monitored using debugfs (if mounted):h]h0PHC can be monitored using debugfs (if mounted):}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM#hj hhubj )}(hsudo cat /sys/kernel/debug//phc_stats # for example: sudo cat /sys/kernel/debug/0000:00:06.0/phc_statsh]hsudo cat /sys/kernel/debug//phc_stats # for example: sudo cat /sys/kernel/debug/0000:00:06.0/phc_stats}hj sbah}(h]h ]h"]h$]h&]hhj j shellj }uh1j hhhM%hj hhubh)}(hmPHC errors must remain below 1% of all PHC requests to maintain the desired level of accuracy and reliabilityh]hmPHC errors must remain below 1% of all PHC requests to maintain the desired level of accuracy and reliability}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM,hj hhubjf)}(hhh]jk)}(hhh](jp)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1johj ubjp)}(hhh]h}(h]h ]h"]h$]h&]colwidthK[uh1johj ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h **phc_cnt**h]j)}(hj h]hphc_cnt}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhM/hj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h line_block)}(hhh]hh)}(hANumber of successful retrieved timestamps (below expire timeout).h]hANumber of successful retrieved timestamps (below expire timeout).}(hj3 hhhNhNubah}(h]h ]h"]h$]h&]uh1hindentKhj/ hhhKubah}(h]h ]h"]h$]h&]uh1j- hj* ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh](j)}(hhh]h)}(h **phc_exp**h]j)}(hj\ h]hphc_exp}(hj^ hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjZ ubah}(h]h ]h"]h$]h&]uh1hhhhM0hjW ubah}(h]h ]h"]h$]h&]uh1jhjT ubj)}(hhh]j. )}(hhh]j2 )}(h>Number of expired retrieved timestamps (above expire timeout).h]h>Number of expired retrieved timestamps (above expire timeout).}(hj} hhhNhNubah}(h]h ]h"]h$]h&]uh1hjA Khjz hhhKubah}(h]h ]h"]h$]h&]uh1j- hjw ubah}(h]h ]h"]h$]h&]uh1jhjT ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh](j)}(hhh]h)}(h **phc_skp**h]j)}(hj h]hphc_skp}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhM1hj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]j. )}(hhh]j2 )}(h:Number of skipped get time attempts (during block period).h]h:Number of skipped get time attempts (during block period).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hjA Khj hhhKubah}(h]h ]h"]h$]h&]uh1j- hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh](j)}(hhh]h)}(h**phc_err_dv**h]j)}(hj h]h phc_err_dv}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhM2hj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]j. )}(hhh]j2 )}(hTNumber of failed get time attempts due to device errors (entering into block state).h]hTNumber of failed get time attempts due to device errors (entering into block state).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hjA Khj hhhKubah}(h]h ]h"]h$]h&]uh1j- hj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh](j)}(hhh]h)}(h**phc_err_ts**h]j)}(hj7h]h phc_err_ts}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj5ubah}(h]h ]h"]h$]h&]uh1hhhhM3hj2ubah}(h]h ]h"]h$]h&]uh1jhj/ubj)}(hhh]j. )}(hhh](j2 )}(hWNumber of failed get time attempts due to timestamp errors (entering into block state),h]hWNumber of failed get time attempts due to timestamp errors (entering into block state),}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hjA KhjUhhhKubj2 )}(hYThis occurs if driver exceeded the request limit or device received an invalid timestamp.h]hYThis occurs if driver exceeded the request limit or device received an invalid timestamp.}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hjA KhjUhhhKubeh}(h]h ]h"]h$]h&]uh1j- hjRubah}(h]h ]h"]h$]h&]uh1jhj/ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]colsKuh1jjhj ubah}(h]h ]h"]h$]h&]uh1jehj hhhNhNubh)}(h PHC timeouts:h]h PHC timeouts:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM7hj hhubjf)}(hhh]jk)}(hhh](jp)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1johjubjp)}(hhh]h}(h]h ]h"]h$]h&]colwidthKLuh1johjubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h **expire**h]j)}(hjh]hexpire}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhM:hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]j. )}(hhh](j2 )}(hJMax time for a valid timestamp retrieval, passing this threshold will failh]hJMax time for a valid timestamp retrieval, passing this threshold will fail}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hjA KhjhhhKubj2 )}(h@the get time request and block new requests until block timeout.h]h@the get time request and block new requests until block timeout.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hjA KhjhhhKubeh}(h]h ]h"]h$]h&]uh1j- hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h **block**h]j)}(hj#h]hblock}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubah}(h]h ]h"]h$]h&]uh1hhhhM<hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]j. )}(hhh](j2 )}(h>Blocking period starts once get time request expires or fails,h]h>Blocking period starts once get time request expires or fails,}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hjA KhjAhhhKubj2 )}(h:all get time requests during block period will be skipped.h]h:all get time requests during block period will be skipped.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hjA KhjAhhhKubeh}(h]h ]h"]h$]h&]uh1j- hj>ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jjhjubah}(h]h ]h"]h$]h&]uh1jehj hhhNhNubeh}(h](ptp-hardware-clock-phcjeh ]h"](ptp hardware clock (phc)phceh$]h&]uh1hhhhhhhhKj }jj sj }jj sj Kubh)}(hhh](h)}(h Statisticsh]h Statistics}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMAubh)}(hThe user can obtain ENA device and driver statistics using `ethtool`. The driver can collect regular or extended statistics (including per-queue stats) from the device.h](h;The user can obtain ENA device and driver statistics using }(hjhhhNhNubj )}(h `ethtool`h]hethtool}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubhd. The driver can collect regular or extended statistics (including per-queue stats) from the device.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMChjhhubh)}(hBIn addition the driver logs the stats to syslog upon device reset.h]hBIn addition the driver logs the stats to syslog upon device reset.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMGhjhhubh)}(hXOn supported instance types, the statistics will also include the ENA Express data (fields prefixed with `ena_srd`). For a complete documentation of ENA Express data refer to https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ena-express.html#ena-express-monitorh](hiOn supported instance types, the statistics will also include the ENA Express data (fields prefixed with }(hjhhhNhNubj )}(h `ena_srd`h]hena_srd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh=). For a complete documentation of ENA Express data refer to }(hjhhhNhNubj)}(hXhttps://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ena-express.html#ena-express-monitorh]hXhttps://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ena-express.html#ena-express-monitor}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhMIhjhhubeh}(h] statisticsah ]h"] statisticsah$]h&]uh1hhhhhhhhMAubh)}(hhh](h)}(hMTUh]hMTU}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMOubh)}(hThe driver supports an arbitrarily large MTU with a maximum that is negotiated with the device. The driver configures MTU using the SetFeature command (ENA_ADMIN_MTU property). The user can change MTU via `ip(8)` and similar legacy tools.h](hThe driver supports an arbitrarily large MTU with a maximum that is negotiated with the device. The driver configures MTU using the SetFeature command (ENA_ADMIN_MTU property). The user can change MTU via }(hjhhhNhNubj )}(h`ip(8)`h]hip(8)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh and similar legacy tools.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMQhjhhubeh}(h]mtuah ]h"]mtuah$]h&]uh1hhhhhhhhMOubh)}(hhh](h)}(hStateless Offloadsh]hStateless Offloads}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj?hhhhhMWubh)}(hThe ENA driver supports:h]hThe ENA driver supports:}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMYhj?hhubj)}(hhh](j)}(hIPv4 header checksum offloadh]h)}(hjch]hIPv4 header checksum offload}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM[hjaubah}(h]h ]h"]h$]h&]uh1jhj^hhhhhNubj)}(h)TCP/UDP over IPv4/IPv6 checksum offloads h]h)}(h(TCP/UDP over IPv4/IPv6 checksum offloadsh]h(TCP/UDP over IPv4/IPv6 checksum offloads}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM\hjxubah}(h]h ]h"]h$]h&]uh1jhj^hhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhM[hj?hhubeh}(h]stateless-offloadsah ]h"]stateless offloadsah$]h&]uh1hhhhhhhhMWubh)}(hhh](h)}(hRSSh]hRSS}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM_ubj)}(hhh](j)}(hEThe ENA device supports RSS that allows flexible Rx traffic steering.h]h)}(hEThe ENA device supports RSS that allows flexible Rx traffic steering.h]hEThe ENA device supports RSS that allows flexible Rx traffic steering.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMahjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h0Toeplitz and CRC32 hash functions are supported.h]h)}(hjh]h0Toeplitz and CRC32 hash functions are supported.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMchjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hYDifferent combinations of L2/L3/L4 fields can be configured as inputs for hash functions.h]h)}(hYDifferent combinations of L2/L3/L4 fields can be configured as inputs for hash functions.h]hYDifferent combinations of L2/L3/L4 fields can be configured as inputs for hash functions.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMdhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hThe driver configures RSS settings using the AQ SetFeature command (ENA_ADMIN_RSS_HASH_FUNCTION, ENA_ADMIN_RSS_HASH_INPUT and ENA_ADMIN_RSS_INDIRECTION_TABLE_CONFIG properties).h]h)}(hThe driver configures RSS settings using the AQ SetFeature command (ENA_ADMIN_RSS_HASH_FUNCTION, ENA_ADMIN_RSS_HASH_INPUT and ENA_ADMIN_RSS_INDIRECTION_TABLE_CONFIG properties).h]hThe driver configures RSS settings using the AQ SetFeature command (ENA_ADMIN_RSS_HASH_FUNCTION, ENA_ADMIN_RSS_HASH_INPUT and ENA_ADMIN_RSS_INDIRECTION_TABLE_CONFIG properties).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMfhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hIf the NETIF_F_RXHASH flag is set, the 32-bit result of the hash function delivered in the Rx CQ descriptor is set in the received SKB.h]h)}(hIf the NETIF_F_RXHASH flag is set, the 32-bit result of the hash function delivered in the Rx CQ descriptor is set in the received SKB.h]hIf the NETIF_F_RXHASH flag is set, the 32-bit result of the hash function delivered in the Rx CQ descriptor is set in the received SKB.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMihjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hjThe user can provide a hash key, hash function, and configure the indirection table through `ethtool(8)`. h]h)}(hiThe user can provide a hash key, hash function, and configure the indirection table through `ethtool(8)`.h](h\The user can provide a hash key, hash function, and configure the indirection table through }(hj-hhhNhNubj )}(h `ethtool(8)`h]h ethtool(8)}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj-ubh.}(hj-hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMlhj)ubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhMahjhhubeh}(h]rssah ]h"]rssah$]h&]uh1hhhhhhhhM_ubh)}(hhh](h)}(hDEVLINK SUPPORTh]hDEVLINK SUPPORT}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjahhhhhMpubj )}(hS.. _`devlink`: https://www.kernel.org/doc/html/latest/networking/devlink/index.htmlh]h}(h]devlinkah ]h"]devlinkah$]h&]j& Dhttps://www.kernel.org/doc/html/latest/networking/devlink/index.htmluh1j hMqhjahhhhj Kubh)}(hZ`devlink`_ supports reloading the driver and initiating re-negotiation with the ENA deviceh](j)}(h `devlink`_h]hdevlink}(hjhhhNhNubah}(h]h ]h"]h$]h&]namedevlinkj& j~uh1jhjjKubhP supports reloading the driver and initiating re-negotiation with the ENA device}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMshjahhubj )}(hnsudo devlink dev reload pci/ # for example: sudo devlink dev reload pci/0000:00:06.0h]hnsudo devlink dev reload pci/ # for example: sudo devlink dev reload pci/0000:00:06.0}hjsbah}(h]h ]h"]h$]h&]hhj j shellj }uh1j hhhMuhjahhubeh}(h]devlink-supportah ]h"]devlink supportah$]h&]uh1hhhhhhhhMpubh)}(hhh](h)}(h DATA PATHh]h DATA PATH}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM|ubh)}(hhh](h)}(hTxh]hTx}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hR:code:`ena_start_xmit()` is called by the stack. This function does the following:h](j* )}(h:code:`ena_start_xmit()`h]hena_start_xmit()}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]languagehuh1j) hjubh: is called by the stack. This function does the following:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj)}(hhh](j)}(h,Maps data buffers (``skb->data`` and frags).h]h)}(hjh](hMaps data buffers (}(hjhhhNhNubj* )}(h ``skb->data``h]h skb->data}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j) hjubh and frags).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hVPopulates ``ena_buf`` for the push buffer (if the driver and device are in push mode).h]h)}(hVPopulates ``ena_buf`` for the push buffer (if the driver and device are in push mode).h](h Populates }(hj$hhhNhNubj* )}(h ``ena_buf``h]hena_buf}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1j) hj$ubhA for the push buffer (if the driver and device are in push mode).}(hj$hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h*Prepares ENA bufs for the remaining frags.h]h)}(hjLh]h*Prepares ENA bufs for the remaining frags.}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjJubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hAllocates a new request ID from the empty ``req_id`` ring. The request ID is the index of the packet in the Tx info. This is used for out-of-order Tx completions.h]h)}(hAllocates a new request ID from the empty ``req_id`` ring. The request ID is the index of the packet in the Tx info. This is used for out-of-order Tx completions.h](h*Allocates a new request ID from the empty }(hjehhhNhNubj* )}(h ``req_id``h]hreq_id}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1j) hjeubhn ring. The request ID is the index of the packet in the Tx info. This is used for out-of-order Tx completions.}(hjehhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjaubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h3Adds the packet to the proper place in the Tx ring.h]h)}(hjh]h3Adds the packet to the proper place in the Tx ring.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hXCalls :code:`ena_com_prepare_tx()`, an ENA communication layer that converts the ``ena_bufs`` to ENA descriptors (and adds meta ENA descriptors as needed). * This function also copies the ENA descriptors and the push buffer to the Device memory space (if in push mode). h](h)}(hCalls :code:`ena_com_prepare_tx()`, an ENA communication layer that converts the ``ena_bufs`` to ENA descriptors (and adds meta ENA descriptors as needed).h](hCalls }(hjhhhNhNubj* )}(h:code:`ena_com_prepare_tx()`h]hena_com_prepare_tx()}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]languagehuh1j) hjubh/, an ENA communication layer that converts the }(hjhhhNhNubj* )}(h ``ena_bufs``h]hena_bufs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j) hjubh> to ENA descriptors (and adds meta ENA descriptors as needed).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hhh]j)}(hpThis function also copies the ENA descriptors and the push buffer to the Device memory space (if in push mode). h]h)}(hoThis function also copies the ENA descriptors and the push buffer to the Device memory space (if in push mode).h]hoThis function also copies the ENA descriptors and the push buffer to the Device memory space (if in push mode).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]j*uh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjhhhNhNubj)}(h$Writes a doorbell to the ENA device.h]h)}(hjh]h$Writes a doorbell to the ENA device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hRWhen the ENA device finishes sending the packet, a completion interrupt is raised.h]h)}(hRWhen the ENA device finishes sending the packet, a completion interrupt is raised.h]hRWhen the ENA device finishes sending the packet, a completion interrupt is raised.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h%The interrupt handler schedules NAPI.h]h)}(hj2h]h%The interrupt handler schedules NAPI.}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj0ubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hXThe :code:`ena_clean_tx_irq()` function is called. This function handles the completion descriptors generated by the ENA, with a single completion descriptor per completed packet. * ``req_id`` is retrieved from the completion descriptor. The ``tx_info`` of the packet is retrieved via the ``req_id``. The data buffers are unmapped and ``req_id`` is returned to the empty ``req_id`` ring. * The function stops when the completion descriptors are completed or the budget is reached. :h](h)}(hThe :code:`ena_clean_tx_irq()` function is called. This function handles the completion descriptors generated by the ENA, with a single completion descriptor per completed packet.h](hThe }(hjKhhhNhNubj* )}(h:code:`ena_clean_tx_irq()`h]hena_clean_tx_irq()}(hjShhhNhNubah}(h]h ]j ah"]h$]h&]languagehuh1j) hjKubh function is called. This function handles the completion descriptors generated by the ENA, with a single completion descriptor per completed packet.}(hjKhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjGubj)}(hhh](j)}(h``req_id`` is retrieved from the completion descriptor. The ``tx_info`` of the packet is retrieved via the ``req_id``. The data buffers are unmapped and ``req_id`` is returned to the empty ``req_id`` ring.h]h)}(h``req_id`` is retrieved from the completion descriptor. The ``tx_info`` of the packet is retrieved via the ``req_id``. The data buffers are unmapped and ``req_id`` is returned to the empty ``req_id`` ring.h](j* )}(h ``req_id``h]hreq_id}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1j) hjsubh2 is retrieved from the completion descriptor. The }(hjshhhNhNubj* )}(h ``tx_info``h]htx_info}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j) hjsubh$ of the packet is retrieved via the }(hjshhhNhNubj* )}(h ``req_id``h]hreq_id}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j) hjsubh$. The data buffers are unmapped and }(hjshhhNhNubj* )}(h ``req_id``h]hreq_id}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j) hjsubh is returned to the empty }(hjshhhNhNubj* )}(h ``req_id``h]hreq_id}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j) hjsubh ring.}(hjshhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjoubah}(h]h ]h"]h$]h&]uh1jhjlubj)}(h[The function stops when the completion descriptors are completed or the budget is reached. h]h)}(hZThe function stops when the completion descriptors are completed or the budget is reached.h]hZThe function stops when the completion descriptors are completed or the budget is reached.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjlubeh}(h]h ]h"]h$]h&]jjuh1jhhhMhjGubeh}(h]h ]h"]h$]h&]uh1jhjhhhNhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhMhjhhubeh}(h]txah ]h"]txah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hRxh]hRx}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubj)}(hhh](j)}(h.When a packet is received from the ENA device.h]h)}(hj%h]h.When a packet is received from the ENA device.}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj#ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubj)}(h%The interrupt handler schedules NAPI.h]h)}(hj<h]h%The interrupt handler schedules NAPI.}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj:ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubj)}(hThe :code:`ena_clean_rx_irq()` function is called. This function calls :code:`ena_com_rx_pkt()`, an ENA communication layer function, which returns the number of descriptors used for a new packet, and zero if no new packet is found.h]h)}(hThe :code:`ena_clean_rx_irq()` function is called. This function calls :code:`ena_com_rx_pkt()`, an ENA communication layer function, which returns the number of descriptors used for a new packet, and zero if no new packet is found.h](hThe }(hjUhhhNhNubj* )}(h:code:`ena_clean_rx_irq()`h]hena_clean_rx_irq()}(hj]hhhNhNubah}(h]h ]j ah"]h$]h&]languagehuh1j) hjUubh) function is called. This function calls }(hjUhhhNhNubj* )}(h:code:`ena_com_rx_pkt()`h]hena_com_rx_pkt()}(hjphhhNhNubah}(h]h ]j ah"]h$]h&]languagehuh1j) hjUubh, an ENA communication layer function, which returns the number of descriptors used for a new packet, and zero if no new packet is found.}(hjUhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjQubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubj)}(hX:code:`ena_rx_skb()` checks packet length: * If the packet is small (len < rx_copybreak), the driver allocates a SKB for the new packet, and copies the packet payload into the SKB data buffer. - In this way the original data buffer is not passed to the stack and is reused for future Rx packets. * Otherwise the function unmaps the Rx buffer, sets the first descriptor as `skb`'s linear part and the other descriptors as the `skb`'s frags. h](h)}(h*:code:`ena_rx_skb()` checks packet length:h](j* )}(h:code:`ena_rx_skb()`h]h ena_rx_skb()}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]languagehuh1j) hjubh checks packet length:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hhh](j)}(hIf the packet is small (len < rx_copybreak), the driver allocates a SKB for the new packet, and copies the packet payload into the SKB data buffer. - In this way the original data buffer is not passed to the stack and is reused for future Rx packets. h](h)}(hIf the packet is small (len < rx_copybreak), the driver allocates a SKB for the new packet, and copies the packet payload into the SKB data buffer.h]hIf the packet is small (len < rx_copybreak), the driver allocates a SKB for the new packet, and copies the packet payload into the SKB data buffer.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hhh]j)}(heIn this way the original data buffer is not passed to the stack and is reused for future Rx packets. h]h)}(hdIn this way the original data buffer is not passed to the stack and is reused for future Rx packets.h]hdIn this way the original data buffer is not passed to the stack and is reused for future Rx packets.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]jjuh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hOtherwise the function unmaps the Rx buffer, sets the first descriptor as `skb`'s linear part and the other descriptors as the `skb`'s frags. h]h)}(hOtherwise the function unmaps the Rx buffer, sets the first descriptor as `skb`'s linear part and the other descriptors as the `skb`'s frags.h](hJOtherwise the function unmaps the Rx buffer, sets the first descriptor as }(hjhhhNhNubj )}(h`skb`h]hskb}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh2’s linear part and the other descriptors as the }(hjhhhNhNubj )}(h`skb`h]hskb}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh ’s frags.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]jjuh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhj hhhNhNubj)}(hThe new SKB is updated with the necessary information (protocol, checksum hw verify result, etc), and then passed to the network stack, using the NAPI interface function :code:`napi_gro_receive()`. h]h)}(hThe new SKB is updated with the necessary information (protocol, checksum hw verify result, etc), and then passed to the network stack, using the NAPI interface function :code:`napi_gro_receive()`.h](hThe new SKB is updated with the necessary information (protocol, checksum hw verify result, etc), and then passed to the network stack, using the NAPI interface function }(hj8hhhNhNubj* )}(h:code:`napi_gro_receive()`h]hnapi_gro_receive()}(hj@hhhNhNubah}(h]h ]j ah"]h$]h&]languagehuh1j) hj8ubh.}(hj8hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj4ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubeh}(h]h ]h"]h$]h&]jjuh1jhhhMhjhhubeh}(h]rxah ]h"]rxah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(hDynamic RX Buffers (DRB)h]hDynamic RX Buffers (DRB)}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1hhjmhhhhhMubh)}(hXGEach RX descriptor in the RX ring is a single memory page (which is either 4KB or 16KB long depending on system's configurations). To reduce the memory allocations required when dealing with a high rate of small packets, the driver tries to reuse the remaining RX descriptor's space if more than 2KB of this page remain unused.h]hXKEach RX descriptor in the RX ring is a single memory page (which is either 4KB or 16KB long depending on system’s configurations). To reduce the memory allocations required when dealing with a high rate of small packets, the driver tries to reuse the remaining RX descriptor’s space if more than 2KB of this page remain unused.}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjmhhubh)}(hGA simple example of this mechanism is the following sequence of events:h]hGA simple example of this mechanism is the following sequence of events:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjmhhubj )}(hX1. Driver allocates page-sized RX buffer and passes it to hardware +----------------------+ |4KB RX Buffer | +----------------------+ 2. A 300Bytes packet is received on this buffer 3. The driver increases the ref count on this page and returns it back to HW as an RX buffer of size 4KB - 300Bytes = 3796 Bytes +----+--------------------+ |****|3796 Bytes RX Buffer| +----+--------------------+h]hX1. Driver allocates page-sized RX buffer and passes it to hardware +----------------------+ |4KB RX Buffer | +----------------------+ 2. A 300Bytes packet is received on this buffer 3. The driver increases the ref count on this page and returns it back to HW as an RX buffer of size 4KB - 300Bytes = 3796 Bytes +----+--------------------+ |****|3796 Bytes RX Buffer| +----+--------------------+}hjsbah}(h]h ]h"]h$]h&]hhuh1j hhhMhjmhhubh)}(hXThis mechanism isn't used when an XDP program is loaded, or when the RX packet is less than rx_copybreak bytes (in which case the packet is copied out of the RX buffer into the linear part of a new skb allocated for it and the RX buffer remains the same size, see `RX copybreak`_).h](hX This mechanism isn’t used when an XDP program is loaded, or when the RX packet is less than rx_copybreak bytes (in which case the packet is copied out of the RX buffer into the linear part of a new skb allocated for it and the RX buffer remains the same size, see }(hjhhhNhNubj)}(h`RX copybreak`_h]h RX copybreak}(hjhhhNhNubah}(h]h ]h"]h$]h&]name RX copybreakjj uh1jhjjKubh).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjmhhubeh}(h]dynamic-rx-buffers-drbah ]h"]dynamic rx buffers (drb)ah$]h&]uh1hhjhhhhhMubeh}(h] data-pathah ]h"] data pathah$]h&]uh1hhhhhhhhM|ubeh}(h]:linux-kernel-driver-for-elastic-network-adapter-ena-familyah ]h"]