Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet after ip_input.c rev.1.285 and 1.286, restore ke...



details:   https://anonhg.NetBSD.org/src/rev/3867dbee1de5
branches:  trunk
changeset: 764254:3867dbee1de5
user:      yamt <yamt%NetBSD.org@localhost>
date:      Thu Apr 14 15:53:36 2011 +0000

description:
after ip_input.c rev.1.285 and 1.286, restore kernel_lock for if_output.

diffstat:

 sys/netinet/in_offload.c |  10 +++++++---
 sys/netinet/ip_output.c  |   8 ++++++--
 2 files changed, 13 insertions(+), 5 deletions(-)

diffs (77 lines):

diff -r 364aad5f00f1 -r 3867dbee1de5 sys/netinet/in_offload.c
--- a/sys/netinet/in_offload.c  Thu Apr 14 15:48:48 2011 +0000
+++ b/sys/netinet/in_offload.c  Thu Apr 14 15:53:36 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in_offload.c,v 1.3 2010/12/11 22:37:46 matt Exp $      */
+/*     $NetBSD: in_offload.c,v 1.4 2011/04/14 15:53:36 yamt Exp $      */
 
 /*-
  * Copyright (c)2005, 2006 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_offload.c,v 1.3 2010/12/11 22:37:46 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_offload.c,v 1.4 2011/04/14 15:53:36 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/mbuf.h>
@@ -53,8 +53,12 @@
 {
        struct ip_tso_output_args *args = vp;
        struct ifnet *ifp = args->ifp;
+       int error;
 
-       return (*ifp->if_output)(ifp, m, args->sa, args->rt);
+       KERNEL_LOCK(1, NULL);
+       error = (*ifp->if_output)(ifp, m, args->sa, args->rt);
+       KERNEL_UNLOCK_ONE(NULL);
+       return error;
 }
 
 int
diff -r 364aad5f00f1 -r 3867dbee1de5 sys/netinet/ip_output.c
--- a/sys/netinet/ip_output.c   Thu Apr 14 15:48:48 2011 +0000
+++ b/sys/netinet/ip_output.c   Thu Apr 14 15:53:36 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_output.c,v 1.207 2011/04/09 21:00:53 martin Exp $   */
+/*     $NetBSD: ip_output.c,v 1.208 2011/04/14 15:53:36 yamt Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.207 2011/04/09 21:00:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.208 2011/04/14 15:53:36 yamt Exp $");
 
 #include "opt_pfil_hooks.h"
 #include "opt_inet.h"
@@ -826,11 +826,13 @@
                if (__predict_true(
                    (m->m_pkthdr.csum_flags & M_CSUM_TSOv4) == 0 ||
                    (ifp->if_capenable & IFCAP_TSOv4) != 0)) {
+                       KERNEL_LOCK(1, NULL);
                        error =
                            (*ifp->if_output)(ifp, m,
                                (m->m_flags & M_MCAST) ?
                                    sintocsa(rdst) : sintocsa(dst),
                                rt);
+                       KERNEL_UNLOCK_ONE(NULL);
                } else {
                        error =
                            ip_tso_output(ifp, m,
@@ -902,10 +904,12 @@
                        {
                                KASSERT((m->m_pkthdr.csum_flags &
                                    (M_CSUM_UDPv4 | M_CSUM_TCPv4)) == 0);
+                               KERNEL_LOCK(1, NULL);
                                error = (*ifp->if_output)(ifp, m,
                                    (m->m_flags & M_MCAST) ?
                                        sintocsa(rdst) : sintocsa(dst),
                                    rt);
+                               KERNEL_UNLOCK_ONE(NULL);
                        }
                } else
                        m_freem(m);



Home | Main Index | Thread Index | Old Index