[Bug 259458] iflib_rxeof NULL pointer crash with vmxnet3 driver

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 08 Nov 2021 09:14:46 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259458

--- Comment #18 from Andriy Gapon <avg@FreeBSD.org> ---
I think that comment #13 could be on spot.
After applying the following patch the problem hasn't been seen for several
days (whereas previously it happened at least once per day on one of test
machines).

@@ -2572,7 +2572,8 @@
                        bzero((void *)di->idi_vaddr, di->idi_size);
        }
        for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) {
-               /* make sure all transmitters have completed before proceeding
XXX */
+               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++)

I cannot come up with an exact interaction between threads that could lead to
the symptoms, but there certainly was a data race.
I used anonymous dtrace to capture initial network configuration and I saw some
interleaving between _task_fn_rx and iflib_if_ioctl -> iflib_stop /
iflib_init_locked. One specific ioctl that I saw was SIOCSIFCAP.

-- 
You are receiving this mail because:
You are the assignee for the bug.