Source-Changes-HG archive

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

[src/trunk]: src/sys/net Remove KERNEL_LOCK for arpresolve in ether_output



details:   https://anonhg.NetBSD.org/src/rev/88ea4a9e2a78
branches:  trunk
changeset: 352284:88ea4a9e2a78
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Fri Mar 24 09:22:46 2017 +0000

description:
Remove KERNEL_LOCK for arpresolve in ether_output

Because arpresolve should be already MP-safe.

diffstat:

 sys/net/if_ethersubr.c |  13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)

diffs (42 lines):

diff -r 731b38f2beea -r 88ea4a9e2a78 sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c    Fri Mar 24 08:50:17 2017 +0000
+++ b/sys/net/if_ethersubr.c    Fri Mar 24 09:22:46 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ethersubr.c,v 1.239 2017/02/21 03:59:31 ozaki-r Exp $       */
+/*     $NetBSD: if_ethersubr.c,v 1.240 2017/03/24 09:22:46 ozaki-r Exp $       */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.239 2017/02/21 03:59:31 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.240 2017/03/24 09:22:46 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -246,23 +246,14 @@
 
 #ifdef INET
        case AF_INET:
-#ifndef NET_MPSAFE
-               KERNEL_LOCK(1, NULL);
-#endif
                if (m->m_flags & M_BCAST)
                        (void)memcpy(edst, etherbroadcastaddr, sizeof(edst));
                else if (m->m_flags & M_MCAST)
                        ETHER_MAP_IP_MULTICAST(&satocsin(dst)->sin_addr, edst);
                else if ((error = arpresolve(ifp, rt, m, dst, edst,
                    sizeof(edst))) != 0) {
-#ifndef NET_MPSAFE
-                       KERNEL_UNLOCK_ONE(NULL);
-#endif
                        return error == EWOULDBLOCK ? 0 : error;
                }
-#ifndef NET_MPSAFE
-               KERNEL_UNLOCK_ONE(NULL);
-#endif
                /* If broadcasting on a simplex interface, loopback a copy */
                if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
                        mcopy = m_copy(m, 0, (int)M_COPYALL);



Home | Main Index | Thread Index | Old Index