From owner-freebsd-net@FreeBSD.ORG Fri Oct 21 08:01:28 2005 Return-Path: X-Original-To: freebsd-net@FreeBSD.org Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 358E416A41F; Fri, 21 Oct 2005 08:01:28 +0000 (GMT) (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 553F943D46; Fri, 21 Oct 2005 08:01:26 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.13.3/8.13.3) with ESMTP id j9L813k4017502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 Oct 2005 12:01:04 +0400 (MSD) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.3/8.13.1/Submit) id j9L813GR017501; Fri, 21 Oct 2005 12:01:03 +0400 (MSD) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 21 Oct 2005 12:01:03 +0400 From: Gleb Smirnoff To: Yar Tikhiy Message-ID: <20051021080103.GH59364@cell.sick.ru> Mail-Followup-To: Gleb Smirnoff , Yar Tikhiy , freebsd-net@FreeBSD.org, ru@FreeBSD.org, Andrew Thompson References: <20051019102559.GA45909@heff.fud.org.nz> <20051020070054.GZ59364@cell.sick.ru> <20051020085721.GC27114@comp.chem.msu.su> <20051021053033.GW59364@cell.sick.ru> <20051021060654.GC69814@comp.chem.msu.su> <20051021064028.GZ59364@cell.sick.ru> <20051021074606.GF69814@comp.chem.msu.su> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20051021074606.GF69814@comp.chem.msu.su> User-Agent: Mutt/1.5.6i Cc: freebsd-net@FreeBSD.org, ru@FreeBSD.org, Andrew Thompson Subject: Re: vlan patch 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, 21 Oct 2005 08:01:28 -0000 On Fri, Oct 21, 2005 at 11:46:07AM +0400, Yar Tikhiy wrote: Y> > Or are you going to implement per-vlan lock? Is this going to be a benefit? Y> > Since all packets on trunk are serialized by NIC driver, can there be any Y> > benefit in creating a mutex per vlan interface, not per vlan trunk? Y> Y> I think you make a good point. Indeed, today 2 threads won't process Y> at once 2 vlan packets coming from the same parent interface. The Y> curious question is whether this state of matters will stay forever. Y> The other approach would be to have separate threads for ip_input, Y> ipfw, ip_output, and the rest of network stack functions, but it Y> appears too inefficient in our case due to the overhead of context Y> switches and locking. So I agree that locking vlans per trunk is Y> better today. Y> Y> Do you think we should stick the vlan mutex into struct ifnet, too, Y> along with the pointer to the vlan hash? Perhaps, it's time to Y> separate vlan-related fields into a separate struct? Not sure yet. Now we have only if_nvlans in ifnet, right? If we eliminate the global vlan list search, then we need to invent some if_vlantrunk structure, where we are going to have at least: - nvlans - mutex - hash The question is whether should we embed the structure into ifnet, or allocate it on first vlan created and store only pointer in ifnet. Embedding removes one pointer derefernce and that's good. However embedding enlarges size of ifnet. Dynamic allocation has one more benefit - we can leave vlan interfaces when the parent is destroyed. However, I'm not sure this is a positive feature. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE