89structrt6_info { 90structdst_entrydst; 91 92/* 93 * Tail elements of dst_entry (__refcnt etc.) 94 * and these elements (rarely used in hot path) are in 95 * the same cache line. 96 */ 97structfib6_table *rt6i_table; 98structfib6_node *rt6i_node; 99 100structin6_addrrt6i_gateway; 101 102/* Multipath routes: 103 * siblings is a list of rt6_info that have the the same metric/weight, 104 * destination, but not the same gateway. nsiblings is just a cache 105 * to speed up lookup. 106 */ 107structlist_headrt6i_siblings; 108unsignedint rt6i_nsiblings; 109 110atomic_t rt6i_ref; 111 112/* These are in a separate cache line. */ 113structrt6keyrt6i_dst ____cacheline_aligned_in_smp; 114 u32 rt6i_flags; 115structrt6keyrt6i_src; 116structrt6keyrt6i_prefsrc; 117 u32 rt6i_metric; 118 119structinet6_dev *rt6i_idev; 120unsignedlong _rt6i_peer; 121 122 u32 rt6i_genid; 123 124/* more non-fragment space at head required */ 125unsignedshort rt6i_nfheader_len; 126 127 u8 rt6i_protocol; 128 };
➜ ~ sudo ip -6 route show cache 3ffe::2 via 3ffe::2 dev eth0 metric 0 cache expires -1sec ➜ ~
A cache route is inserted, while common route unchanged.
1 2 3 4
➜ ~ sudo ip -6route show 3ffe::/64 dev eth0 proto kernel metric 256 fe80::/64 dev eth0 proto kernel metric 256 ➜ ~
0.5.5. after a period, check again. cache route disappear.
1 2 3 4 5
➜ ~ sudo ip -6route show cache ➜ ~ sudo ip -6route show 3ffe::/64 dev eth0 proto kernel metric 256 fe80::/64 dev eth0 proto kernel metric 256 ➜ ~
0.6. Serveral questions:
0.6.1. Q1: What kernel will do with subnet route vs route cache?
ex: 1. add route 3ffe::1/64 2. ping route 3ffe::2 a route cache will be insert to fib tree. 3. add roue 3ffe::1/96 What kernel will do with it? the cache route will be deleted? See following line in function fib6_add, kernel will prune all clone/cache route.