Commit 4b32b5a
ipv6: Stop rt6_info from using inet_peer's metrics
inet_peer is indexed by the dst address alone. However, the fib6 tree
could have multiple routing entries (rt6_info) for the same dst. For
example,
1. A /128 dst via multiple gateways.
2. A RTF_CACHE route cloned from a /128 route.
In the above cases, all of them will share the same metrics and
step on each other.
This patch will steer away from inet_peer's metrics and use
dst_cow_metrics_generic() for everything.
Change Highlights:
1. Remove rt6_cow_metrics() which currently acquires metrics from
inet_peer for DST_HOST route (i.e. /128 route).
2. Add rt6i_pmtu to take care of the pmtu update to avoid creating a
full size metrics just to override the RTAX_MTU.
3. After (2), the RTF_CACHE route can also share the metrics with its
dst.from route, by:
dst_init_metrics(&cache_rt->dst, dst_metrics_ptr(cache_rt->dst.from), true);
4. Stop creating RTF_CACHE route by cloning another RTF_CACHE route. Instead,
directly clone from rt->dst.
[ Currently, cloning from another RTF_CACHE is only possible during
rt6_do_redirect(). Also, the old clone is removed from the tree
immediately after the new clone is added. ]
In case of cloning from an older redirect RTF_CACHE, it should work as
before.
In case of cloning from an older pmtu RTF_CACHE, this patch will forget
the pmtu and re-learn it (if there is any) from the redirected route.
The _rt6i_peer and DST_METRICS_FORCE_OVERWRITE will be removed
in the next cleanup patch.
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Reviewed-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 653437d commit 4b32b5a
2 files changed
+60
-52
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| |||
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | 193 | | |
202 | 194 | | |
203 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
139 | | - | |
140 | | - | |
141 | | - | |
| 140 | + | |
142 | 141 | | |
143 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
144 | 145 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | 146 | | |
167 | 147 | | |
168 | 148 | | |
| |||
323 | 303 | | |
324 | 304 | | |
325 | 305 | | |
326 | | - | |
327 | | - | |
| 306 | + | |
328 | 307 | | |
329 | 308 | | |
330 | 309 | | |
| |||
333 | 312 | | |
334 | 313 | | |
335 | 314 | | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | 315 | | |
342 | 316 | | |
343 | 317 | | |
| |||
1003 | 977 | | |
1004 | 978 | | |
1005 | 979 | | |
| 980 | + | |
1006 | 981 | | |
1007 | 982 | | |
1008 | 983 | | |
| |||
1111 | 1086 | | |
1112 | 1087 | | |
1113 | 1088 | | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
1114 | 1096 | | |
1115 | 1097 | | |
1116 | 1098 | | |
| |||
1127 | 1109 | | |
1128 | 1110 | | |
1129 | 1111 | | |
| 1112 | + | |
| 1113 | + | |
1130 | 1114 | | |
1131 | 1115 | | |
1132 | 1116 | | |
| |||
1179 | 1163 | | |
1180 | 1164 | | |
1181 | 1165 | | |
1182 | | - | |
| 1166 | + | |
1183 | 1167 | | |
1184 | 1168 | | |
1185 | 1169 | | |
| |||
1359 | 1343 | | |
1360 | 1344 | | |
1361 | 1345 | | |
| 1346 | + | |
| 1347 | + | |
1362 | 1348 | | |
1363 | | - | |
1364 | 1349 | | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
1365 | 1354 | | |
1366 | 1355 | | |
1367 | 1356 | | |
| |||
1947 | 1936 | | |
1948 | 1937 | | |
1949 | 1938 | | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
1950 | 1949 | | |
1951 | 1950 | | |
1952 | 1951 | | |
1953 | 1952 | | |
1954 | | - | |
1955 | | - | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
1956 | 1960 | | |
1957 | 1961 | | |
1958 | 1962 | | |
| |||
1961 | 1965 | | |
1962 | 1966 | | |
1963 | 1967 | | |
1964 | | - | |
1965 | 1968 | | |
1966 | 1969 | | |
1967 | 1970 | | |
| |||
2393 | 2396 | | |
2394 | 2397 | | |
2395 | 2398 | | |
2396 | | - | |
2397 | | - | |
2398 | | - | |
2399 | | - | |
2400 | | - | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
2401 | 2413 | | |
2402 | 2414 | | |
2403 | 2415 | | |
| |||
2627 | 2639 | | |
2628 | 2640 | | |
2629 | 2641 | | |
| 2642 | + | |
2630 | 2643 | | |
2631 | 2644 | | |
2632 | 2645 | | |
| |||
2740 | 2753 | | |
2741 | 2754 | | |
2742 | 2755 | | |
2743 | | - | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
2744 | 2760 | | |
2745 | 2761 | | |
2746 | 2762 | | |
| |||
0 commit comments