Home
last modified time | relevance | path

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

123

/Linux-v4.19/kernel/
Dnotifier.c121 int atomic_notifier_chain_register(struct atomic_notifier_head *nh, in atomic_notifier_chain_register() argument
127 spin_lock_irqsave(&nh->lock, flags); in atomic_notifier_chain_register()
128 ret = notifier_chain_register(&nh->head, n); in atomic_notifier_chain_register()
129 spin_unlock_irqrestore(&nh->lock, flags); in atomic_notifier_chain_register()
143 int atomic_notifier_chain_unregister(struct atomic_notifier_head *nh, in atomic_notifier_chain_unregister() argument
149 spin_lock_irqsave(&nh->lock, flags); in atomic_notifier_chain_unregister()
150 ret = notifier_chain_unregister(&nh->head, n); in atomic_notifier_chain_unregister()
151 spin_unlock_irqrestore(&nh->lock, flags); in atomic_notifier_chain_unregister()
176 int __atomic_notifier_call_chain(struct atomic_notifier_head *nh, in __atomic_notifier_call_chain() argument
183 ret = notifier_call_chain(&nh->head, val, v, nr_to_call, nr_calls); in __atomic_notifier_call_chain()
[all …]
/Linux-v4.19/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-v4.19/include/linux/
Dnotifier.h93 extern void srcu_init_notifier_head(struct srcu_notifier_head *nh);
145 extern int atomic_notifier_chain_register(struct atomic_notifier_head *nh,
147 extern int blocking_notifier_chain_register(struct blocking_notifier_head *nh,
149 extern int raw_notifier_chain_register(struct raw_notifier_head *nh,
151 extern int srcu_notifier_chain_register(struct srcu_notifier_head *nh,
155 struct blocking_notifier_head *nh,
158 extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *nh,
160 extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *nh,
162 extern int raw_notifier_chain_unregister(struct raw_notifier_head *nh,
164 extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *nh,
[all …]
/Linux-v4.19/net/ipv4/
Dfib_semantics.c64 int nhsel; const struct fib_nh *nh; \
65 for (nhsel = 0, nh = (fi)->fib_nh; \
67 nh++, nhsel++)
80 int nhsel; const struct fib_nh *nh = (fi)->fib_nh; \
160 static void free_nh_exceptions(struct fib_nh *nh) in free_nh_exceptions() argument
165 hash = rcu_dereference_protected(nh->nh_exceptions, 1); in free_nh_exceptions()
268 if (nh->nh_oif != onh->nh_oif || in nh_comp()
269 nh->nh_gw != onh->nh_gw || in nh_comp()
270 nh->nh_scope != onh->nh_scope || in nh_comp()
272 nh->nh_weight != onh->nh_weight || in nh_comp()
[all …]
Droute.c635 static void update_or_create_fnhe(struct fib_nh *nh, __be32 daddr, __be32 gw, in update_or_create_fnhe() argument
645 genid = fnhe_genid(dev_net(nh->nh_dev)); in update_or_create_fnhe()
650 hash = rcu_dereference(nh->nh_exceptions); in update_or_create_fnhe()
655 rcu_assign_pointer(nh->nh_exceptions, hash); in update_or_create_fnhe()
707 rt = rcu_dereference(nh->nh_rth_input); in update_or_create_fnhe()
713 prt = per_cpu_ptr(nh->nh_pcpu_rth_output, i); in update_or_create_fnhe()
779 struct fib_nh *nh = &FIB_RES_NH(res); in __ip_do_redirect() local
781 update_or_create_fnhe(nh, fl4->daddr, new_gw, in __ip_do_redirect()
1025 struct fib_nh *nh = &FIB_RES_NH(res); in __ip_rt_update_pmtu() local
1027 update_or_create_fnhe(nh, fl4->daddr, 0, mtu, lock, in __ip_rt_update_pmtu()
[all …]
/Linux-v4.19/drivers/net/ethernet/mellanox/mlxsw/
Dspectrum_router.h96 struct mlxsw_sp_nexthop *nh);
97 bool mlxsw_sp_nexthop_offload(struct mlxsw_sp_nexthop *nh);
98 unsigned char *mlxsw_sp_nexthop_ha(struct mlxsw_sp_nexthop *nh);
99 int mlxsw_sp_nexthop_indexes(struct mlxsw_sp_nexthop *nh, u32 *p_adj_index,
101 struct mlxsw_sp_rif *mlxsw_sp_nexthop_rif(struct mlxsw_sp_nexthop *nh);
102 bool mlxsw_sp_nexthop_group_has_ipip(struct mlxsw_sp_nexthop *nh);
103 #define mlxsw_sp_nexthop_for_each(nh, router) \ argument
104 for (nh = mlxsw_sp_nexthop_next(router, NULL); nh; \
105 nh = mlxsw_sp_nexthop_next(router, nh))
107 struct mlxsw_sp_nexthop *nh, u64 *p_counter);
[all …]
Dspectrum_router.c2612 struct mlxsw_sp_nexthop *nh) in mlxsw_sp_nexthop_counter_alloc() argument
2621 if (mlxsw_sp_flow_counter_alloc(mlxsw_sp, &nh->counter_index)) in mlxsw_sp_nexthop_counter_alloc()
2624 nh->counter_valid = true; in mlxsw_sp_nexthop_counter_alloc()
2628 struct mlxsw_sp_nexthop *nh) in mlxsw_sp_nexthop_counter_free() argument
2630 if (!nh->counter_valid) in mlxsw_sp_nexthop_counter_free()
2632 mlxsw_sp_flow_counter_free(mlxsw_sp, nh->counter_index); in mlxsw_sp_nexthop_counter_free()
2633 nh->counter_valid = false; in mlxsw_sp_nexthop_counter_free()
2637 struct mlxsw_sp_nexthop *nh, u64 *p_counter) in mlxsw_sp_nexthop_counter_get() argument
2639 if (!nh->counter_valid) in mlxsw_sp_nexthop_counter_get()
2642 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-v4.19/samples/bpf/
Dxdp_router_ipv4_user.c78 struct nlmsghdr *nh; in recv_msg() local
88 nh = (struct nlmsghdr *)buf_ptr; in recv_msg()
90 if (nh->nlmsg_type == NLMSG_DONE) in recv_msg()
106 static void read_route(struct nlmsghdr *nh, int nll) in read_route() argument
132 if (nh->nlmsg_type == RTM_DELROUTE) in read_route()
134 else if (nh->nlmsg_type == RTM_GETROUTE) in read_route()
136 else if (nh->nlmsg_type == RTM_NEWROUTE) in read_route()
139 printf("%d\n", nh->nlmsg_type); in read_route()
143 for (; NLMSG_OK(nh, nll); nh = NLMSG_NEXT(nh, nll)) { in read_route()
144 rt_msg = (struct rtmsg *)NLMSG_DATA(nh); in read_route()
[all …]
/Linux-v4.19/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-v4.19/net/mpls/
Daf_mpls.c96 static u8 *__mpls_nh_via(struct mpls_route *rt, struct mpls_nh *nh) in __mpls_nh_via() argument
98 return (u8 *)nh + rt->rt_via_offset; in __mpls_nh_via()
102 const struct mpls_nh *nh) in mpls_nh_via() argument
104 return __mpls_nh_via((struct mpls_route *)rt, (struct mpls_nh *)nh); in mpls_nh_via()
107 static unsigned int mpls_nh_header_size(const struct mpls_nh *nh) in mpls_nh_header_size() argument
110 return nh->nh_labels * sizeof(struct mpls_shim_hdr); in mpls_nh_header_size()
257 unsigned int nh_flags = READ_ONCE(nh->nh_flags); in mpls_select_multipath()
262 return nh; in mpls_select_multipath()
348 struct mpls_nh *nh; in mpls_forward() local
391 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-v4.19/arch/arm/vfp/
Dvfp.h47 static inline void add128(u64 *resh, u64 *resl, u64 nh, u64 nl, u64 mh, u64 ml) in add128() argument
53 : "=r" (nl), "=r" (nh) in add128()
54 : "0" (nl), "1" (nh), "r" (ml), "r" (mh) in add128()
56 *resh = nh; in add128()
60 static inline void sub128(u64 *resh, u64 *resl, u64 nh, u64 nl, u64 mh, u64 ml) in sub128() argument
66 : "=r" (nl), "=r" (nh) in sub128()
67 : "0" (nl), "1" (nh), "r" (ml), "r" (mh) in sub128()
69 *resh = nh; in sub128()
75 u32 nh, nl, mh, ml; in mul64to128() local
82 nh = n >> 32; in mul64to128()
[all …]
/Linux-v4.19/net/openvswitch/
Dactions.c385 const struct nshhdr *nh) in push_nsh() argument
389 err = nsh_push(skb, nh); in push_nsh()
416 static void update_ip_l4_checksum(struct sk_buff *skb, struct iphdr *nh, in update_ip_l4_checksum() argument
421 if (nh->frag_off & htons(IP_OFFSET)) in update_ip_l4_checksum()
424 if (nh->protocol == IPPROTO_TCP) { in update_ip_l4_checksum()
428 } else if (nh->protocol == IPPROTO_UDP) { in update_ip_l4_checksum()
442 static void set_ip_addr(struct sk_buff *skb, struct iphdr *nh, in set_ip_addr() argument
445 update_ip_l4_checksum(skb, nh, *addr, new_addr); in set_ip_addr()
446 csum_replace4(&nh->check, *addr, new_addr); in set_ip_addr()
498 static void set_ipv6_fl(struct ipv6hdr *nh, u32 fl, u32 mask) in set_ipv6_fl() argument
[all …]
Dflow.c260 struct ipv6hdr *nh; in parse_ipv6hdr() local
265 err = check_header(skb, nh_ofs + sizeof(*nh)); in parse_ipv6hdr()
269 nh = ipv6_hdr(skb); in parse_ipv6hdr()
270 nexthdr = nh->nexthdr; in parse_ipv6hdr()
271 payload_ofs = (u8 *)(nh + 1) - skb->data; in parse_ipv6hdr()
274 key->ip.tos = ipv6_get_dsfield(nh); in parse_ipv6hdr()
275 key->ip.ttl = nh->hop_limit; in parse_ipv6hdr()
276 key->ipv6.label = *(__be32 *)nh & htonl(IPV6_FLOWINFO_FLOWLABEL); in parse_ipv6hdr()
277 key->ipv6.addr.src = nh->saddr; in parse_ipv6hdr()
278 key->ipv6.addr.dst = nh->daddr; in parse_ipv6hdr()
[all …]
/Linux-v4.19/net/nsh/
Dnsh.c19 struct nshhdr *nh; in nsh_push() local
36 nh = (struct nshhdr *)(skb->data); in nsh_push()
37 memcpy(nh, pushed_nh, length); in nsh_push()
38 nh->np = next_proto; in nsh_push()
39 skb_postpush_rcsum(skb, nh, length); in nsh_push()
52 struct nshhdr *nh; in nsh_pop() local
58 nh = (struct nshhdr *)(skb->data); in nsh_pop()
59 length = nsh_hdr_len(nh); in nsh_pop()
62 inner_proto = tun_p_to_eth_p(nh->np); in nsh_pop()
/Linux-v4.19/net/ipv6/
Dxfrm6_policy.c129 const unsigned char *nh = skb_network_header(skb); in _decode_session6() local
137 nexthdr = nh[nhoff]; in _decode_session6()
149 while (nh + offset + sizeof(*exthdr) < skb->data || in _decode_session6()
150 pskb_may_pull(skb, nh + offset + sizeof(*exthdr) - skb->data)) { in _decode_session6()
151 nh = skb_network_header(skb); in _decode_session6()
152 exthdr = (struct ipv6_opt_hdr *)(nh + offset); in _decode_session6()
163 exthdr = (struct ipv6_opt_hdr *)(nh + offset); in _decode_session6()
171 if (!onlyproto && (nh + offset + 4 < skb->data || in _decode_session6()
172 pskb_may_pull(skb, nh + offset + 4 - skb->data))) { in _decode_session6()
175 nh = skb_network_header(skb); in _decode_session6()
[all …]
Dexthdrs.c122 const unsigned char *nh = skb_network_header(skb); in ip6_parse_tlv() local
141 int optlen = nh[off + 1] + 2; in ip6_parse_tlv()
144 switch (nh[off]) { in ip6_parse_tlv()
166 if (nh[off + i] != 0) in ip6_parse_tlv()
180 if (curr->type == nh[off]) { in ip6_parse_tlv()
730 const unsigned char *nh = skb_network_header(skb); in ipv6_hop_ra() local
732 if (nh[optoff + 1] == 2) { in ipv6_hop_ra()
734 memcpy(&IP6CB(skb)->ra, nh + optoff + 2, sizeof(IP6CB(skb)->ra)); in ipv6_hop_ra()
738 nh[optoff + 1]); in ipv6_hop_ra()
747 const unsigned char *nh = skb_network_header(skb); in ipv6_hop_jumbo() local
[all …]
Dexthdrs_core.c117 const unsigned char *nh = skb_network_header(skb); in ipv6_find_tlv() local
124 hdr = (struct ipv6_opt_hdr *)(nh + offset); in ipv6_find_tlv()
134 int opttype = nh[offset]; in ipv6_find_tlv()
145 optlen = nh[offset + 1] + 2; in ipv6_find_tlv()
/Linux-v4.19/include/trace/events/
Dfib.h16 const struct fib_nh *nh, int err),
18 TP_ARGS(tb_id, flp, nh, err),
65 if (nh) {
67 *p32 = nh->nh_saddr;
70 *p32 = nh->nh_gw;
72 __assign_str(name, nh->nh_dev ? nh->nh_dev->name : "-");
/Linux-v4.19/tools/lib/bpf/
Dbpf.c509 struct nlmsghdr nh; in bpf_set_link_xdp_fd() member
513 struct nlmsghdr *nh; in bpf_set_link_xdp_fd() local
548 req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); in bpf_set_link_xdp_fd()
549 req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; in bpf_set_link_xdp_fd()
550 req.nh.nlmsg_type = RTM_SETLINK; in bpf_set_link_xdp_fd()
551 req.nh.nlmsg_pid = 0; in bpf_set_link_xdp_fd()
552 req.nh.nlmsg_seq = ++seq; in bpf_set_link_xdp_fd()
558 + NLMSG_ALIGN(req.nh.nlmsg_len)); in bpf_set_link_xdp_fd()
578 req.nh.nlmsg_len += NLA_ALIGN(nla->nla_len); in bpf_set_link_xdp_fd()
580 if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) { in bpf_set_link_xdp_fd()
[all …]
/Linux-v4.19/net/bridge/
Dbr_netfilter_ipv6.c54 const unsigned char *nh = skb_network_header(skb); in br_nf_check_hbh_len() local
55 int off = raw - nh; in br_nf_check_hbh_len()
65 int optlen = nh[off + 1] + 2; in br_nf_check_hbh_len()
67 switch (nh[off]) { in br_nf_check_hbh_len()
76 if (nh[off + 1] != 4 || (off & 3) != 2) in br_nf_check_hbh_len()
78 pkt_len = ntohl(*(__be32 *)(nh + off + 2)); in br_nf_check_hbh_len()
87 nh = skb_network_header(skb); in br_nf_check_hbh_len()
/Linux-v4.19/scripts/dtc/libfdt/
Dfdt_sw.c172 struct fdt_node_header *nh; in fdt_begin_node() local
177 nh = fdt_grab_space_(fdt, sizeof(*nh) + FDT_TAGALIGN(namelen)); in fdt_begin_node()
178 if (! nh) in fdt_begin_node()
181 nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE); in fdt_begin_node()
182 memcpy(nh->name, name, namelen); in fdt_begin_node()
Dfdt_rw.c350 struct fdt_node_header *nh; in fdt_add_subnode_namelen() local
372 nh = fdt_offset_ptr_w_(fdt, offset); in fdt_add_subnode_namelen()
373 nodelen = sizeof(*nh) + FDT_TAGALIGN(namelen+1) + FDT_TAGSIZE; in fdt_add_subnode_namelen()
375 err = fdt_splice_struct_(fdt, nh, 0, nodelen); in fdt_add_subnode_namelen()
379 nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE); in fdt_add_subnode_namelen()
380 memset(nh->name, 0, FDT_TAGALIGN(namelen+1)); in fdt_add_subnode_namelen()
381 memcpy(nh->name, name, namelen); in fdt_add_subnode_namelen()
382 endtag = (fdt32_t *)((char *)nh + nodelen - FDT_TAGSIZE); in fdt_add_subnode_namelen()
/Linux-v4.19/net/ipv4/netfilter/
Dnf_nat_masquerade_ipv4.c34 __be32 newsrc, nh; in nf_nat_masquerade_ipv4() local
50 nh = rt_nexthop(rt, ip_hdr(skb)->daddr); in nf_nat_masquerade_ipv4()
51 newsrc = inet_select_addr(out, nh, RT_SCOPE_UNIVERSE); in nf_nat_masquerade_ipv4()

123