aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/dst.h6
-rw-r--r--include/net/ip6_fib.h48
-rw-r--r--include/net/red.h6
-rw-r--r--include/net/sock.h1
4 files changed, 57 insertions, 4 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 59c5d18cc385..ff4da42fcfc6 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -36,7 +36,11 @@ struct dst_entry {
36 struct net_device *dev; 36 struct net_device *dev;
37 struct dst_ops *ops; 37 struct dst_ops *ops;
38 unsigned long _metrics; 38 unsigned long _metrics;
39 unsigned long expires; 39 union {
40 unsigned long expires;
41 /* point to where the dst_entry copied from */
42 struct dst_entry *from;
43 };
40 struct dst_entry *path; 44 struct dst_entry *path;
41 struct neighbour __rcu *_neighbour; 45 struct neighbour __rcu *_neighbour;
42#ifdef CONFIG_XFRM 46#ifdef CONFIG_XFRM
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index b26bb8101981..0ae759a6c76e 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -123,6 +123,54 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst)
123 return ((struct rt6_info *)dst)->rt6i_idev; 123 return ((struct rt6_info *)dst)->rt6i_idev;
124} 124}
125 125
126static inline void rt6_clean_expires(struct rt6_info *rt)
127{
128 if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from)
129 dst_release(rt->dst.from);
130
131 rt->rt6i_flags &= ~RTF_EXPIRES;
132 rt->dst.from = NULL;
133}
134
135static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires)
136{
137 if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from)
138 dst_release(rt->dst.from);
139
140 rt->rt6i_flags |= RTF_EXPIRES;
141 rt->dst.expires = expires;
142}
143
144static inline void rt6_update_expires(struct rt6_info *rt, int timeout)
145{
146 if (!(rt->rt6i_flags & RTF_EXPIRES)) {
147 if (rt->dst.from)
148 dst_release(rt->dst.from);
149 /* dst_set_expires relies on expires == 0
150 * if it has not been set previously.
151 */
152 rt->dst.expires = 0;
153 }
154
155 dst_set_expires(&rt->dst, timeout);
156 rt->rt6i_flags |= RTF_EXPIRES;
157}
158
159static inline void rt6_set_from(struct rt6_info *rt, struct rt6_info *from)
160{
161 struct dst_entry *new = (struct dst_entry *) from;
162
163 if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from) {
164 if (new == rt->dst.from)
165 return;
166 dst_release(rt->dst.from);
167 }
168
169 rt->rt6i_flags &= ~RTF_EXPIRES;
170 rt->dst.from = new;
171 dst_hold(new);
172}
173
126struct fib6_walker_t { 174struct fib6_walker_t {
127 struct list_head lh; 175 struct list_head lh;
128 struct fib6_node *root, *node; 176 struct fib6_node *root, *node;
diff --git a/include/net/red.h b/include/net/red.h
index 77d4c3745cb5..ef46058d35bf 100644
--- a/include/net/red.h
+++ b/include/net/red.h
@@ -245,7 +245,7 @@ static inline unsigned long red_calc_qavg_from_idle_time(const struct red_parms
245 * 245 *
246 * dummy packets as a burst after idle time, i.e. 246 * dummy packets as a burst after idle time, i.e.
247 * 247 *
248 * p->qavg *= (1-W)^m 248 * v->qavg *= (1-W)^m
249 * 249 *
250 * This is an apparently overcomplicated solution (f.e. we have to 250 * This is an apparently overcomplicated solution (f.e. we have to
251 * precompute a table to make this calculation in reasonable time) 251 * precompute a table to make this calculation in reasonable time)
@@ -279,7 +279,7 @@ static inline unsigned long red_calc_qavg_no_idle_time(const struct red_parms *p
279 unsigned int backlog) 279 unsigned int backlog)
280{ 280{
281 /* 281 /*
282 * NOTE: p->qavg is fixed point number with point at Wlog. 282 * NOTE: v->qavg is fixed point number with point at Wlog.
283 * The formula below is equvalent to floating point 283 * The formula below is equvalent to floating point
284 * version: 284 * version:
285 * 285 *
@@ -390,7 +390,7 @@ static inline void red_adaptative_algo(struct red_parms *p, struct red_vars *v)
390 if (red_is_idling(v)) 390 if (red_is_idling(v))
391 qavg = red_calc_qavg_from_idle_time(p, v); 391 qavg = red_calc_qavg_from_idle_time(p, v);
392 392
393 /* p->qavg is fixed point number with point at Wlog */ 393 /* v->qavg is fixed point number with point at Wlog */
394 qavg >>= p->Wlog; 394 qavg >>= p->Wlog;
395 395
396 if (qavg > p->target_max && p->max_P <= MAX_P_MAX) 396 if (qavg > p->target_max && p->max_P <= MAX_P_MAX)
diff --git a/include/net/sock.h b/include/net/sock.h
index a6ba1f8871fd..188532ee88b6 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -246,6 +246,7 @@ struct cg_proto;
246 * @sk_user_data: RPC layer private data 246 * @sk_user_data: RPC layer private data
247 * @sk_sndmsg_page: cached page for sendmsg 247 * @sk_sndmsg_page: cached page for sendmsg
248 * @sk_sndmsg_off: cached offset for sendmsg 248 * @sk_sndmsg_off: cached offset for sendmsg
249 * @sk_peek_off: current peek_offset value
249 * @sk_send_head: front of stuff to transmit 250 * @sk_send_head: front of stuff to transmit
250 * @sk_security: used by security modules 251 * @sk_security: used by security modules
251 * @sk_mark: generic packet mark 252 * @sk_mark: generic packet mark