route/arp lifetime (Re: it's the output, not ack coalescing (Re: TSO and FreeBSD vs Linux))

Andre Oppermann andre at freebsd.org
Mon Aug 26 15:07:34 UTC 2013


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



More information about the freebsd-net mailing list