From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shards.monkeyblade.net ([184.105.139.130]:56690 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932157AbeCIVIl (ORCPT ); Fri, 9 Mar 2018 16:08:41 -0500 Date: Fri, 09 Mar 2018 16:06:19 -0500 (EST) Message-Id: <20180309.160619.741646019216536916.davem@davemloft.net> To: sd@queasysnail.net Cc: netdev@vger.kernel.org, sbrivio@redhat.com Subject: Re: [PATCH net] ipv4: lock mtu in fnhe when received PMTU < net.ipv4.route.min_pmtu From: David Miller In-Reply-To: <7db505e856b96802375c2e3e822fdc5a3cf66b65.1520613617.git.sd@queasysnail.net> References: <7db505e856b96802375c2e3e822fdc5a3cf66b65.1520613617.git.sd@queasysnail.net> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: From: Sabrina Dubroca Date: Fri, 9 Mar 2018 17:43:21 +0100 > diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h > index f80524396c06..77d0a78cf7d2 100644 > --- a/include/net/ip_fib.h > +++ b/include/net/ip_fib.h > @@ -59,6 +59,7 @@ struct fib_nh_exception { > int fnhe_genid; > __be32 fnhe_daddr; > u32 fnhe_pmtu; > + bool fnhe_mtu_locked; > __be32 fnhe_gw; > unsigned long fnhe_expires; > struct rtable __rcu *fnhe_rth_input; > diff --git a/include/net/route.h b/include/net/route.h > index 1eb9ce470e25..729bb5e61e9a 100644 > --- a/include/net/route.h > +++ b/include/net/route.h > @@ -64,6 +64,7 @@ struct rtable { > > /* Miscellaneous cached information */ > u32 rt_pmtu; > + bool rt_mtu_locked; > > u32 rt_table_id; > Please use a flag bit for this, we've worked hard to shrink these datastructures as much as possible. I think if you just choose an unused RTCF_* bit (f.e. 0x02000000) for the state, you can use that because values propagate into the rtable->rt_flags, and do not propagate out. So you should be able to use it in this way privately inside the kernel. Thanks.