From 6c491646d16c37120eb0a4c2e090bdf37431dad0 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Sat, 29 Mar 2008 03:37:15 +0000 Subject: [PATCH] Add MPSAFE version of netmsg_service_loop() --- sys/net/netisr.c | 17 ++++++++++++++++- sys/net/netisr.h | 3 ++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/sys/net/netisr.c b/sys/net/netisr.c index 66317a311..ad2e972ca 100644 --- a/sys/net/netisr.c +++ b/sys/net/netisr.c @@ -35,7 +35,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/net/netisr.c,v 1.37 2008/03/07 11:34:19 sephe Exp $ + * $DragonFly: src/sys/net/netisr.c,v 1.38 2008/03/29 03:37:15 sephe Exp $ */ #include @@ -244,6 +244,21 @@ netmsg_service_loop(void *arg) } /* + * MPSAFE version of netmsg_service_loop() + */ +void +netmsg_service_loop_mpsafe(void *arg) +{ + rel_mplock(); + + struct netmsg *msg; + + while ((msg = lwkt_waitport(&curthread->td_msgport, 0))) { + msg->nm_dispatch(msg); + } +} + +/* * Call the netisr directly. * Queueing may be done in the msg port layer at its discretion. */ diff --git a/sys/net/netisr.h b/sys/net/netisr.h index 46affa959..2dbb84430 100644 --- a/sys/net/netisr.h +++ b/sys/net/netisr.h @@ -65,7 +65,7 @@ * * @(#)netisr.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/net/netisr.h,v 1.21.2.5 2002/02/09 23:02:39 luigi Exp $ - * $DragonFly: src/sys/net/netisr.h,v 1.29 2007/12/30 20:02:56 hasso Exp $ + * $DragonFly: src/sys/net/netisr.h,v 1.30 2008/03/29 03:37:15 sephe Exp $ */ #ifndef _NET_NETISR_H_ @@ -227,6 +227,7 @@ void netisr_register(int, lwkt_portfn_t, netisr_fn_t); int netisr_unregister(int); void netmsg_service_port_init(lwkt_port_t); void netmsg_service_loop(void *arg); +void netmsg_service_loop_mpsafe(void *arg); void netmsg_service_sync(void); void schednetisr(int); -- 2.11.4.GIT