From owner-p4-projects@FreeBSD.ORG Wed Aug 3 16:48:35 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8720616A421; Wed, 3 Aug 2005 16:48:34 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A2EC16A41F for ; Wed, 3 Aug 2005 16:48:34 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D01643D70 for ; Wed, 3 Aug 2005 16:48:28 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j73GmSRQ005329 for ; Wed, 3 Aug 2005 16:48:28 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j73GmSXd005326 for perforce@freebsd.org; Wed, 3 Aug 2005 16:48:28 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 3 Aug 2005 16:48:28 GMT Message-Id: <200508031648.j73GmSXd005326@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 81407 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2005 16:48:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=81407 Change 81407 by rwatson@rwatson_zoo on 2005/08/03 16:48:09 Mark in_multi_mtx as recursible instead of if_addr_mtx, that's what I meant to do before. This is necessary because IGMP calls into ip_output() to send out packets while holding the in_multi_mtx, but ip_output() has to acquire it to perform address checks. Really, this suggests IGMP shouldn't reenter the network code quite as much as it does. Affected files ... .. //depot/projects/netsmp/src/sys/net/if_var.h#8 edit .. //depot/projects/netsmp/src/sys/netinet/in.c#5 edit Differences ... ==== //depot/projects/netsmp/src/sys/net/if_var.h#8 (text+ko) ==== @@ -221,7 +221,7 @@ * Locks for address lists on the network interface. */ #define IF_ADDR_LOCK_INIT(if) mtx_init(&(if)->if_addr_mtx, \ - "if_addr_mtx", NULL, MTX_DEF | MTX_RECURSE) + "if_addr_mtx", NULL, MTX_DEF) #define IF_ADDR_LOCK_DESTROY(if) mtx_destroy(&(if)->if_addr_mtx) #define IF_ADDR_LOCK(if) mtx_lock(&(if)->if_addr_mtx) #define IF_ADDR_UNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) ==== //depot/projects/netsmp/src/sys/netinet/in.c#5 (text+ko) ==== @@ -69,13 +69,15 @@ &subnetsarelocal, 0, "Treat all subnets as directly connected"); /* - * The IPv4 multicast list (in_multihead and associated structures) - * are protected by the global in_multi_mtx. See in_var.h for - * more details. + * The IPv4 multicast list (in_multihead and associated structures) are + * protected by the global in_multi_mtx. See in_var.h for more details. For + * now, in_multi_mtx is marked as recursible due to IGMP's calling back into + * ip_output() to send IGMP packets while holding the lock; this probably is + * not quite desirable. */ struct in_multihead in_multihead; /* XXX BSS initialization */ struct mtx in_multi_mtx; -MTX_SYSINIT(in_multi_mtx, &in_multi_mtx, "in_multi_mtx", MTX_DEF); +MTX_SYSINIT(in_multi_mtx, &in_multi_mtx, "in_multi_mtx", MTX_DEF | MTX_RECURSE); extern struct inpcbinfo ripcbinfo; extern struct inpcbinfo udbinfo;