HomeFreeBSD

ena: start timer service on attach

Description

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.

(cherry picked from commit 78554d0c707c9401dbae53fb8bc65d291a5a09a5)

Details

Provenance
dgr_semihalf.comAuthored on Jan 3 2022, 1:50 PM
mwCommitted on Feb 24 2022, 12:53 PM
Parents
rGdbc92a6d9d2b: ena: rework tx req_id validation logic
Branches
Unknown
Tags
Unknown