freebsd-dev/sys/dev/ena
Marcin Wojtas 6959869eae Use single global lock in the ENA driver
Currently, the driver had 2 global locks - one was sx lock used for
up/down synchronization and the second one was mutex, which was used
for link configuration and timer service callout.

It is better to have single lock for that. We cannot use mutex, as it
can sleep and cause witness errors in up/down configuration, so sx lock
seems to be the only choice.

Callout cannot use sx lock, but the timer service is MP safe, so we just
need to avoid race between ena_down() and ena_detach(). It can be
avoided by acquiring sx lock.

Simple macros were added that are encapsulating implementation of the
lock and makes the code cleaner.

Submitted by:  Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Amazon, Inc.
2020-05-26 15:39:41 +00:00
..
ena_datapath.c Add trigger reset function in the ENA driver 2020-05-26 15:37:55 +00:00
ena_datapath.h Split Rx/Tx from initialization code in ENA driver 2019-10-31 15:44:26 +00:00
ena_netmap.c Use single global lock in the ENA driver 2020-05-26 15:39:41 +00:00
ena_netmap.h Add support for ENA NETMAP partial initialization 2019-10-31 16:02:42 +00:00
ena_sysctl.c Provide ENA driver version in a sysctl node 2020-05-26 15:35:22 +00:00
ena_sysctl.h Optimize ENA Rx refill for low memory conditions 2020-05-07 11:28:39 +00:00
ena.c Use single global lock in the ENA driver 2020-05-26 15:39:41 +00:00
ena.h Use single global lock in the ENA driver 2020-05-26 15:39:41 +00:00