[PATCH] ipv4: show pmtu in route list

Subsystems: networking [general], networking [ipv4/ipv6], the rest

STALE5135d

5 messages, 2 authors, 2012-07-20 · open the first message on its own page

[PATCH] ipv4: show pmtu in route list

From: Julian Anastasov <ja@ssi.bg>
Date: 2012-07-20 08:55:14

	Override the metrics with rt_pmtu

Signed-off-by: Julian Anastasov <ja@ssi.bg>
---

	Is this patch still useful if routing cache is removed?

 net/ipv4/route.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 9f7ffbe..d547f6f 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2909,6 +2909,7 @@ static int rt_fill_info(struct net *net,
 	struct nlmsghdr *nlh;
 	unsigned long expires = 0;
 	u32 error;
+	u32 metrics[RTAX_MAX];
 
 	nlh = nlmsg_put(skb, pid, seq, event, sizeof(*r), flags);
 	if (nlh == NULL)
@@ -2953,7 +2954,10 @@ static int rt_fill_info(struct net *net,
 	    nla_put_be32(skb, RTA_GATEWAY, rt->rt_gateway))
 		goto nla_put_failure;
 
-	if (rtnetlink_put_metrics(skb, dst_metrics_ptr(&rt->dst)) < 0)
+	memcpy(metrics, dst_metrics_ptr(&rt->dst), sizeof(metrics));
+	if (rt->rt_pmtu)
+		metrics[RTAX_MTU - 1] = rt->rt_pmtu;
+	if (rtnetlink_put_metrics(skb, metrics) < 0)
 		goto nla_put_failure;
 
 	if (rt->rt_mark &&
-- 
1.7.3.4

Re: [PATCH] ipv4: show pmtu in route list

From: David Miller <davem@davemloft.net>
Date: 2012-07-20 18:16:21

From: Julian Anastasov <ja@ssi.bg>
Date: Fri, 20 Jul 2012 12:02:08 +0300
Is this patch still useful if routing cache is removed?
It is, since this function still gets used for rtnetlink route
queries.  So I'll apply this, thanks Julian!

Which reminds me that we don't have way to inspect the new TCP metrics
cache.  Would someone like to work on that?

Re: [PATCH] ipv4: show pmtu in route list

From: Julian Anastasov <ja@ssi.bg>
Date: 2012-07-20 23:19:10

	Hello,

On Fri, 20 Jul 2012, David Miller wrote:
From: Julian Anastasov <ja@ssi.bg>
Date: Fri, 20 Jul 2012 12:02:08 +0300
quoted
Is this patch still useful if routing cache is removed?
It is, since this function still gets used for rtnetlink route
queries.  So I'll apply this, thanks Julian!

Which reminds me that we don't have way to inspect the new TCP metrics
cache.  Would someone like to work on that?
	I'll try this weekend to reorganize the seqlock
usage in tcp_metrics.c and to provide method to feed
rt_fill_info with values from this cache.

Regards

--
Julian Anastasov [off-list ref]

Re: [PATCH] ipv4: show pmtu in route list

From: David Miller <davem@davemloft.net>
Date: 2012-07-20 23:22:16

From: Julian Anastasov <ja@ssi.bg>
Date: Sat, 21 Jul 2012 02:26:28 +0300 (EEST)
	I'll try this weekend to reorganize the seqlock
usage in tcp_metrics.c and to provide method to feed
rt_fill_info with values from this cache.
Wouldn't it be better to just export the TCP metrics via it's own
file or netlink facility?

They keying of the TCP metrics is completely different from how routes
are key'd.  So I see little value in creating the illusion that these
two things live in the same keying domain.

The routing cache will be completely gone and /proc/net/rt_cache will
be an empty file.

Re: [PATCH] ipv4: show pmtu in route list

From: Julian Anastasov <ja@ssi.bg>
Date: 2012-07-20 23:38:47

	Hello,

On Fri, 20 Jul 2012, David Miller wrote:
From: Julian Anastasov <ja@ssi.bg>
Date: Sat, 21 Jul 2012 02:26:28 +0300 (EEST)
quoted
	I'll try this weekend to reorganize the seqlock
usage in tcp_metrics.c and to provide method to feed
rt_fill_info with values from this cache.
Wouldn't it be better to just export the TCP metrics via it's own
file or netlink facility?

They keying of the TCP metrics is completely different from how routes
are key'd.  So I see little value in creating the illusion that these
two things live in the same keying domain.

The routing cache will be completely gone and /proc/net/rt_cache will
be an empty file.
	OK, then I'll try it in this way. When I have some
plan I'll be back for comments before implementing it.

Regards

--
Julian Anastasov [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help