]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ena: start timer service on attach
authorDawid Gorecki <dgr@semihalf.com>
Mon, 3 Jan 2022 13:50:13 +0000 (14:50 +0100)
committerMarcin Wojtas <mw@FreeBSD.org>
Sun, 23 Jan 2022 19:48:32 +0000 (20:48 +0100)
commit78554d0c707c9401dbae53fb8bc65d291a5a09a5
treed7b02e8729b7a13c1efa389db37c31990871102a
parentb168d0c850f34e8178d815ba3a87de2657a02ca9
ena: start timer service on attach

The timer service was started when the interface was brought up and it
was stopped when it was brought down. Since ena_up requires the device
to be responsive, triggering the reset would become impossible if the
device became unresponsive with the interface down.

Since most of the functions in timer service already perform the check
to see if the device is running, this only requires starting the callout
in attach and stopping it when bringing the interface up or down to
avoid race between different admin queue calls.

Since callout functions for timer service are always called with the
same arguments, replace callout_{init,reset,drain} calls with
ENA_TIMER_{INIT,RESET,DRAIN} macros.

Submitted by: Dawid Gorecki <dgr@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
sys/dev/ena/ena.c
sys/dev/ena/ena.h