diff options
author | David S. Miller <davem@davemloft.net> | 2010-12-14 16:01:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-14 16:01:14 -0500 |
commit | d33e455337ea2c71d09d7f4367d6ad6dd32b6965 (patch) | |
tree | d1b35b1be5ab73df6f7e57b86a2e68fad2990adf /net/xfrm | |
parent | 9fe146aef44afe5ec677d8150b6ae94e09b773f7 (diff) |
net: Abstract default MTU metric calculation behind an accessor.
Like RTAX_ADVMSS, make the default calculation go through a dst_ops
method rather than caching the computation in the routing cache
entries.
Now dst metrics are pretty much left as-is when new entries are
created, thus optimizing metric sharing becomes a real possibility.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 36936c8ae961..8b3ef404c794 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -2366,6 +2366,11 @@ static unsigned int xfrm_default_advmss(const struct dst_entry *dst) | |||
2366 | return dst_metric_advmss(dst->path); | 2366 | return dst_metric_advmss(dst->path); |
2367 | } | 2367 | } |
2368 | 2368 | ||
2369 | static unsigned int xfrm_default_mtu(const struct dst_entry *dst) | ||
2370 | { | ||
2371 | return dst_mtu(dst->path); | ||
2372 | } | ||
2373 | |||
2369 | int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo) | 2374 | int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo) |
2370 | { | 2375 | { |
2371 | struct net *net; | 2376 | struct net *net; |
@@ -2385,6 +2390,8 @@ int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo) | |||
2385 | dst_ops->check = xfrm_dst_check; | 2390 | dst_ops->check = xfrm_dst_check; |
2386 | if (likely(dst_ops->default_advmss == NULL)) | 2391 | if (likely(dst_ops->default_advmss == NULL)) |
2387 | dst_ops->default_advmss = xfrm_default_advmss; | 2392 | dst_ops->default_advmss = xfrm_default_advmss; |
2393 | if (likely(dst_ops->default_mtu == NULL)) | ||
2394 | dst_ops->default_mtu = xfrm_default_mtu; | ||
2388 | if (likely(dst_ops->negative_advice == NULL)) | 2395 | if (likely(dst_ops->negative_advice == NULL)) |
2389 | dst_ops->negative_advice = xfrm_negative_advice; | 2396 | dst_ops->negative_advice = xfrm_negative_advice; |
2390 | if (likely(dst_ops->link_failure == NULL)) | 2397 | if (likely(dst_ops->link_failure == NULL)) |