Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Mar 2010 20:13:09 +0000 (UTC)
From:      Andrew Gallatin <gallatin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r205255 - head/sys/dev/mxge
Message-ID:  <201003172013.o2HKD9MC004953@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gallatin
Date: Wed Mar 17 20:13:09 2010
New Revision: 205255
URL: http://svn.freebsd.org/changeset/base/205255

Log:
  Fix 2 bugs in mxge_attach()
  
  - Don't leak slice resources when mxge_alloc_rings() fails
  
  - Start taskq threads only after we know attach will succeed.  At
    boot time, taskqueue_terminate() will loop infinately, waiting
    for the threads to exit, and hang the system.
  
  Submitted by: Panasas
  MFC After: 3 days

Modified:
  head/sys/dev/mxge/if_mxge.c

Modified: head/sys/dev/mxge/if_mxge.c
==============================================================================
--- head/sys/dev/mxge/if_mxge.c	Wed Mar 17 20:01:01 2010	(r205254)
+++ head/sys/dev/mxge/if_mxge.c	Wed Mar 17 20:13:09 2010	(r205255)
@@ -4616,8 +4616,6 @@ mxge_attach(device_t dev)
 		err = ENOMEM;
 		goto abort_with_nothing;
 	}
-	taskqueue_start_threads(&sc->tq, 1, PI_NET, "%s taskq",
-				device_get_nameunit(sc->dev));
 
 	err = bus_dma_tag_create(NULL,			/* parent */
 				 1,			/* alignment */
@@ -4723,7 +4721,7 @@ mxge_attach(device_t dev)
 	err = mxge_alloc_rings(sc);
 	if (err != 0) {
 		device_printf(sc->dev, "failed to allocate rings\n");
-		goto abort_with_dmabench;
+		goto abort_with_slices;
 	}
 
 	err = mxge_add_irq(sc);
@@ -4781,6 +4779,8 @@ mxge_attach(device_t dev)
 	ifp->if_transmit = mxge_transmit;
 	ifp->if_qflush = mxge_qflush;
 #endif
+	taskqueue_start_threads(&sc->tq, 1, PI_NET, "%s taskq",
+				device_get_nameunit(sc->dev));
 	callout_reset(&sc->co_hdl, mxge_ticks, mxge_tick, sc);
 	return 0;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003172013.o2HKD9MC004953>