From owner-freebsd-net@FreeBSD.ORG Mon Aug 19 11:44:36 2013 Return-Path: Delivered-To: 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 114294AA; Mon, 19 Aug 2013 11:44:36 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mail.ipfw.ru (unknown [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C5F3228A1; Mon, 19 Aug 2013 11:44:35 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=dhcp170-36-red.yandex.net) by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.76 (FreeBSD)) (envelope-from ) id 1VBK8d-000BBv-7A; Mon, 19 Aug 2013 11:44:31 +0400 Message-ID: <521204A9.7080607@ipfw.ru> Date: Mon, 19 Aug 2013 15:42:33 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130418 Thunderbird/17.0.5 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: <520A6D07.5080106@freebsd.org> <520B74DD.1060102@ipfw.ru> <20130814124024.GA64548@onelab2.iet.unipi.it> <201308141740.28779.zec@fer.hr> <20130814154853.GA66341@onelab2.iet.unipi.it> In-Reply-To: <20130814154853.GA66341@onelab2.iet.unipi.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, Lev Serebryakov , FreeBSD Net , Marko Zec , Lawrence Stewart 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, 19 Aug 2013 11:44:36 -0000 On 14.08.2013 19:48, Luigi Rizzo wrote: > On Wed, Aug 14, 2013 at 05:40:28PM +0200, Marko Zec wrote: >> On Wednesday 14 August 2013 14:40:24 Luigi Rizzo wrote: >>> On Wed, Aug 14, 2013 at 04:15:25PM +0400, Alexander V. Chernikov wrote: > ... >> FWIW, apparently we already have that infrastrucure in place - if_rele() >> calls if_free_internal() only when the last reference to the ifnet is >> dropped, so with little care this should be usable for caching ifp pointers >> w/o fears for kernel crashes mentioned above. > maybe Alexander was referring to holding references to the rte entries > returned as a result of the lookup. The rte holds a reference to the ifp. Yes. Since there is the only refcount which is protected (and is also a huge performance killer). Btw, there is a picture describing IPv4 packet flow from my still-not-written post related network stack performance, maybe it can be useful: http://static.ipfw.ru/images/freebsd_ipv4_flow.png > > cheers > luigi >