Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fdd28d73 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'metrics_restructure'



This patch series works towards the goal of minimizing the amount
of things that can change in an ipv4 route.

In a regime where the routing cache is removed, route changes will
lead to cloning in the FIB tables or similar.

The largest trigger of route metrics writes, TCP, now has it's own
cache of dynamic metric state.  The timewait timestamps are stored
there now as well.

As a result of that, pre-cowing metrics is no longer necessary,
and therefore FLOWI_FLAG_PRECOW_METRICS is removed.

Redirect and PMTU handling is moved back into the ipv4 routes.  I'm
sorry for all the headaches trying to do this in the inetpeer has
caused, it was the wrong approach for sure.

Since metrics become read-only for ipv4 we no longer need the inetpeer
hung off of the ipv4 routes either.  So those disappear too.

Also, timewait sockets no longer need to hold onto an inetpeer either.

After this series, we still have some details to resolve wrt. PMTU and
redirects for a route-cache-less system:

1) With just the plain route cache removal, PMTU will continue to
   work mostly fine.  This is because of how the local route users
   call down into the PMTU update code with the route they already
   hold.

   However, if we wish to cache pre-computed routes in fib_info
   nexthops (which we want for performance), then we need to add
   route cloning for PMTU events.

2) Redirects require more work.  First, redirects must be changed to
   be handled like PMTU.  Wherein we call down into the sockets and
   other entities, and then they call back into the routing code with
   the route they were using.

   So we'll be adding an ->update_nexthop() method alongside
   ->update_pmtu().

   And then, like for PMTU, we'll need cloning support once we start
   caching routes in the fib_info nexthops.

But that's it, we can completely pull the trigger and remove the
routing cache with minimal disruptions.

As it is, this patch series alone helps a lot of things.  For one,
routing cache entry creation should be a lot faster, because we no
longer do inetpeer lookups (even to check if an entry exists).

This patch series also opens the door for non-DST_HOST ipv4 routes,
because nothing fundamentally cares about rt->rt_dst any more.  It
can be removed with the base routing cache removal patch.  In fact,
that was the primary goal of this patch series.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents ad7eee98 f185071d
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -619,8 +619,7 @@ extern void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid,
extern void rtnl_set_sk_err(struct net *net, u32 group, int error);
extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics);
extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst,
			      u32 id, u32 ts, u32 tsage, long expires,
			      u32 error);
			      u32 id, long expires, u32 error);

extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change);

+0 −1
Original line number Diff line number Diff line
@@ -506,7 +506,6 @@ struct tcp_timewait_sock {
	u32			  tw_rcv_wnd;
	u32			  tw_ts_recent;
	long			  tw_ts_recent_stamp;
	struct inet_peer	  *tw_peer;
#ifdef CONFIG_TCP_MD5SIG
	struct tcp_md5sig_key	  *tw_md5_key;
#endif
+0 −6
Original line number Diff line number Diff line
@@ -209,12 +209,6 @@ static inline unsigned long dst_metric_rtt(const struct dst_entry *dst, int metr
	return msecs_to_jiffies(dst_metric(dst, metric));
}

static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric,
				      unsigned long rtt)
{
	dst_metric_set(dst, metric, jiffies_to_msecs(rtt));
}

static inline u32
dst_allfrag(const struct dst_entry *dst)
{
+2 −3
Original line number Diff line number Diff line
@@ -20,9 +20,8 @@ struct flowi_common {
	__u8	flowic_proto;
	__u8	flowic_flags;
#define FLOWI_FLAG_ANYSRC		0x01
#define FLOWI_FLAG_PRECOW_METRICS	0x02
#define FLOWI_FLAG_CAN_SLEEP		0x04
#define FLOWI_FLAG_RT_NOCACHE		0x08
#define FLOWI_FLAG_CAN_SLEEP		0x02
#define FLOWI_FLAG_RT_NOCACHE		0x04
	__u32	flowic_secid;
};

+0 −1
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@ struct inet_connection_sock_af_ops {
	struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb,
				      struct request_sock *req,
				      struct dst_entry *dst);
	struct inet_peer *(*get_peer)(struct sock *sk);
	u16	    net_header_len;
	u16	    net_frag_header_len;
	u16	    sockaddr_len;
Loading