From owner-freebsd-net@FreeBSD.ORG Fri Jan 26 11:44:52 2007 Return-Path: X-Original-To: net@FreeBSD.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3BADD16A405; Fri, 26 Jan 2007 11:44:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.freebsd.org (Postfix) with ESMTP id 9F55913C481; Fri, 26 Jan 2007 11:44:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.13.4/8.13.3) with ESMTP id l0QBinUL016534 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 26 Jan 2007 14:44:49 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.4/8.13.1/Submit) id l0QBini4016533; Fri, 26 Jan 2007 14:44:49 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 26 Jan 2007 14:44:49 +0300 From: Gleb Smirnoff To: Robert Watson Message-ID: <20070126114449.GM7922@cell.sick.ru> References: <20070125162422.GA7922@bestcom.ru> <45B8EB23.705@FreeBSD.org> <20070125183720.GB7922@cell.sick.ru> <20070125203807.S13293@fledge.watson.org> <20070125212310.GG7922@cell.sick.ru> <20070125214956.J13293@fledge.watson.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20070125214956.J13293@fledge.watson.org> User-Agent: Mutt/1.5.6i Cc: "Bruce M. Simpson" , net@FreeBSD.org Subject: Re: rev. 1.94 of netinet/in.c broke CARP X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jan 2007 11:44:52 -0000 On Thu, Jan 25, 2007 at 10:00:08PM +0000, Robert Watson wrote: R> >On Thu, Jan 25, 2007 at 08:40:52PM +0000, Robert Watson wrote: R> >R> Architecturally, the right fix is that CARP needs to have a handler for R> >R> ifnet destruction that always runs before the multicast address garbage R> >R> collection. I'm pretty preoccupied for the next few days due to an R> >R> impending paper deadline, so can't investigate further currently, but R> >one R> >R> way or the other that ordering dependency needs to be expressed. If R> >done R> >R> properly, CARP will always have released its multicast address before R> >they R> >R> are forceably removed. Having the reference count is good too, but what R> >I R> >R> describe should be sufficient regardless of the refcount. R> > R> >This means removing usage of EVENTHANDLER(9) and going back to exporting R> >carp_ifdetach() and calling it directly from if_detach(). This is back out R> >revision 1.255 of net/if.c. Not sure what is a right way... R> > R> >I am worried about that CARP is not the only subsystem in kernel that can R> >join a multicast group on an ifnet, and keep a pointer to the multicast R> >instance. R> R> Alternatively, we move to having two event handlers: one for general stack R> consumers to use, and a second one to do low level address and protocol R> cleanup. CARP would use the former, multicast address stuff the latter... Well, I am just not sure that the new coding strategy, chosen by Bruce is correct. We used to have every subsystem to join multicast membership itself, and leave it itself. Due to bugs in the Ethernet layer (?) on interface detach some multicast memberships were not left and thus memory was leaking. Is adding a generic GC function a correct way or was it better to just fix the buggy layer, that forgot about its multicast memberships? ATM, I can fix the CARP in the following way: 1) Call multicast cleanup, if we are destroying carp interface itself. 2) Don't call multicast cleanup, if we are called through EVENTHANDLER(9) since parent is detaching. Would this fix be ok? -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE