From ce189363a0ec4e65f27076207a88142a8554bfbb Mon Sep 17 00:00:00 2001 From: gallatin Date: Wed, 24 Jun 2009 21:09:56 +0000 Subject: Add a dying flag to prevent races at detach. I tried re-ordering ether_ifdetach(), but this created a new race where sometimes, when under heavy receive load (>1Mpps) and running tcpdump, the machine would panic. At panic, the ithread was still in the original (not dead) if_input() path, and was accessing stale BPF data structs. By using a dying flag, I can close the interface prior to if_detach() to be certain the interface cannot send packets up in the middle of ether_ifdetach. --- sys/dev/mxge/if_mxge_var.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/dev/mxge/if_mxge_var.h') diff --git a/sys/dev/mxge/if_mxge_var.h b/sys/dev/mxge/if_mxge_var.h index 8d1da2e..47c39b5 100644 --- a/sys/dev/mxge/if_mxge_var.h +++ b/sys/dev/mxge/if_mxge_var.h @@ -266,6 +266,7 @@ struct mxge_softc { int need_media_probe; int num_slices; int rx_ring_size; + int dying; mxge_dma_t dmabench_dma; struct callout co_hdl; struct sysctl_oid *slice_sysctl_tree; -- cgit v1.1