Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Aug 2013 17:07:29 +0200
From:      Andre Oppermann <andre@freebsd.org>
To:        Luigi Rizzo <rizzo@iet.unipi.it>
Cc:        FreeBSD Net <freebsd-net@freebsd.org>, Adrian Chadd <adrian@freebsd.org>, "Alexander V. Chernikov" <melifaro@ipfw.ru>
Subject:   Re: route/arp lifetime (Re: it's the output, not ack coalescing (Re: TSO and FreeBSD vs Linux))
Message-ID:  <521B6F31.705@freebsd.org>
In-Reply-To: <20130826144601.GA11595@onelab2.iet.unipi.it>
References:  <20130814124024.GA64548@onelab2.iet.unipi.it> <201308141740.28779.zec@fer.hr> <20130814154853.GA66341@onelab2.iet.unipi.it> <521204A9.7080607@ipfw.ru> <52152837.9010101@freebsd.org> <5218ABB4.5070601@ipfw.ru> <CAJ-Vmon9qhnn_xJkiKZnLWEi-YAvg=FuL8FoSdToWXgy-VJ59Q@mail.gmail.com> <5218E8B6.5090407@freebsd.org> <CAJ-VmokMsSWTaKHc1EYdnZ151eH3410d-VdVduuSfn1%2B_zb2%2Bw@mail.gmail.com> <521B65EF.1030408@freebsd.org> <20130826144601.GA11595@onelab2.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?521B6F31.705>