From owner-svn-src-all@FreeBSD.ORG Sat Jul 7 21:36:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51CC3106566B; Sat, 7 Jul 2012 21:36:14 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 107968FC12; Sat, 7 Jul 2012 21:36:14 +0000 (UTC) Received: from dhcp-128-232-132-170.eduroam.csx.cam.ac.uk (dhcp-128-232-132-170.eduroam.csx.cam.ac.uk [128.232.132.170]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPSA id 3385E25D3887; Sat, 7 Jul 2012 21:36:13 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201207040737.q647br5k096035@svn.freebsd.org> Date: Sat, 7 Jul 2012 21:36:11 +0000 Content-Transfer-Encoding: 7bit Message-Id: References: <201207040737.q647br5k096035@svn.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r238092 - in head/sys: net netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2012 21:36:14 -0000 On 4. Jul 2012, at 07:37 , Gleb Smirnoff wrote: > Author: glebius > Date: Wed Jul 4 07:37:53 2012 > New Revision: 238092 > URL: http://svn.freebsd.org/changeset/base/238092 > > Log: > When ip_output()/ip6_output() is supplied a struct route *ro argument, > it skips FLOWTABLE lookup. However, the non-NULL ro has dual meaning > here: it may be supplied to provide route, and it may be supplied to > store and return to caller the route that ip_output()/ip6_output() > finds. In the latter case skipping FLOWTABLE lookup is pessimisation. > > The difference between struct route filled by FLOWTABLE and filled > by rtalloc() family is that the former doesn't hold a reference on > its rtentry. Reference is hold by flow entry, and it is about to > be released in future. Thus, route filled by FLOWTABLE shouldn't > be passed to RTFREE() macro. > > - Introduce new flag for struct route/route_in6, that marks route > not holding a reference on rtentry. > - Introduce new macro RO_RTFREE() that cleans up a struct route > depending on its kind. > - All callers to ip_output()/ip6_output() that do supply non-NULL > but empty route should use RO_RTFREE() to free results of > lookup. > - ip_output()/ip6_output() now do FLOWTABLE lookup always when > ro->ro_rt == NULL. Just read the description but you realize that the proper fix is to make flowtable code a bit slower and do proper reference counting? Currently a cache flowtable entry might still be releases while a packet in being processed using it, right? If my memory serves me right the same is true for llentries cached from flowtable. Once that is fixed as well the proper way to free an lltable should be that the table does not go away while it still holds entry but if it's marked for deletion the cleanup of the last llentry should also free the table. This would revert parts of Kip's last commit and restore a proper teardown world order. /bz -- Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do!