Home
last modified time | relevance | path

Searched refs:nh (Results 1 – 25 of 73) sorted by relevance

123

/Linux-v5.4/include/net/
Dnexthop.h64 struct nexthop *nh; member
105 static inline bool nexthop_get(struct nexthop *nh) in nexthop_get() argument
107 return refcount_inc_not_zero(&nh->refcnt); in nexthop_get()
110 static inline void nexthop_put(struct nexthop *nh) in nexthop_put() argument
112 if (refcount_dec_and_test(&nh->refcnt)) in nexthop_put()
113 call_rcu(&nh->rcu, nexthop_free_rcu); in nexthop_put()
122 static inline bool nexthop_is_multipath(const struct nexthop *nh) in nexthop_is_multipath() argument
124 if (nh->is_group) { in nexthop_is_multipath()
127 nh_grp = rcu_dereference_rtnl(nh->nh_grp); in nexthop_is_multipath()
133 struct nexthop *nexthop_select_path(struct nexthop *nh, int hash);
[all …]
/Linux-v5.4/kernel/
Dnotifier.c123 int atomic_notifier_chain_register(struct atomic_notifier_head *nh, in atomic_notifier_chain_register() argument
129 spin_lock_irqsave(&nh->lock, flags); in atomic_notifier_chain_register()
130 ret = notifier_chain_register(&nh->head, n); in atomic_notifier_chain_register()
131 spin_unlock_irqrestore(&nh->lock, flags); in atomic_notifier_chain_register()
145 int atomic_notifier_chain_unregister(struct atomic_notifier_head *nh, in atomic_notifier_chain_unregister() argument
151 spin_lock_irqsave(&nh->lock, flags); in atomic_notifier_chain_unregister()
152 ret = notifier_chain_unregister(&nh->head, n); in atomic_notifier_chain_unregister()
153 spin_unlock_irqrestore(&nh->lock, flags); in atomic_notifier_chain_unregister()
178 int __atomic_notifier_call_chain(struct atomic_notifier_head *nh, in __atomic_notifier_call_chain() argument
185 ret = notifier_call_chain(&nh->head, val, v, nr_to_call, nr_calls); in __atomic_notifier_call_chain()
[all …]
/Linux-v5.4/net/ipv4/
Dnexthop.c19 static void remove_nexthop(struct net *net, struct nexthop *nh,
61 static void nexthop_free_mpath(struct nexthop *nh) in nexthop_free_mpath() argument
66 nhg = rcu_dereference_raw(nh->nh_grp); in nexthop_free_mpath()
68 WARN_ON(nhg->nh_entries[i].nh); in nexthop_free_mpath()
73 static void nexthop_free_single(struct nexthop *nh) in nexthop_free_single() argument
77 nhi = rcu_dereference_raw(nh->nh_info); in nexthop_free_single()
80 fib_nh_release(nh->net, &nhi->fib_nh); in nexthop_free_single()
91 struct nexthop *nh = container_of(head, struct nexthop, rcu); in nexthop_free_rcu() local
93 if (nh->is_group) in nexthop_free_rcu()
94 nexthop_free_mpath(nh); in nexthop_free_rcu()
[all …]
Dfib_semantics.c66 int nhsel; const struct fib_nh *nh; \
67 for (nhsel = 0, nh = (fi)->fib_nh; \
69 nh++, nhsel++)
82 int nhsel; const struct fib_nh *nh = (fi)->fib_nh; \
235 if (fi->nh) { in free_fib_info_rcu()
236 nexthop_put(fi->nh); in free_fib_info_rcu()
267 if (fi->nh) { in fib_release_info()
286 if (fi->nh || ofi->nh) in nh_comp()
287 return nexthop_cmp(fi->nh, ofi->nh) ? 0 : -1; in nh_comp()
295 if (nh->fib_nh_oif != onh->fib_nh_oif || in nh_comp()
[all …]
/Linux-v5.4/net/decnet/
Ddn_fib.c53 #define for_nexthops(fi) { int nhsel; const struct dn_fib_nh *nh;\
54 for(nhsel = 0, nh = (fi)->fib_nh; nhsel < (fi)->fib_nhs; nh++, nhsel++)
56 #define change_nexthops(fi) { int nhsel; struct dn_fib_nh *nh;\
57 for(nhsel = 0, nh = (struct dn_fib_nh *)((fi)->fib_nh); nhsel < (fi)->fib_nhs; nh++, nhsel++)
95 if (nh->nh_dev) in dn_fib_free_info()
96 dev_put(nh->nh_dev); in dn_fib_free_info()
97 nh->nh_dev = NULL; in dn_fib_free_info()
123 if (nh->nh_oif != onh->nh_oif || in dn_fib_nh_comp()
124 nh->nh_gw != onh->nh_gw || in dn_fib_nh_comp()
125 nh->nh_scope != onh->nh_scope || in dn_fib_nh_comp()
[all …]
/Linux-v5.4/include/linux/
Dnotifier.h93 extern void srcu_init_notifier_head(struct srcu_notifier_head *nh);
144 extern int atomic_notifier_chain_register(struct atomic_notifier_head *nh,
146 extern int blocking_notifier_chain_register(struct blocking_notifier_head *nh,
148 extern int raw_notifier_chain_register(struct raw_notifier_head *nh,
150 extern int srcu_notifier_chain_register(struct srcu_notifier_head *nh,
154 struct blocking_notifier_head *nh,
157 extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *nh,
159 extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *nh,
161 extern int raw_notifier_chain_unregister(struct raw_notifier_head *nh,
163 extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *nh,
[all …]
/Linux-v5.4/drivers/net/ethernet/mellanox/mlxsw/
Dspectrum_router.h82 struct mlxsw_sp_nexthop *nh);
83 bool mlxsw_sp_nexthop_offload(struct mlxsw_sp_nexthop *nh);
84 unsigned char *mlxsw_sp_nexthop_ha(struct mlxsw_sp_nexthop *nh);
85 int mlxsw_sp_nexthop_indexes(struct mlxsw_sp_nexthop *nh, u32 *p_adj_index,
87 struct mlxsw_sp_rif *mlxsw_sp_nexthop_rif(struct mlxsw_sp_nexthop *nh);
88 bool mlxsw_sp_nexthop_group_has_ipip(struct mlxsw_sp_nexthop *nh);
89 #define mlxsw_sp_nexthop_for_each(nh, router) \ argument
90 for (nh = mlxsw_sp_nexthop_next(router, NULL); nh; \
91 nh = mlxsw_sp_nexthop_next(router, nh))
93 struct mlxsw_sp_nexthop *nh, u64 *p_counter);
[all …]
Dspectrum_router.c2725 struct mlxsw_sp_nexthop *nh) in mlxsw_sp_nexthop_counter_alloc() argument
2734 if (mlxsw_sp_flow_counter_alloc(mlxsw_sp, &nh->counter_index)) in mlxsw_sp_nexthop_counter_alloc()
2737 nh->counter_valid = true; in mlxsw_sp_nexthop_counter_alloc()
2741 struct mlxsw_sp_nexthop *nh) in mlxsw_sp_nexthop_counter_free() argument
2743 if (!nh->counter_valid) in mlxsw_sp_nexthop_counter_free()
2745 mlxsw_sp_flow_counter_free(mlxsw_sp, nh->counter_index); in mlxsw_sp_nexthop_counter_free()
2746 nh->counter_valid = false; in mlxsw_sp_nexthop_counter_free()
2750 struct mlxsw_sp_nexthop *nh, u64 *p_counter) in mlxsw_sp_nexthop_counter_get() argument
2752 if (!nh->counter_valid) in mlxsw_sp_nexthop_counter_get()
2755 return mlxsw_sp_flow_counter_get(mlxsw_sp, nh->counter_index, in mlxsw_sp_nexthop_counter_get()
[all …]
Dspectrum_dpipe.c909 struct mlxsw_sp_nexthop *nh; in mlxsw_sp_dpipe_table_adj_size() local
912 mlxsw_sp_nexthop_for_each(nh, mlxsw_sp->router) in mlxsw_sp_dpipe_table_adj_size()
913 if (mlxsw_sp_nexthop_offload(nh) && in mlxsw_sp_dpipe_table_adj_size()
914 !mlxsw_sp_nexthop_group_has_ipip(nh)) in mlxsw_sp_dpipe_table_adj_size()
1063 struct mlxsw_sp_nexthop *nh, in mlxsw_sp_dpipe_table_adj_entry_fill() argument
1066 struct mlxsw_sp_rif *rif = mlxsw_sp_nexthop_rif(nh); in mlxsw_sp_dpipe_table_adj_entry_fill()
1067 unsigned char *ha = mlxsw_sp_nexthop_ha(nh); in mlxsw_sp_dpipe_table_adj_entry_fill()
1073 mlxsw_sp_nexthop_indexes(nh, &adj_index, &adj_size, &adj_hash_index); in mlxsw_sp_dpipe_table_adj_entry_fill()
1076 err = mlxsw_sp_nexthop_counter_get(mlxsw_sp, nh, &entry->counter); in mlxsw_sp_dpipe_table_adj_entry_fill()
1087 struct mlxsw_sp_nexthop *nh; in mlxsw_sp_dpipe_table_adj_entries_get() local
[all …]
/Linux-v5.4/samples/bpf/
Dxdp_router_ipv4_user.c94 struct nlmsghdr *nh; in recv_msg() local
104 nh = (struct nlmsghdr *)buf_ptr; in recv_msg()
106 if (nh->nlmsg_type == NLMSG_DONE) in recv_msg()
122 static void read_route(struct nlmsghdr *nh, int nll) in read_route() argument
148 if (nh->nlmsg_type == RTM_DELROUTE) in read_route()
150 else if (nh->nlmsg_type == RTM_GETROUTE) in read_route()
152 else if (nh->nlmsg_type == RTM_NEWROUTE) in read_route()
155 printf("%d\n", nh->nlmsg_type); in read_route()
159 for (; NLMSG_OK(nh, nll); nh = NLMSG_NEXT(nh, nll)) { in read_route()
160 rt_msg = (struct rtmsg *)NLMSG_DATA(nh); in read_route()
[all …]
/Linux-v5.4/net/ipv6/
Droute.c101 static int rt6_score_route(const struct fib6_nh *nh, u32 fib6_flags, int oif,
432 if ((!match->fib6_nsiblings && !match->nh) || have_oif_match) in fib6_select_path()
439 (!match->nh || nexthop_is_multipath(match->nh))) in fib6_select_path()
442 if (unlikely(match->nh)) { in fib6_select_path()
452 const struct fib6_nh *nh = sibling->fib6_nh; in fib6_select_path() local
455 nh_upper_bound = atomic_read(&nh->fib_nh_upper_bound); in fib6_select_path()
458 if (rt6_score_route(nh, sibling->fib6_flags, oif, strict) < 0) in fib6_select_path()
466 res->nh = match->fib6_nh; in fib6_select_path()
473 static bool __rt6_device_match(struct net *net, const struct fib6_nh *nh, in __rt6_device_match() argument
478 if (nh->fib_nh_flags & RTNH_F_DEAD) in __rt6_device_match()
[all …]
Dexthdrs.c118 const unsigned char *nh = skb_network_header(skb); in ip6_parse_tlv() local
137 int optlen = nh[off + 1] + 2; in ip6_parse_tlv()
140 switch (nh[off]) { in ip6_parse_tlv()
162 if (nh[off + i] != 0) in ip6_parse_tlv()
176 if (curr->type == nh[off]) { in ip6_parse_tlv()
726 const unsigned char *nh = skb_network_header(skb); in ipv6_hop_ra() local
728 if (nh[optoff + 1] == 2) { in ipv6_hop_ra()
730 memcpy(&IP6CB(skb)->ra, nh + optoff + 2, sizeof(IP6CB(skb)->ra)); in ipv6_hop_ra()
734 nh[optoff + 1]); in ipv6_hop_ra()
743 const unsigned char *nh = skb_network_header(skb); in ipv6_hop_jumbo() local
[all …]
Dexthdrs_core.c118 const unsigned char *nh = skb_network_header(skb); in ipv6_find_tlv() local
125 hdr = (struct ipv6_opt_hdr *)(nh + offset); in ipv6_find_tlv()
135 int opttype = nh[offset]; in ipv6_find_tlv()
146 optlen = nh[offset + 1] + 2; in ipv6_find_tlv()
/Linux-v5.4/arch/alpha/boot/
DMakefile13 vmlinux.nh tools/lxboot tools/bootlx tools/bootph \
21 $(obj)/bootimage: $(addprefix $(obj)/tools/,mkbb lxboot bootlx) $(obj)/vmlinux.nh
22 ( cat $(obj)/tools/lxboot $(obj)/tools/bootlx $(obj)/vmlinux.nh ) > $@
27 $(obj)/bootpfile: $(obj)/tools/bootph $(obj)/vmlinux.nh
28 cat $(obj)/tools/bootph $(obj)/vmlinux.nh > $@
35 $(obj)/bootpzfile: $(obj)/tools/bootpzh $(obj)/vmlinux.nh.gz
36 cat $(obj)/tools/bootpzh $(obj)/vmlinux.nh.gz > $@
50 $(obj)/ksize.h: $(obj)/vmlinux.nh FORCE
59 $(obj)/kzsize.h: $(obj)/vmlinux.nh.gz FORCE
78 OSFLAGS_vmlinux.nh := -v
[all …]
/Linux-v5.4/net/mpls/
Daf_mpls.c95 static u8 *__mpls_nh_via(struct mpls_route *rt, struct mpls_nh *nh) in __mpls_nh_via() argument
97 return (u8 *)nh + rt->rt_via_offset; in __mpls_nh_via()
101 const struct mpls_nh *nh) in mpls_nh_via() argument
103 return __mpls_nh_via((struct mpls_route *)rt, (struct mpls_nh *)nh); in mpls_nh_via()
106 static unsigned int mpls_nh_header_size(const struct mpls_nh *nh) in mpls_nh_header_size() argument
109 return nh->nh_labels * sizeof(struct mpls_shim_hdr); in mpls_nh_header_size()
256 unsigned int nh_flags = READ_ONCE(nh->nh_flags); in mpls_select_multipath()
261 return nh; in mpls_select_multipath()
347 struct mpls_nh *nh; in mpls_forward() local
390 nh = mpls_select_multipath(rt, skb); in mpls_forward()
[all …]
Dinternal.h161 int nhsel; struct mpls_nh *nh; u8 *__nh; \
162 for (nhsel = 0, nh = (rt)->rt_nh, __nh = (u8 *)((rt)->rt_nh); \
164 __nh += rt->rt_nh_size, nh = (struct mpls_nh *)__nh, nhsel++)
167 int nhsel; struct mpls_nh *nh; u8 *__nh; \
168 for (nhsel = 0, nh = (struct mpls_nh *)((rt)->rt_nh), \
171 __nh += rt->rt_nh_size, nh = (struct mpls_nh *)__nh, nhsel++)
/Linux-v5.4/arch/arm/vfp/
Dvfp.h44 static inline void add128(u64 *resh, u64 *resl, u64 nh, u64 nl, u64 mh, u64 ml) in add128() argument
50 : "=r" (nl), "=r" (nh) in add128()
51 : "0" (nl), "1" (nh), "r" (ml), "r" (mh) in add128()
53 *resh = nh; in add128()
57 static inline void sub128(u64 *resh, u64 *resl, u64 nh, u64 nl, u64 mh, u64 ml) in sub128() argument
63 : "=r" (nl), "=r" (nh) in sub128()
64 : "0" (nl), "1" (nh), "r" (ml), "r" (mh) in sub128()
66 *resh = nh; in sub128()
72 u32 nh, nl, mh, ml; in mul64to128() local
79 nh = n >> 32; in mul64to128()
[all …]
/Linux-v5.4/net/openvswitch/
Dactions.c312 const struct nshhdr *nh) in push_nsh() argument
316 err = nsh_push(skb, nh); in push_nsh()
343 static void update_ip_l4_checksum(struct sk_buff *skb, struct iphdr *nh, in update_ip_l4_checksum() argument
348 if (nh->frag_off & htons(IP_OFFSET)) in update_ip_l4_checksum()
351 if (nh->protocol == IPPROTO_TCP) { in update_ip_l4_checksum()
355 } else if (nh->protocol == IPPROTO_UDP) { in update_ip_l4_checksum()
369 static void set_ip_addr(struct sk_buff *skb, struct iphdr *nh, in set_ip_addr() argument
372 update_ip_l4_checksum(skb, nh, *addr, new_addr); in set_ip_addr()
373 csum_replace4(&nh->check, *addr, new_addr); in set_ip_addr()
425 static void set_ipv6_fl(struct ipv6hdr *nh, u32 fl, u32 mask) in set_ipv6_fl() argument
[all …]
Dflow.c248 struct ipv6hdr *nh; in parse_ipv6hdr() local
251 err = check_header(skb, nh_ofs + sizeof(*nh)); in parse_ipv6hdr()
255 nh = ipv6_hdr(skb); in parse_ipv6hdr()
258 key->ip.tos = ipv6_get_dsfield(nh); in parse_ipv6hdr()
259 key->ip.ttl = nh->hop_limit; in parse_ipv6hdr()
260 key->ipv6.label = *(__be32 *)nh & htonl(IPV6_FLOWINFO_FLOWLABEL); in parse_ipv6hdr()
261 key->ipv6.addr.src = nh->saddr; in parse_ipv6hdr()
262 key->ipv6.addr.dst = nh->daddr; in parse_ipv6hdr()
481 struct nshhdr *nh; in parse_nsh() local
490 nh = nsh_hdr(skb); in parse_nsh()
[all …]
/Linux-v5.4/tools/lib/bpf/
Dnetlink.c79 struct nlmsghdr *nh; in bpf_netlink_recv() local
94 for (nh = (struct nlmsghdr *)buf; NLMSG_OK(nh, len); in bpf_netlink_recv()
95 nh = NLMSG_NEXT(nh, len)) { in bpf_netlink_recv()
96 if (nh->nlmsg_pid != nl_pid) { in bpf_netlink_recv()
100 if (nh->nlmsg_seq != seq) { in bpf_netlink_recv()
104 if (nh->nlmsg_flags & NLM_F_MULTI) in bpf_netlink_recv()
106 switch (nh->nlmsg_type) { in bpf_netlink_recv()
108 err = (struct nlmsgerr *)NLMSG_DATA(nh); in bpf_netlink_recv()
112 libbpf_nla_dump_errormsg(nh); in bpf_netlink_recv()
120 ret = _fn(nh, fn, cookie); in bpf_netlink_recv()
[all …]
/Linux-v5.4/net/nsh/
Dnsh.c16 struct nshhdr *nh; in nsh_push() local
33 nh = (struct nshhdr *)(skb->data); in nsh_push()
34 memcpy(nh, pushed_nh, length); in nsh_push()
35 nh->np = next_proto; in nsh_push()
36 skb_postpush_rcsum(skb, nh, length); in nsh_push()
49 struct nshhdr *nh; in nsh_pop() local
55 nh = (struct nshhdr *)(skb->data); in nsh_pop()
56 length = nsh_hdr_len(nh); in nsh_pop()
59 inner_proto = tun_p_to_eth_p(nh->np); in nsh_pop()
/Linux-v5.4/drivers/net/ethernet/mellanox/mlx5/core/
Dpci_irq.c16 struct atomic_notifier_head nh; member
64 return atomic_notifier_chain_register(&irq->nh, nb); in mlx5_irq_attach_nb()
73 return atomic_notifier_chain_unregister(&irq->nh, nb); in mlx5_irq_detach_nb()
76 static irqreturn_t mlx5_irq_int_handler(int irq, void *nh) in mlx5_irq_int_handler() argument
78 atomic_notifier_call_chain(nh, 0, NULL); in mlx5_irq_int_handler()
105 ATOMIC_INIT_NOTIFIER_HEAD(&irq->nh); in request_irqs()
109 &irq->nh); in request_irqs()
122 free_irq(irqn, &irq->nh); in request_irqs()
258 &mlx5_irq_get(dev, i)->nh); in unrequest_irqs()
330 &mlx5_irq_get(dev, i)->nh); in mlx5_irq_table_destroy()
/Linux-v5.4/net/bridge/
Dbr_netfilter_ipv6.c50 const unsigned char *nh = skb_network_header(skb); in br_nf_check_hbh_len() local
51 int off = raw - nh; in br_nf_check_hbh_len()
61 int optlen = nh[off + 1] + 2; in br_nf_check_hbh_len()
63 switch (nh[off]) { in br_nf_check_hbh_len()
72 if (nh[off + 1] != 4 || (off & 3) != 2) in br_nf_check_hbh_len()
74 pkt_len = ntohl(*(__be32 *)(nh + off + 2)); in br_nf_check_hbh_len()
83 nh = skb_network_header(skb); in br_nf_check_hbh_len()
/Linux-v5.4/include/trace/events/
Dfib6.h65 if (res->nh && res->nh->fib_nh_dev) {
66 __assign_str(name, res->nh->fib_nh_dev);
76 } else if (res->nh) {
78 *in6 = res->nh->fib_nh_gw6;
/Linux-v5.4/scripts/dtc/libfdt/
Dfdt_sw.c213 struct fdt_node_header *nh; in fdt_begin_node() local
219 nh = fdt_grab_space_(fdt, sizeof(*nh) + FDT_TAGALIGN(namelen)); in fdt_begin_node()
220 if (! nh) in fdt_begin_node()
223 nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE); in fdt_begin_node()
224 memcpy(nh->name, name, namelen); in fdt_begin_node()

123