]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ena: Move ena_copy_eni_metrics into separate task
authorDawid Gorecki <dgr@semihalf.com>
Fri, 10 Jun 2022 09:18:10 +0000 (11:18 +0200)
committerMarcin Wojtas <mw@FreeBSD.org>
Thu, 30 Jun 2022 15:31:53 +0000 (17:31 +0200)
commitb899a02ad7330cae3c9bb08ad7975601dc3b9551
tree1951640ed355b8f1b52a10bf0efe0d677694a147
parent0ac122c388d9a5e189e60378f1950b82a22bbdd1
ena: Move ena_copy_eni_metrics into separate task

Copying ENI metrics was done in callout context, this caused the driver
to panic when sample_interval was set to a value other than 0, as the
admin queue call which was executed could sleep while waiting on
a condition variable. Taskqueue, unlike callout, allows for sleeping, so
moving the function to a separate taskqueue fixes the problem.
ena_timer_service is still responsible for scheduling the taskqueue.

Stop draining the callout during ena_up/ena_down. This was done to
prevent a race between ena_up/down and ena_copy_eni_metrics admin queue
calls. Since ena_metrics_task is protected by ENA_LOCK there is no
possibility of a race between ena_up/down and ena_metrics_task.

Remove a comment about locking in ena_timer_service. With ENI metrics
in a separate task this comment became obsolete.

Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
sys/dev/ena/ena.c
sys/dev/ena/ena.h