Module Name: src
Committed By: yamt
Date: Thu Apr 14 15:53:36 UTC 2011
Modified Files:
src/sys/netinet: in_offload.c ip_output.c
Log Message:
after ip_input.c rev.1.285 and 1.286, restore kernel_lock for if_output.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/netinet/in_offload.c
cvs rdiff -u -r1.207 -r1.208 src/sys/netinet/ip_output.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/netinet/in_offload.c
diff -u src/sys/netinet/in_offload.c:1.3 src/sys/netinet/in_offload.c:1.4
--- src/sys/netinet/in_offload.c:1.3 Sat Dec 11 22:37:46 2010
+++ src/sys/netinet/in_offload.c Thu Apr 14 15:53:36 2011
@@ -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
Index: src/sys/netinet/ip_output.c
diff -u src/sys/netinet/ip_output.c:1.207 src/sys/netinet/ip_output.c:1.208
--- src/sys/netinet/ip_output.c:1.207 Sat Apr 9 21:00:53 2011
+++ src/sys/netinet/ip_output.c Thu Apr 14 15:53:36 2011
@@ -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);