diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-17 07:19:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-17 11:48:50 -0400 |
commit | 4895c771c7f006b4b90f9d6b1d2210939ba57b38 (patch) | |
tree | 66b132799e33a215b88bf3945965fefa7a0cde24 /include/net | |
parent | 6700c2709c08d74ae2c3c29b84a30da012dbc7f1 (diff) |
ipv4: Add FIB nexthop exceptions.
In a regime where we have subnetted route entries, we need a way to
store persistent storage about destination specific learned values
such as redirects and PMTU values.
This is implemented here via nexthop exceptions.
The initial implementation is a 2048 entry hash table with relaiming
starting at chain length 5. A more sophisticated scheme can be
devised if that proves necessary.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ip_fib.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 5697acefeba3..e9ee1ca07087 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | #include <net/flow.h> | 19 | #include <net/flow.h> |
20 | #include <linux/seq_file.h> | 20 | #include <linux/seq_file.h> |
21 | #include <linux/rcupdate.h> | ||
21 | #include <net/fib_rules.h> | 22 | #include <net/fib_rules.h> |
22 | #include <net/inetpeer.h> | 23 | #include <net/inetpeer.h> |
23 | 24 | ||
@@ -46,6 +47,22 @@ struct fib_config { | |||
46 | 47 | ||
47 | struct fib_info; | 48 | struct fib_info; |
48 | 49 | ||
50 | struct fib_nh_exception { | ||
51 | struct fib_nh_exception __rcu *fnhe_next; | ||
52 | __be32 fnhe_daddr; | ||
53 | u32 fnhe_pmtu; | ||
54 | u32 fnhe_gw; | ||
55 | unsigned long fnhe_expires; | ||
56 | unsigned long fnhe_stamp; | ||
57 | }; | ||
58 | |||
59 | struct fnhe_hash_bucket { | ||
60 | struct fib_nh_exception __rcu *chain; | ||
61 | }; | ||
62 | |||
63 | #define FNHE_HASH_SIZE 2048 | ||
64 | #define FNHE_RECLAIM_DEPTH 5 | ||
65 | |||
49 | struct fib_nh { | 66 | struct fib_nh { |
50 | struct net_device *nh_dev; | 67 | struct net_device *nh_dev; |
51 | struct hlist_node nh_hash; | 68 | struct hlist_node nh_hash; |
@@ -63,6 +80,7 @@ struct fib_nh { | |||
63 | __be32 nh_gw; | 80 | __be32 nh_gw; |
64 | __be32 nh_saddr; | 81 | __be32 nh_saddr; |
65 | int nh_saddr_genid; | 82 | int nh_saddr_genid; |
83 | struct fnhe_hash_bucket *nh_exceptions; | ||
66 | }; | 84 | }; |
67 | 85 | ||
68 | /* | 86 | /* |