Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe PR/49328: Uwe Toenjes: This driver allocat...



details:   https://anonhg.NetBSD.org/src/rev/2a4f49e93e32
branches:  trunk
changeset: 335877:2a4f49e93e32
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jan 28 00:30:25 2015 +0000

description:
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

diffstat:

 sys/dev/pci/ixgbe/ixgbe_netbsd.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r baab307d798d -r 2a4f49e93e32 sys/dev/pci/ixgbe/ixgbe_netbsd.c
--- a/sys/dev/pci/ixgbe/ixgbe_netbsd.c  Tue Jan 27 21:34:43 2015 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_netbsd.c  Wed Jan 28 00:30:25 2015 +0000
@@ -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 @@
 
        *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_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;



Home | Main Index | Thread Index | Old Index