Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Use kpause() instead of DELAY() and sleep a mini...



details:   https://anonhg.NetBSD.org/src/rev/113afbdfc74b
branches:  trunk
changeset: 757021:113afbdfc74b
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Aug 11 09:36:44 2010 +0000

description:
Use kpause() instead of DELAY() and sleep a minimum of 1 tick.
This is possible now since softints have a thread context.  It's
also not a very frequent code path.  Addresses ABI issue with delay
(kern/40505).

I'm not entire sure what this delay is meant to accomplish, though.

diffstat:

 sys/netinet/ip_carp.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r 19aac8b8078b -r 113afbdfc74b sys/netinet/ip_carp.c
--- a/sys/netinet/ip_carp.c     Tue Aug 10 21:57:44 2010 +0000
+++ b/sys/netinet/ip_carp.c     Wed Aug 11 09:36:44 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_carp.c,v 1.42 2010/08/10 21:46:12 pooka Exp $       */
+/*     $NetBSD: ip_carp.c,v 1.43 2010/08/11 09:36:44 pooka Exp $       */
 /*     $OpenBSD: ip_carp.c,v 1.113 2005/11/04 08:11:54 mcbride Exp $   */
 
 /*
@@ -30,7 +30,7 @@
 #include "opt_inet.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.42 2010/08/10 21:46:12 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.43 2010/08/11 09:36:44 pooka Exp $");
 
 /*
  * TODO:
@@ -1149,7 +1149,9 @@
 
                in = &ifatoia(ifa)->ia_addr.sin_addr;
                arprequest(sc->sc_carpdev, in, in, CLLADDR(sc->sc_if.if_sadl));
-               DELAY(1000);    /* XXX */
+
+               /* XXX: why does this need to delay? */
+               kpause("carpdel", false, MIN(1, mstohz(1)), NULL);
        }
        splx(s);
 }
@@ -1171,7 +1173,9 @@
                in6 = &ifatoia6(ifa)->ia_addr.sin6_addr;
                nd6_na_output(sc->sc_carpdev, &mcast, in6,
                    ND_NA_FLAG_OVERRIDE, 1, NULL);
-               DELAY(1000);    /* XXX */
+
+               /* XXX: why does this need to delay? */
+               kpause("carpdel6", false, MIN(1, mstohz(1)), NULL);
        }
        splx(s);
 }



Home | Main Index | Thread Index | Old Index