Lines Matching refs:dst
119 void (*update_pmtu)(struct dst_entry *dst, u32 mtu);
130 dst_metric(const struct dst_entry *dst, int metric) in dst_metric() argument
132 return dst->metrics[metric-1]; in dst_metric()
135 static inline u32 dst_mtu(const struct dst_entry *dst) in dst_mtu() argument
137 u32 mtu = dst_metric(dst, RTAX_MTU); in dst_mtu()
146 static inline unsigned long dst_metric_rtt(const struct dst_entry *dst, int metric) in dst_metric_rtt() argument
148 return msecs_to_jiffies(dst_metric(dst, metric)); in dst_metric_rtt()
151 static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric, in set_dst_metric_rtt() argument
154 dst->metrics[metric-1] = jiffies_to_msecs(rtt); in set_dst_metric_rtt()
158 dst_allfrag(const struct dst_entry *dst) in dst_allfrag() argument
160 int ret = dst_metric(dst, RTAX_FEATURES) & RTAX_FEATURE_ALLFRAG; in dst_allfrag()
167 dst_metric_locked(struct dst_entry *dst, int metric) in dst_metric_locked() argument
169 return dst_metric(dst, RTAX_LOCK) & (1<<metric); in dst_metric_locked()
172 static inline void dst_hold(struct dst_entry * dst) in dst_hold() argument
179 atomic_inc(&dst->__refcnt); in dst_hold()
182 static inline void dst_use(struct dst_entry *dst, unsigned long time) in dst_use() argument
184 dst_hold(dst); in dst_use()
185 dst->__use++; in dst_use()
186 dst->lastuse = time; in dst_use()
190 struct dst_entry * dst_clone(struct dst_entry * dst) in dst_clone() argument
192 if (dst) in dst_clone()
193 atomic_inc(&dst->__refcnt); in dst_clone()
194 return dst; in dst_clone()
197 extern void dst_release(struct dst_entry *dst);
203 static inline struct dst_entry *dst_pop(struct dst_entry *dst) in dst_pop() argument
205 struct dst_entry *child = dst_clone(dst->child); in dst_pop()
207 dst_release(dst); in dst_pop()
213 extern void __dst_free(struct dst_entry * dst);
214 extern struct dst_entry *dst_destroy(struct dst_entry * dst);
216 static inline void dst_free(struct dst_entry * dst) in dst_free() argument
218 if (dst->obsolete > 1) in dst_free()
220 if (!atomic_read(&dst->__refcnt)) { in dst_free()
221 dst = dst_destroy(dst); in dst_free()
222 if (!dst) in dst_free()
225 __dst_free(dst); in dst_free()
230 struct dst_entry *dst = container_of(head, struct dst_entry, rcu_head); in dst_rcu_free() local
231 dst_free(dst); in dst_rcu_free()
234 static inline void dst_confirm(struct dst_entry *dst) in dst_confirm() argument
236 if (dst) in dst_confirm()
237 neigh_confirm(dst->neighbour); in dst_confirm()
242 struct dst_entry * dst = *dst_p; in dst_negative_advice() local
243 if (dst && dst->ops->negative_advice) in dst_negative_advice()
244 *dst_p = dst->ops->negative_advice(dst); in dst_negative_advice()
249 struct dst_entry * dst = skb->dst; in dst_link_failure() local
250 if (dst && dst->ops && dst->ops->link_failure) in dst_link_failure()
251 dst->ops->link_failure(skb); in dst_link_failure()
254 static inline void dst_set_expires(struct dst_entry *dst, int timeout) in dst_set_expires() argument
261 if (dst->expires == 0 || time_before(expires, dst->expires)) in dst_set_expires()
262 dst->expires = expires; in dst_set_expires()
268 return skb->dst->output(skb); in dst_output()
274 return skb->dst->input(skb); in dst_input()
277 static inline struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie) in dst_check() argument
279 if (dst->obsolete) in dst_check()
280 dst = dst->ops->check(dst, cookie); in dst_check()
281 return dst; in dst_check()