All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipv4: show pmtu in route list
@ 2012-07-20  9:02 Julian Anastasov
  2012-07-20 18:16 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Julian Anastasov @ 2012-07-20  9:02 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

	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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ipv4: show pmtu in route list
  2012-07-20  9:02 [PATCH] ipv4: show pmtu in route list Julian Anastasov
@ 2012-07-20 18:16 ` David Miller
  2012-07-20 23:26   ` Julian Anastasov
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2012-07-20 18:16 UTC (permalink / raw)
  To: ja; +Cc: netdev

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?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ipv4: show pmtu in route list
  2012-07-20 23:26   ` Julian Anastasov
@ 2012-07-20 23:22     ` David Miller
  2012-07-20 23:46       ` Julian Anastasov
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2012-07-20 23:22 UTC (permalink / raw)
  To: ja; +Cc: netdev

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ipv4: show pmtu in route list
  2012-07-20 18:16 ` David Miller
@ 2012-07-20 23:26   ` Julian Anastasov
  2012-07-20 23:22     ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Julian Anastasov @ 2012-07-20 23:26 UTC (permalink / raw)
  To: David Miller; +Cc: netdev


	Hello,

On Fri, 20 Jul 2012, David Miller wrote:

> 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?

	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 <ja@ssi.bg>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ipv4: show pmtu in route list
  2012-07-20 23:22     ` David Miller
@ 2012-07-20 23:46       ` Julian Anastasov
  0 siblings, 0 replies; 5+ messages in thread
From: Julian Anastasov @ 2012-07-20 23:46 UTC (permalink / raw)
  To: David Miller; +Cc: netdev


	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)
> 
> > 	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 <ja@ssi.bg>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-07-20 23:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20  9:02 [PATCH] ipv4: show pmtu in route list Julian Anastasov
2012-07-20 18:16 ` David Miller
2012-07-20 23:26   ` Julian Anastasov
2012-07-20 23:22     ` David Miller
2012-07-20 23:46       ` Julian Anastasov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.