History log of /freebsd-11-stable/sys/dev/ena/ena.h
Revision Date Author Comments
# 369337 22-Feb-2021 mw

MFC 1c808fcd859f: Allocate BAR for ENA MSIx vector table

In the new ENA-based instances like c6gn, the vector table moved to a
new PCIe bar - BAR1. Previously it was always located on the BAR0, so
the resources were already allocated together with the registers.

As the FreeBSD isn't doing any resource allocation behind the scenes,
the driver is responsible to allocate them explicitly, before other
parts of the OS (like the PCI code allocating MSIx) will be able to
access them.

To determine dynamically BAR on which the MSIx vector table is present
the pci_msix_table_bar() is being used and the new BAR is allocated if
needed.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc

(cherry picked from commit 1c808fcd859f5ce24132a903a4c7c9996e0513b1)

Git Hash: 79474cbd9bc4c72dd8d75028aedc104af562623c
Git Author: mk@semihalf.com


# 368013 25-Nov-2020 mw

MFC: Merge ENA v2.3.0 driver

r367805 Update ENA driver version to v2.3.0
r367803 Rename descriptions of the supported ENA devices
r367802 Add ENI metrics for the ENA driver
r367801 Add SPDX license tag to the ENA driver files
r367800 Add Rx offsets support for the ENA driver
r367799 Adjust ENA driver files to latest ena-com changes
r367795 Fix completion descriptors alignment for the ENA

Obtained from: Semihalf
Sponsored by: Amazon, Inc


# 361534 26-May-2020 mw

MFC: Merge ENA v2.2.0 driver

r361530 Update ENA driver version to v2.2.0
r361529 Refactor ena_tx_map_mbuf() function
r361528 Fix double-free bug within ena_detach()
r361527 Allow disabling meta caching for ENA Tx path
r361526 Create ENA IO queues with optional backoff
r361525 Add sysctl node for ENA IO queues number adjustment
r361524 Fix assumptions about number of IO queues in the ENA
r361523 Rework ENA Tx buffer ring size reconfiguration
r361521 Rework ENA Rx queue size configuration
r361518 Improve indentation in ena_up() and ena_down()
r361517 Expose argument names for non static ENA driver functions
r361516 Use single global lock in the ENA driver
r361515 Add trigger reset function in the ENA driver
r361514 Provide ENA driver version in a sysctl node
r361513 Remove unused argument from static function in ena.c
r361512 Enable Tx drops reporting in the ENA driver
r361511 Adjust ENA driver to the new HAL

Sponsored by: Amazon, Inc.


# 361468 25-May-2020 mw

MFC: ENA netmap support and bug fixes

r360777 Optimize ENA Rx refill for low memory conditions
r358289 Rework and simplify Tx DMA mapping in ENA
r354242 Make valdiate_rx_req_id static inline because it uses other static
r354225 Update ENA version to v2.1.0
r354224 Add support for ENA NETMAP partial initialization
r354223 Add support for ENA NETMAP Tx
r354222 Add support for ENA NETMAP Rx
r354221 Introduce NETMAP support in ENA
r354220 Split Rx/Tx from initialization code in ENA driver
r354219 Fix ENA keep-alive timeout due to prolonged reset

Sponsored by: Amazon, Inc.


# 361467 25-May-2020 mw

MFC: Merge ENA v2.0.0 driver

r348416 Update ENA version to v2.0.0
r348414 Fix ENA manual issues
r348413 Improve ENA reset handling
r348412 Fix NULL pointer dereference in ena_up()
r348411 Unify new line characters in the ENA driver
r348410 Fix Tx offloads for fragmented pkt headers in ENA
r348409 Split ENA reset routine into restore and destroy stages
r348408 Use bitfield for storing global ENA device states
r348407 Fix error handling when ENA reset fails
r348406 Fill bdf field of the host_info structure in ENA
r348405 Add additional doorbells on ENA Tx path
r348404 Limit maximum size of Rx refill threshold in ENA
r348403 Add support for the LLQv2 and WC in ENA
r348402 Lock optimization in ENA
r348401 Add tuneable drbr ring size and hw queues depth for ENA
r348400 Fix error in validate_tx_req_id() in ENA
r348399 Change attach order to prevent crash upon failure in ENA
r348398 Change order of ifp release on ENA detach
r348397 Check for number of MSI-x upon partial allocation in ENA
r348396 Set error value when allocation of IO irq fails in ENA
r348395 Set vaddr and paddr as NULL when DMA alloc fails in ENA
r348394 Fix DMA synchronization in the ENA driver Tx and Rx paths
r348393 Check for missing MSI-x and Tx completions in ENA
r348392 Fill number of CPUs field on ENA host_info structure
r348391 Print ENA Tx error conditionally
r348390 Trigger reset in ENA if there are too many Rx descriptors
r348389 Remove RSS support in ENA
r348388 Add notification AENQ handler for ENA
r348387 Print information when ENA admin error occurs
r348386 Do not specify active media type in ENA
r348385 Adjust ENA driver to the new ena-com

Sponsored by: Amazon, Inc.


# 345871 04-Apr-2019 mw

MFC r345371: Prevent double activation of admin interrupt in ENA

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.


# 344575 26-Feb-2019 mw

Merge ENA OOO RX fixes

MFC r344150-r344151

Obtained from: Semihalf
Sponsored by: Amazon, Inc.


# 343398 24-Jan-2019 mw

MFC: Second part of Amazon ENA driver fixes and improvements

Now, the driver functionality is aligned with the latest version in HEAD.

r343074 Suppress excessive error prints in ENA TX hotpath
r336099 Add PNP info to PCI attachment of ena driver
r333456 Do not pass header length to the ENA controller
r333453 Apply fixes in ena-com
r333450 Upgrade ENA version to v0.8.1
r325593 Fix setting AENQ group in ENA driver
r325592 Allow usage of more RX descriptors than 1 in ENA driver
r325591 Read max MTU from the ENA device
r325590 Fix calculating io queues number in ENA driver
r325589 Rework printouts and logging level in ENA driver
r325587 Fix comparing L3 type with L4 enum on RX hash in ENA driver
r325586 Fix compilation warnings when building ENA driver with gcc compiler
r325585 Fix checking if the DF flag was set in ENA driver
r325584 Cleanup of the ENA driver header file
r325583 Allow partial MSI-x allocation in ENA driver
r325582 Remove deprecated and unused counters in ENA driver
r325581 Cover ENA driver code with branch predictioning statements

Sponsored by: Amazon, Inc.


# 343397 24-Jan-2019 mw

MFC: First part of Amazon ENA driver fixes and improvements

r325580 Refactor style of the ENA driver
r325579 Fix error handling in the ENA driver and lock drbr_free() call
r325578 Destroy admin queue after freeing interrupts in ENA driver
r325577 Split function checking for missing TX completion in ENA driver
r325576 Check for Rx ring state to prevent from stall in the ENA driver
r325574 Add RX OOO completion feature
r325512 Change function validate_tx_req_id() to inline in ENA driver
r325511 Fix ENA driver error handling in attach and basic style fixes
r325239 Rework counting of hardware statistics in ENA driver
r325236 Update ena-com HAL to v1.1.4.3 and update driver accordingly

Sponsored by: Amazon, Inc.


# 320749 06-Jul-2017 cperciva

Fix up r320731:
* Record mergeinfo for merges of r317518, r318647, r319197, r319198,
r319199, r319201, r320625, r320626, r320628, r320629, r320630, r320631,
r320632.
* Merge r319200, which (commit message notwithstanding) seems to have
gotten lost from the r320731 merge.


# 320731 06-Jul-2017 zbb

MFC r317518, r318647, r319197, r319198, r319199, r319200, r320625, r320626,
r320628, r319201, r320629, r320630, r320631, r320632.

r317518:
Import Amazon Elastic Network Adapter (ENA) HAL to sys/contrib/

Import from vendor-sys/ena-com/1.1.4.1
SVN rev.: 317516
Version: 1.1.4.1

r318647:
Add support for Amazon Elastic Network Adapter (ENA) NIC

ENA is a networking interface designed to make good use of modern CPU
features and system architectures.

The ENA device exposes a lightweight management interface with a
minimal set of memory mapped registers and extendable command set
through an Admin Queue.

The driver supports a range of ENA devices, is link-speed independent
(i.e., the same driver is used for 10GbE, 25GbE, 40GbE, etc.), and has
a negotiated and extendable feature set.

Some ENA devices support SR-IOV. This driver is used for both the
SR-IOV Physical Function (PF) and Virtual Function (VF) devices.

ENA devices enable high speed and low overhead network traffic
processing by providing multiple Tx/Rx queue pairs (the maximum number
is advertised by the device via the Admin Queue), a dedicated MSI-X
interrupt vector per Tx/Rx queue pair, and CPU cacheline optimized
data placement.

The ENA driver supports industry standard TCP/IP offload features such
as checksum offload and TCP transmit segmentation offload (TSO).
Receive-side scaling (RSS) is supported for multi-core scaling.

The ENA driver and its corresponding devices implement health
monitoring mechanisms such as watchdog, enabling the device and driver
to recover in a manner transparent to the application, as well as
debug logs.

Some of the ENA devices support a working mode called Low-latency
Queue (LLQ), which saves several more microseconds. This feature will
be implemented for driver in future releases.

r319197:
Add mbuf defragmentation to the ENA driver

When mbuf chain is too long and device cannot handle that number
of segments in DMA transaction, mbuf chain will be defragmented.
Initially, driver was dropping all mbuf chains that were exceeding
supported number of segments.

r319198:
Add locks before each ena_up and ena_down

Lock only ena_up and ena_down calls in ioctl handler, instead of whole
ioctl. Locking ioctl with sx lock that is sleepable, is not allowed in
some cases, e.g. when multicast options are being changed.
Additional locking was added in deatch function to prevent race condition
with ioctl function.

r319199:
Add error handling to the ENA driver if init of the reset task fails

Also, to simplify cleaning routine, reset task is initialized before
allocating statistics and other resources.

r319200:
Move ENA's hw stats updating routine to separate task

Initially, stats were being updated each time OS was requesting for
the first statistic.
To read statistics from hw, condvar was used. cv_timedwait cannot be
called when unsleepable lock is held, and this happens when FreeBSD
is requesting statistic.
Seperate task is reading statistics from NIC each 1 second.

r319201:
Introduce additional locks when releasing TX resources and buffers in ENA

There could be race condition with TX cleaning routine when cleaning mbufs,
when it was called directly from main sending thread (ena_mq_start).

r320625:
Add missing lock upon initialization of the interface

Lack of this lock was causing crash if down was called in
parallel with the initialization routine.

r320626:
Acquire locks before calling drbr_flush()

It is required to hold lock that is associated with buffer ring before
flushing drbr.

r320628:
Unmask all IO irqs after driver state is set as running

If driver left MSI-x handlling routine because interface was put down,
it is not unmasking IRQs, so any requesting interrupt will be awaiting
for unmasking.

On ena_up() routine all interrupts are being unmasked and any awaiting
interrupt will be handled right away.

If handler was executed before driver state was set as running, handling
routine is being ended immediately, leaving IO irqs for given queue
masked.

r320629:
Call drbr_advance() before leaving TX routine

If drbr_advance() is not called before doing cleanup and packet is
already enqueued for sending (tx_info is holding pointer to mbuf), then
mbuf is cleaned both in drbr_flush() and in cleanup routine, when all
mbufs hold by tx_buffer_info are being released.

This causes panic, because mbuf is released twice.

r320630:
Remove RX mtx from ENA driver

RX lock is no longer required. There can only be one RX cleanup task
running at a time, RX cleanup cannot be executed if interface is not
yet initialized and ena_down() will not free any RX resources if any io
interrupt is being handled - RX cleanup task is only called from an
interrupt handler.

r320631:
Fix creation of dma tags and TSO settings

TSO settings were not reflecting real HW capabilities.

DMA tags were created with wrong window - high address was the same as
low, so excluding window was not working.

Capabilities of TX dma transaction were not set properly - TSO max size
had been increased and size of one segment had been adjusted.

r320632:
Replace mbuf defragmentation with collapse

Collapse should be more effective than defragmentation.
Added missing declaration of ena_check_and_collapse_mbuf().

Submitted by: Michal Krawczyk <mk@semihalf.com>
Jakub Palider <jpa@semihalf.com>
Jan Medala <jan@semihalf.com>
Obtained from: Semihalf, Amazon.com Inc.
Sponsored by: Amazon.com Inc.