From owner-freebsd-net@FreeBSD.ORG Mon Aug 26 15:07:34 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 68ACA48F for ; Mon, 26 Aug 2013 15:07:34 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9AA22A3D for ; Mon, 26 Aug 2013 15:07:33 +0000 (UTC) Received: (qmail 7014 invoked from network); 26 Aug 2013 15:49:44 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 26 Aug 2013 15:49:44 -0000 Message-ID: <521B6F31.705@freebsd.org> Date: Mon, 26 Aug 2013 17:07:29 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Luigi Rizzo Subject: Re: route/arp lifetime (Re: it's the output, not ack coalescing (Re: TSO and FreeBSD vs Linux)) References: <20130814124024.GA64548@onelab2.iet.unipi.it> <201308141740.28779.zec@fer.hr> <20130814154853.GA66341@onelab2.iet.unipi.it> <521204A9.7080607@ipfw.ru> <52152837.9010101@freebsd.org> <5218ABB4.5070601@ipfw.ru> <5218E8B6.5090407@freebsd.org> <521B65EF.1030408@freebsd.org> <20130826144601.GA11595@onelab2.iet.unipi.it> In-Reply-To: <20130826144601.GA11595@onelab2.iet.unipi.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Net , Adrian Chadd , "Alexander V. Chernikov" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2013 15:07:34 -0000 On 26.08.2013 16:46, Luigi Rizzo wrote: > On Mon, Aug 26, 2013 at 04:27:59PM +0200, Andre Oppermann wrote: > ... >> >> 1. lle lock to rmlock. >> >> 2. if_addr and IN_ADDR locks to rmlocks. >> >> 3. routing table locking (rmlocks, and by doing away with rtentry locks and refcounting >> through copy-out on lookup and prohibition of having any pointers into the rtable). > > re. the last item, the problem is that we need to access *ifp > after the route lookup, and this cannot be solved with a copy-on-lookup > (I guess at the moment the rte has a refcounted pointer to the ifp). The ifp has always been a bit lazy and later access is fine. We have the same problem with packets coming up from an interface (m->pkthdr.rcvif). > This is why i argued that it might be useful to cache into the socket a > refcounted pointer into the ifp (or rte) and update it lazily > (periodically or through generation counters). Unless you want to ref-count every invocation of ifp the cheapest way to solve this is by making sure the ifp stays around for some time (2 minutes?) pointing to a dummy if_transmit after an interface departs. -- Andre