Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/net/lib/libshmif Don't do timestamping with buslock...



details:   https://anonhg.NetBSD.org/src/rev/6c32c66781fe
branches:  trunk
changeset: 757119:6c32c66781fe
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sun Aug 15 18:40:41 2010 +0000

description:
Don't do timestamping with buslock held.  it's the little things ...

diffstat:

 sys/rump/net/lib/libshmif/if_shmem.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (39 lines):

diff -r fdae485271c7 -r 6c32c66781fe sys/rump/net/lib/libshmif/if_shmem.c
--- a/sys/rump/net/lib/libshmif/if_shmem.c      Sun Aug 15 16:36:24 2010 +0000
+++ b/sys/rump/net/lib/libshmif/if_shmem.c      Sun Aug 15 18:40:41 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_shmem.c,v 1.20 2010/08/13 10:13:44 pooka Exp $      */
+/*     $NetBSD: if_shmem.c,v 1.21 2010/08/15 18:40:41 pooka Exp $      */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.20 2010/08/13 10:13:44 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.21 2010/08/15 18:40:41 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -203,16 +203,16 @@
                        pktsize += m->m_len;
                }
 
-               shmif_lockbus(sc->sc_busmem);
-               lastoff = sc->sc_busmem->shm_last;
-               npktlenoff = shmif_nextpktoff(sc->sc_busmem, lastoff);
-
                getmicrouptime(&tv);
 
                sp.sp_len = pktsize;
                sp.sp_sec = tv.tv_sec;
                sp.sp_usec = tv.tv_usec;
 
+               shmif_lockbus(sc->sc_busmem);
+               lastoff = sc->sc_busmem->shm_last;
+               npktlenoff = shmif_nextpktoff(sc->sc_busmem, lastoff);
+
                dataoff = shmif_buswrite(sc->sc_busmem,
                    npktlenoff, &sp, sizeof(sp), &wrap);
                for (m = m0; m != NULL; m = m->m_next) {



Home | Main Index | Thread Index | Old Index