diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-12-07 13:26:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-09 20:56:12 -0500 |
commit | 1f9248e5606afc6485255e38ad57bdac08fa7711 (patch) | |
tree | ef0c88bbc7d05fb3dcbb15e167eb8ef5505bc667 /include/net/neighbour.h | |
parent | 65be6291c856bee0308c535287f813418402d8b3 (diff) |
neigh: convert parms to an array
This patch converts the neigh param members to an array. This allows easier
manipulation which will be needed later on to provide better management of
default values.
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/neighbour.h')
-rw-r--r-- | include/net/neighbour.h | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 536501a3e58d..4cb5478e2f6e 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -37,6 +37,32 @@ | |||
37 | 37 | ||
38 | struct neighbour; | 38 | struct neighbour; |
39 | 39 | ||
40 | enum { | ||
41 | NEIGH_VAR_MCAST_PROBES, | ||
42 | NEIGH_VAR_UCAST_PROBES, | ||
43 | NEIGH_VAR_APP_PROBES, | ||
44 | NEIGH_VAR_RETRANS_TIME, | ||
45 | NEIGH_VAR_BASE_REACHABLE_TIME, | ||
46 | NEIGH_VAR_DELAY_PROBE_TIME, | ||
47 | NEIGH_VAR_GC_STALETIME, | ||
48 | NEIGH_VAR_QUEUE_LEN_BYTES, | ||
49 | NEIGH_VAR_PROXY_QLEN, | ||
50 | NEIGH_VAR_ANYCAST_DELAY, | ||
51 | NEIGH_VAR_PROXY_DELAY, | ||
52 | NEIGH_VAR_LOCKTIME, | ||
53 | #define NEIGH_VAR_DATA_MAX (NEIGH_VAR_LOCKTIME + 1) | ||
54 | /* Following are used as a second way to access one of the above */ | ||
55 | NEIGH_VAR_QUEUE_LEN, /* same data as NEIGH_VAR_QUEUE_LEN_BYTES */ | ||
56 | NEIGH_VAR_RETRANS_TIME_MS, /* same data as NEIGH_VAR_RETRANS_TIME */ | ||
57 | NEIGH_VAR_BASE_REACHABLE_TIME_MS, /* same data as NEIGH_VAR_BASE_REACHABLE_TIME */ | ||
58 | /* Following are used by "default" only */ | ||
59 | NEIGH_VAR_GC_INTERVAL, | ||
60 | NEIGH_VAR_GC_THRESH1, | ||
61 | NEIGH_VAR_GC_THRESH2, | ||
62 | NEIGH_VAR_GC_THRESH3, | ||
63 | NEIGH_VAR_MAX | ||
64 | }; | ||
65 | |||
40 | struct neigh_parms { | 66 | struct neigh_parms { |
41 | #ifdef CONFIG_NET_NS | 67 | #ifdef CONFIG_NET_NS |
42 | struct net *net; | 68 | struct net *net; |
@@ -53,22 +79,18 @@ struct neigh_parms { | |||
53 | atomic_t refcnt; | 79 | atomic_t refcnt; |
54 | struct rcu_head rcu_head; | 80 | struct rcu_head rcu_head; |
55 | 81 | ||
56 | int base_reachable_time; | ||
57 | int retrans_time; | ||
58 | int gc_staletime; | ||
59 | int reachable_time; | 82 | int reachable_time; |
60 | int delay_probe_time; | 83 | int data[NEIGH_VAR_DATA_MAX]; |
61 | |||
62 | int queue_len_bytes; | ||
63 | int ucast_probes; | ||
64 | int app_probes; | ||
65 | int mcast_probes; | ||
66 | int anycast_delay; | ||
67 | int proxy_delay; | ||
68 | int proxy_qlen; | ||
69 | int locktime; | ||
70 | }; | 84 | }; |
71 | 85 | ||
86 | static inline void neigh_var_set(struct neigh_parms *p, int index, int val) | ||
87 | { | ||
88 | p->data[index] = val; | ||
89 | } | ||
90 | |||
91 | #define NEIGH_VAR(p, attr) ((p)->data[NEIGH_VAR_ ## attr]) | ||
92 | #define NEIGH_VAR_SET(p, attr, val) neigh_var_set(p, NEIGH_VAR_ ## attr, val) | ||
93 | |||
72 | struct neigh_statistics { | 94 | struct neigh_statistics { |
73 | unsigned long allocs; /* number of allocated neighs */ | 95 | unsigned long allocs; /* number of allocated neighs */ |
74 | unsigned long destroys; /* number of destroyed neighs */ | 96 | unsigned long destroys; /* number of destroyed neighs */ |