Skip to content

Commit

Permalink
iflib: Add null check to iflib_stop()
Browse files Browse the repository at this point in the history
Ever since gtaskqueue_drain() was added to iflib_stop(), a kernel panic
occurs when the ice(4) driver is in recovery mode. Queues are not
initialized in this mode, so gt_taskqueue is not initialized, and
gtaskqueue_drain() will panic.

Fix this by only doing a drain if an RX queue's gt_taskqueue is
initialized.

Signed-off-by: Eric Joyner <[email protected]>

Reviewed by:	erj@
MFC after:	1 week
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D37892

(cherry picked from commit 9147969bc277b389a62373c6a5050a2ebfd39071)
  • Loading branch information
plewandx authored and laffer1 committed Jun 27, 2023
1 parent be57d40 commit e6d28f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sys/net/iflib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2691,8 +2691,9 @@ iflib_stop(if_ctx_t ctx)
bzero((void *)di->idi_vaddr, di->idi_size);
}
for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) {
gtaskqueue_drain(rxq->ifr_task.gt_taskqueue,
&rxq->ifr_task.gt_task);
if (rxq->ifr_task.gt_taskqueue != NULL)
gtaskqueue_drain(rxq->ifr_task.gt_taskqueue,
&rxq->ifr_task.gt_task);

rxq->ifr_cq_cidx = 0;
for (j = 0, di = rxq->ifr_ifdi; j < sctx->isc_nrxqs; j++, di++)
Expand Down

0 comments on commit e6d28f1

Please sign in to comment.