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.

Details

Provenance
dgr_semihalf.comAuthored on Jan 3 2022, 1:50 PM
mwCommitted on Jan 23 2022, 7:48 PM
Parents
rGb168d0c850f3: ena: rework tx req_id validation logic
Branches
Unknown
Tags
Unknown