Module Name:    src
Committed By:   christos
Date:           Wed Jan 28 00:30:25 UTC 2015

Modified Files:
        src/sys/dev/pci/ixgbe: ixgbe_netbsd.c

Log Message:
PR/49328: Uwe Toenjes: This driver allocates memory always with NOWAIT, except
in the NetBSD-specific code. This happens from ioctl, and usually there is
enough memory there since we just freed our resources and we are getting them
back. We could even check and not do it again if sizes did not change, but
this is how the rest of the code is structured so we follow suit.
XXX: pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe_netbsd.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_netbsd.c:1.1 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c:1.2
--- src/sys/dev/pci/ixgbe/ixgbe_netbsd.c:1.1	Fri Aug 12 17:55:29 2011
+++ src/sys/dev/pci/ixgbe/ixgbe_netbsd.c	Tue Jan 27 19:30:25 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_netbsd.c,v 1.1 2011/08/12 21:55:29 dyoung Exp $ */
+/* $NetBSD: ixgbe_netbsd.c,v 1.2 2015/01/28 00:30:25 christos Exp $ */
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -56,7 +56,7 @@ ixgbe_dma_tag_create(bus_dma_tag_t dmat,
 
 	*dtp = NULL;
 
-	if ((dt = kmem_zalloc(sizeof(*dt), KM_SLEEP)) == NULL)
+	if ((dt = kmem_zalloc(sizeof(*dt), KM_NOSLEEP)) == NULL)
 		return ENOMEM;
 
 	dt->dt_dmat = dmat;
@@ -136,19 +136,19 @@ ixgbe_newext(ixgbe_extmem_head_t *eh, bu
 	ixgbe_extmem_t *em;
 	int nseg, rc;
 
-	em = kmem_zalloc(sizeof(*em), KM_SLEEP);
+	em = kmem_zalloc(sizeof(*em), KM_NOSLEEP);
 
 	if (em == NULL)
 		return NULL;
 
 	rc = bus_dmamem_alloc(dmat, size, PAGE_SIZE, 0, &em->em_seg, 1, &nseg,
-	    BUS_DMA_WAITOK);
+	    BUS_DMA_NOWAIT);
 
 	if (rc != 0)
 		goto post_zalloc_err;
 
 	rc = bus_dmamem_map(dmat, &em->em_seg, 1, size, &em->em_vaddr,
-	    BUS_DMA_WAITOK);
+	    BUS_DMA_NOWAIT);
 
 	if (rc != 0)
 		goto post_dmamem_err;

Reply via email to