freebsd-nq/sys/dev/ena
Artur Rojek 07aff471c0 ena: Share ena_global_lock between driver instances
In order to use `ena_global_lock` in sysctl context, it must be kept
outside the driver instance's software context, as sysctls can be called
before attach and after detach, leading to lock use before sx_init and
after sx_destroy otherwise.
Solve this issue by turning `ena_global_lock` into a file scope
variable, shared between all instances of the driver and associated
sysctl context, and in turn initialized/destroyed in dedicated
SYSINIT/SYSUNINIT functions.
As a side effect, this change also fixes existing race in the reset
routine, when simultaneously accessing sysctl exposed properties.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
2021-09-02 01:06:37 +02:00
..
ena_datapath.c ena: Add locking assertions 2021-09-02 01:06:21 +02:00
ena_datapath.h Add SPDX license tag to the ENA driver files 2020-11-18 15:07:34 +00:00
ena_netmap.c ena: Share ena_global_lock between driver instances 2021-09-02 01:06:37 +02:00
ena_netmap.h Add SPDX license tag to the ENA driver files 2020-11-18 15:07:34 +00:00
ena_rss.c ena: Move RSS logic into its own source files 2021-09-02 01:06:26 +02:00
ena_rss.h ena: Move RSS logic into its own source files 2021-09-02 01:06:26 +02:00
ena_sysctl.c ena: Share ena_global_lock between driver instances 2021-09-02 01:06:37 +02:00
ena_sysctl.h ena: hide sysctl nodes for unused ENA queues 2021-06-24 16:02:39 +02:00
ena.c ena: Share ena_global_lock between driver instances 2021-09-02 01:06:37 +02:00
ena.h ena: Share ena_global_lock between driver instances 2021-09-02 01:06:37 +02:00