Lines Matching defs:nh

106 	struct nexthop	*nh;
144 struct list_head fi_list; /* v4 entries using nh */
145 struct list_head f6i_list; /* v6 entries using nh */
146 struct list_head fdb_list; /* fdb entries using this nh */
147 struct list_head grp_list; /* nh group entries using this nh */
152 u8 protocol; /* app managing this nh */
196 struct nh_notifier_single_info nh;
237 struct nh_notifier_single_info *nh;
262 static inline bool nexthop_get(struct nexthop *nh)
264 return refcount_inc_not_zero(&nh->refcnt);
267 static inline void nexthop_put(struct nexthop *nh)
269 if (refcount_dec_and_test(&nh->refcnt))
270 call_rcu_hurry(&nh->rcu, nexthop_free_rcu);
279 static inline bool nexthop_is_fdb(const struct nexthop *nh)
281 if (nh->is_group) {
284 nh_grp = rcu_dereference_rtnl(nh->nh_grp);
289 nhi = rcu_dereference_rtnl(nh->nh_info);
294 static inline bool nexthop_has_v4(const struct nexthop *nh)
296 if (nh->is_group) {
299 nh_grp = rcu_dereference_rtnl(nh->nh_grp);
305 static inline bool nexthop_is_multipath(const struct nexthop *nh)
307 if (nh->is_group) {
310 nh_grp = rcu_dereference_rtnl(nh->nh_grp);
316 struct nexthop *nexthop_select_path(struct nexthop *nh, int hash);
318 static inline unsigned int nexthop_num_path(const struct nexthop *nh)
322 if (nh->is_group) {
325 nh_grp = rcu_dereference_rtnl(nh->nh_grp);
342 return nhg->nh_entries[nhsel].nh;
346 int nexthop_mpath_fill_node(struct sk_buff *skb, struct nexthop *nh,
349 struct nh_group *nhg = rcu_dereference_rtnl(nh->nh_grp);
353 struct nexthop *nhe = nhg->nh_entries[i].nh;
366 static inline bool nexthop_is_blackhole(const struct nexthop *nh)
370 if (nh->is_group) {
373 nh_grp = rcu_dereference_rtnl(nh->nh_grp);
377 nh = nh_grp->nh_entries[0].nh;
380 nhi = rcu_dereference_rtnl(nh->nh_info);
387 struct nexthop *nh;
389 nh = nexthop_select_path(res->fi->nh, hash);
390 nhi = rcu_dereference(nh->nh_info);
396 struct fib_nh_common *nexthop_fib_nhc(struct nexthop *nh, int nhsel)
403 if (nh->is_group) {
406 nh_grp = rcu_dereference_rtnl(nh->nh_grp);
408 nh = nexthop_mpath_select(nh_grp, nhsel);
409 if (!nh)
414 nhi = rcu_dereference_rtnl(nh->nh_info);
420 struct fib_nh_common *nexthop_get_nhc_lookup(const struct nexthop *nh,
427 if (nh->is_group) {
428 struct nh_group *nhg = rcu_dereference(nh->nh_grp);
432 struct nexthop *nhe = nhg->nh_entries[i].nh;
441 nhi = rcu_dereference(nh->nh_info);
451 static inline bool nexthop_uses_dev(const struct nexthop *nh,
456 if (nh->is_group) {
457 struct nh_group *nhg = rcu_dereference(nh->nh_grp);
461 struct nexthop *nhe = nhg->nh_entries[i].nh;
468 nhi = rcu_dereference(nh->nh_info);
478 if (unlikely(fi->nh))
479 return nexthop_num_path(fi->nh);
484 int fib_check_nexthop(struct nexthop *nh, u8 scope,
489 if (unlikely(fi->nh))
490 return nexthop_fib_nhc(fi->nh, nhsel);
498 WARN_ON(fi->nh);
506 int fib6_check_nexthop(struct nexthop *nh, struct fib6_config *cfg,
510 static inline struct fib6_nh *nexthop_fib6_nh(struct nexthop *nh)
514 if (nh->is_group) {
517 nh_grp = rcu_dereference_rtnl(nh->nh_grp);
518 nh = nexthop_mpath_select(nh_grp, 0);
519 if (!nh)
523 nhi = rcu_dereference_rtnl(nh->nh_info);
534 fib6_nh = f6i->nh ? nexthop_fib6_nh(f6i->nh) : f6i->fib6_nh;
540 struct nexthop *nh = res->f6i->nh;
543 nh = nexthop_select_path(nh, hash);
545 nhi = rcu_dereference_rtnl(nh->nh_info);
549 res->nh = nexthop_fib6_nh(nh);
551 res->nh = &nhi->fib6_nh;
555 int nexthop_for_each_fib6_nh(struct nexthop *nh,
556 int (*cb)(struct fib6_nh *nh, void *arg),
559 static inline int nexthop_get_family(struct nexthop *nh)
561 struct nh_info *nhi = rcu_dereference_rtnl(nh->nh_info);
567 struct fib_nh_common *nexthop_fdb_nhc(struct nexthop *nh)
569 struct nh_info *nhi = rcu_dereference_rtnl(nh->nh_info);
574 static inline struct fib_nh_common *nexthop_path_fdb_result(struct nexthop *nh,
580 nhp = nexthop_select_path(nh, hash);