svn commit: r238092 - in head/sys: net netinet netinet6

Bjoern A. Zeeb bzeeb-lists at lists.zabbadoz.net
Sat Jul 7 21:36:14 UTC 2012


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!



More information about the svn-src-all mailing list