[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1305281117190.1693@ja.ssi.bg>
Date: Tue, 28 May 2013 11:25:55 +0300 (EEST)
From: Julian Anastasov <ja@....bg>
To: Timo Teräs <timo.teras@....fi>
cc: netdev@...r.kernel.org,
Steffen Klassert <steffen.klassert@...unet.com>
Subject: Re: [PATCH net-next 1/3] ipv4: properly refresh rtable entries on
pmtu/redirect events
Hello,
On Tue, 28 May 2013, Timo Teräs wrote:
> This reverts commit 05ab86c5 (xfrm4: Invalidate all ipv4 routes on
> IPsec pmtu events). Flushing all cached entries is not needed.
>
> Instead, invalidate only the related next hop dsts to recheck for
> the added next hop exception where needed. This also fixes a subtle
> race due to bumping generation id's before updating the pmtu.
>
> Cc: Steffen Klassert <steffen.klassert@...unet.com>
> Signed-off-by: Timo Teräs <timo.teras@....fi>
> ---
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 550781a..561a378 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -594,11 +594,25 @@ static inline u32 fnhe_hashfun(__be32 daddr)
> return hval & (FNHE_HASH_SIZE - 1);
> }
>
> +static void fill_route_from_fnhe(struct rtable *rt, struct fib_nh_exception *fnhe)
> +{
> + rt->rt_pmtu = fnhe->fnhe_pmtu;
> + rt->dst.expires = fnhe->fnhe_expires;
The 'if (time_before' ... dst_set_expires() logic from
rt_bind_exception() is removed, may be it should be moved here,
i.e. fnhe_pmtu should be ignored if expired.
> @@ -627,8 +641,12 @@ static void update_or_create_fnhe(struct fib_nh *nh, __be32 daddr, __be32 gw,
> fnhe->fnhe_gw = gw;
> if (pmtu) {
> fnhe->fnhe_pmtu = pmtu;
> - fnhe->fnhe_expires = expires;
> + fnhe->fnhe_expires = max(1UL, expires);
> }
> + /* Update all cached dsts too */
> + rt = rcu_dereference(fnhe->fnhe_rth);
rt = rcu_dereference_protected(fnhe->fnhe_rth, 1);
Regards
--
Julian Anastasov <ja@....bg>
Powered by blists - more mailing lists