PERFORCE change 35360 for review

Sam Leffler sam at FreeBSD.org
Fri Aug 1 14:18:27 PDT 2003


http://perforce.freebsd.org/chv.cgi?CH=35360

Change 35360 by sam at sam_ebb on 2003/08/01 14:18:01

	Change some malloc's to use M_NOWAIT to eliinate sleeping
	while holding a lock.  This is a bandaid to be fixed later
	since they should be able to block except for this code 
	being called on interface transitions and that should be
	handled by dispatching the operation to a context that can
	block.

Affected files ...

.. //depot/projects/netperf/sys/net/bridge.c#2 edit

Differences ...

==== //depot/projects/netperf/sys/net/bridge.c#2 (text+ko) ====

@@ -246,7 +246,7 @@
     }
     c[n_clusters].ht = (struct hash_table *)
 	    malloc(HASH_SIZE * sizeof(struct hash_table),
-		M_IFADDR, M_WAITOK | M_ZERO);
+		M_IFADDR, M_NOWAIT | M_ZERO);
     if (c[n_clusters].ht == NULL) {
 	printf("-- bridge: cannot allocate hash table for new cluster\n");
 	free(c, M_IFADDR);
@@ -254,7 +254,7 @@
     }
     c[n_clusters].my_macs = (struct bdg_addr *)
 	    malloc(BDG_MAX_PORTS * sizeof(struct bdg_addr),
-		M_IFADDR, M_WAITOK | M_ZERO);
+		M_IFADDR, M_NOWAIT | M_ZERO);
     if (c[n_clusters].my_macs == NULL) {
         printf("-- bridge: cannot allocate mac addr table for new cluster\n");
 	free(c[n_clusters].ht, M_IFADDR);


More information about the p4-projects mailing list