diff options
| author | David S. Miller <davem@davemloft.net> | 2012-07-10 07:01:57 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2012-07-11 01:40:12 -0400 |
| commit | 3e12939a2a67fbb4cbd962c3b9bc398c73319766 (patch) | |
| tree | cb3d49ded9da2def0c08e9f5085af870aeadc993 | |
| parent | 1d861aa4b3fb08822055345f480850205ffe6170 (diff) | |
inet: Kill FLOWI_FLAG_PRECOW_METRICS.
No longer needed. TCP writes metrics, but now in it's own special
cache that does not dirty the route metrics. Therefore there is no
longer any reason to pre-cow metrics in this way.
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | include/net/flow.h | 5 | ||||
| -rw-r--r-- | include/net/inet_sock.h | 2 | ||||
| -rw-r--r-- | include/net/route.h | 2 | ||||
| -rw-r--r-- | net/ipv4/inet_connection_sock.c | 2 | ||||
| -rw-r--r-- | net/ipv4/route.c | 11 | ||||
| -rw-r--r-- | net/ipv6/route.c | 2 |
6 files changed, 6 insertions, 18 deletions
diff --git a/include/net/flow.h b/include/net/flow.h index bd524f598561..ce9cb7656b47 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
| @@ -20,9 +20,8 @@ struct flowi_common { | |||
| 20 | __u8 flowic_proto; | 20 | __u8 flowic_proto; |
| 21 | __u8 flowic_flags; | 21 | __u8 flowic_flags; |
| 22 | #define FLOWI_FLAG_ANYSRC 0x01 | 22 | #define FLOWI_FLAG_ANYSRC 0x01 |
| 23 | #define FLOWI_FLAG_PRECOW_METRICS 0x02 | 23 | #define FLOWI_FLAG_CAN_SLEEP 0x02 |
| 24 | #define FLOWI_FLAG_CAN_SLEEP 0x04 | 24 | #define FLOWI_FLAG_RT_NOCACHE 0x04 |
| 25 | #define FLOWI_FLAG_RT_NOCACHE 0x08 | ||
| 26 | __u32 flowic_secid; | 25 | __u32 flowic_secid; |
| 27 | }; | 26 | }; |
| 28 | 27 | ||
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index ae17e1352d7e..924d7b98ab60 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
| @@ -245,8 +245,6 @@ static inline __u8 inet_sk_flowi_flags(const struct sock *sk) | |||
| 245 | 245 | ||
| 246 | if (inet_sk(sk)->transparent || inet_sk(sk)->hdrincl) | 246 | if (inet_sk(sk)->transparent || inet_sk(sk)->hdrincl) |
| 247 | flags |= FLOWI_FLAG_ANYSRC; | 247 | flags |= FLOWI_FLAG_ANYSRC; |
| 248 | if (sk->sk_protocol == IPPROTO_TCP) | ||
| 249 | flags |= FLOWI_FLAG_PRECOW_METRICS; | ||
| 250 | return flags; | 248 | return flags; |
| 251 | } | 249 | } |
| 252 | 250 | ||
diff --git a/include/net/route.h b/include/net/route.h index 211e2665139b..635d7a99d199 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
| @@ -278,8 +278,6 @@ static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32 | |||
| 278 | 278 | ||
| 279 | if (inet_sk(sk)->transparent) | 279 | if (inet_sk(sk)->transparent) |
| 280 | flow_flags |= FLOWI_FLAG_ANYSRC; | 280 | flow_flags |= FLOWI_FLAG_ANYSRC; |
| 281 | if (protocol == IPPROTO_TCP) | ||
| 282 | flow_flags |= FLOWI_FLAG_PRECOW_METRICS; | ||
| 283 | if (can_sleep) | 281 | if (can_sleep) |
| 284 | flow_flags |= FLOWI_FLAG_CAN_SLEEP; | 282 | flow_flags |= FLOWI_FLAG_CAN_SLEEP; |
| 285 | 283 | ||
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index 034ddbe42adf..76825be3b643 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
| @@ -375,7 +375,7 @@ struct dst_entry *inet_csk_route_req(struct sock *sk, | |||
| 375 | const struct inet_request_sock *ireq = inet_rsk(req); | 375 | const struct inet_request_sock *ireq = inet_rsk(req); |
| 376 | struct ip_options_rcu *opt = inet_rsk(req)->opt; | 376 | struct ip_options_rcu *opt = inet_rsk(req)->opt; |
| 377 | struct net *net = sock_net(sk); | 377 | struct net *net = sock_net(sk); |
| 378 | int flags = inet_sk_flowi_flags(sk) & ~FLOWI_FLAG_PRECOW_METRICS; | 378 | int flags = inet_sk_flowi_flags(sk); |
| 379 | 379 | ||
| 380 | if (nocache) | 380 | if (nocache) |
| 381 | flags |= FLOWI_FLAG_RT_NOCACHE; | 381 | flags |= FLOWI_FLAG_RT_NOCACHE; |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index e376354dcb65..d4834e2914a0 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
| @@ -1658,7 +1658,7 @@ void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu, | |||
| 1658 | struct rtable *rt; | 1658 | struct rtable *rt; |
| 1659 | 1659 | ||
| 1660 | flowi4_init_output(&fl4, oif, mark, RT_TOS(iph->tos), RT_SCOPE_UNIVERSE, | 1660 | flowi4_init_output(&fl4, oif, mark, RT_TOS(iph->tos), RT_SCOPE_UNIVERSE, |
| 1661 | protocol, flow_flags | FLOWI_FLAG_PRECOW_METRICS, | 1661 | protocol, flow_flags, |
| 1662 | iph->daddr, iph->saddr, 0, 0); | 1662 | iph->daddr, iph->saddr, 0, 0); |
| 1663 | rt = __ip_route_output_key(net, &fl4); | 1663 | rt = __ip_route_output_key(net, &fl4); |
| 1664 | if (!IS_ERR(rt)) { | 1664 | if (!IS_ERR(rt)) { |
| @@ -1836,18 +1836,11 @@ static void rt_init_metrics(struct rtable *rt, const struct flowi4 *fl4, | |||
| 1836 | { | 1836 | { |
| 1837 | struct inet_peer_base *base; | 1837 | struct inet_peer_base *base; |
| 1838 | struct inet_peer *peer; | 1838 | struct inet_peer *peer; |
| 1839 | int create = 0; | ||
| 1840 | |||
| 1841 | /* If a peer entry exists for this destination, we must hook | ||
| 1842 | * it up in order to get at cached metrics. | ||
| 1843 | */ | ||
| 1844 | if (fl4 && (fl4->flowi4_flags & FLOWI_FLAG_PRECOW_METRICS)) | ||
| 1845 | create = 1; | ||
| 1846 | 1839 | ||
| 1847 | base = inetpeer_base_ptr(rt->_peer); | 1840 | base = inetpeer_base_ptr(rt->_peer); |
| 1848 | BUG_ON(!base); | 1841 | BUG_ON(!base); |
| 1849 | 1842 | ||
| 1850 | peer = inet_getpeer_v4(base, rt->rt_dst, create); | 1843 | peer = inet_getpeer_v4(base, rt->rt_dst, 0); |
| 1851 | if (peer) { | 1844 | if (peer) { |
| 1852 | __rt_set_peer(rt, peer); | 1845 | __rt_set_peer(rt, peer); |
| 1853 | rt->rt_peer_genid = rt_peer_genid(); | 1846 | rt->rt_peer_genid = rt_peer_genid(); |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 0c0684753781..b7eb51e1a0e1 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
| @@ -1093,7 +1093,7 @@ void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu, | |||
| 1093 | memset(&fl6, 0, sizeof(fl6)); | 1093 | memset(&fl6, 0, sizeof(fl6)); |
| 1094 | fl6.flowi6_oif = oif; | 1094 | fl6.flowi6_oif = oif; |
| 1095 | fl6.flowi6_mark = mark; | 1095 | fl6.flowi6_mark = mark; |
| 1096 | fl6.flowi6_flags = FLOWI_FLAG_PRECOW_METRICS; | 1096 | fl6.flowi6_flags = 0; |
| 1097 | fl6.daddr = iph->daddr; | 1097 | fl6.daddr = iph->daddr; |
| 1098 | fl6.saddr = iph->saddr; | 1098 | fl6.saddr = iph->saddr; |
| 1099 | fl6.flowlabel = (*(__be32 *) iph) & IPV6_FLOWINFO_MASK; | 1099 | fl6.flowlabel = (*(__be32 *) iph) & IPV6_FLOWINFO_MASK; |
