From owner-svn-src-head@FreeBSD.ORG Fri Oct 3 09:58:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C0523EC; Fri, 3 Oct 2014 09:58:38 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CF5E354; Fri, 3 Oct 2014 09:58:38 +0000 (UTC) Received: from [2a02:6b8:0:401:222:4dff:fe50:cd2f] (helo=ptichko.yndx.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XZvdv-0004fU-Cc; Fri, 03 Oct 2014 09:43:03 +0400 Message-ID: <542E7309.8080602@FreeBSD.org> Date: Fri, 03 Oct 2014 13:57:29 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r272391 - in head/sys: netinet netinet6 References: <201410020025.s920PvEW008958@svn.freebsd.org> <542D09CF.5000803@FreeBSD.org> <20141002103222.GG73266@FreeBSD.org> In-Reply-To: <20141002103222.GG73266@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Hiroki Sato , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Oct 2014 09:58:38 -0000 On 02.10.2014 14:32, Gleb Smirnoff wrote: > On Thu, Oct 02, 2014 at 12:16:15PM +0400, Alexander V. Chernikov wrote: > A> On 02.10.2014 04:25, Hiroki Sato wrote: > A> > Author: hrs > A> > Date: Thu Oct 2 00:25:57 2014 > A> > New Revision: 272391 > A> > URL: https://svnweb.freebsd.org/changeset/base/272391 > A> > > A> > Log: > A> > Add an additional routing table lookup when m->m_pkthdr.fibnum is changed > A> > at a PFIL hook in ip{,6}_output(). IPFW setfib rule did not perform > A> > a routing table lookup when the destination address was not changed. > A> > > A> > CR: D805 > A> > > A> > Modified: > A> > head/sys/netinet/ip_output.c > A> > head/sys/netinet6/ip6_output.c > A> I'm not very happy with this. > A> We already have large conditional for checking if dst has changed, how > A> you have added another conditional for fib.. > A> This idea is quite weird: why should we try to check all this stuff for > A> every packet instead of asking pfil consumers > A> to provide information they already know? > A> > A> We'd better discuss something like M_DSTCHANGED flag instead of doing > A> these hacks. > > And here you suggest to abuse mbuf flags to merely carry return value of > a pfil hook :) Why not? We have some M_PROTOX flags for exactly the same: store some state inside particular subsystem being set internally and cleared on return. We can use alternative approach like making last PFIL argument being pointer to some unsigned value representing flags and check it on return. The problem here is that we will make PFIL batching implementation harder.. >