arch/arm/vfp/vfp.h
110
static inline u64 vfp_estimate_div128to64(u64 nh, u64 nl, u64 m)
arch/arm/vfp/vfp.h
114
if (nh >= m)
arch/arm/vfp/vfp.h
117
if (mh << 32 <= nh) {
arch/arm/vfp/vfp.h
120
z = nh;
arch/arm/vfp/vfp.h
125
sub128(&remh, &reml, nh, nl, termh, terml);
arch/arm/vfp/vfp.h
44
static inline void add128(u64 *resh, u64 *resl, u64 nh, u64 nl, u64 mh, u64 ml)
arch/arm/vfp/vfp.h
50
: "=r" (nl), "=r" (nh)
arch/arm/vfp/vfp.h
51
: "0" (nl), "1" (nh), "r" (ml), "r" (mh)
arch/arm/vfp/vfp.h
53
*resh = nh;
arch/arm/vfp/vfp.h
57
static inline void sub128(u64 *resh, u64 *resl, u64 nh, u64 nl, u64 mh, u64 ml)
arch/arm/vfp/vfp.h
63
: "=r" (nl), "=r" (nh)
arch/arm/vfp/vfp.h
64
: "0" (nl), "1" (nh), "r" (ml), "r" (mh)
arch/arm/vfp/vfp.h
66
*resh = nh;
arch/arm/vfp/vfp.h
72
u32 nh, nl, mh, ml;
arch/arm/vfp/vfp.h
79
nh = n >> 32;
arch/arm/vfp/vfp.h
80
rma = (u64)nh * ml;
arch/arm/vfp/vfp.h
86
rh = (u64)nh * mh;
arch/arm64/include/asm/atomic_ll_sc.h
326
[nl] "r" (n.low), [nh] "r" (n.high) \
arch/sh/kernel/cpu/sh2a/fpu.c
164
unsigned long long mh, ml, nh, nl;
arch/sh/kernel/cpu/sh2a/fpu.c
176
nh = mh;
arch/sh/kernel/cpu/sh2a/fpu.c
179
if (nh) {
arch/sh/kernel/cpu/sh2a/fpu.c
180
while (nh) { nh >>= 1; w++;}
crypto/adiantum.c
259
nh(key->nh_key, data, bytes, ctx->nh_hash);
crypto/adiantum.c
268
nh(&key->nh_key[pos / 4], data, bytes, tmp_hash);
drivers/block/drbd/drbd_nl.c
4567
struct drbd_notification_header nh = {
drivers/block/drbd/drbd_nl.c
4571
return drbd_notification_header_to_skb(msg, &nh, true);
drivers/extcon/extcon.c
1293
edev->nh = kzalloc_objs(*edev->nh, edev->max_supported);
drivers/extcon/extcon.c
1294
if (!edev->nh) {
drivers/extcon/extcon.c
1301
RAW_INIT_NOTIFIER_HEAD(&edev->nh[index]);
drivers/extcon/extcon.c
1323
kfree(edev->nh);
drivers/extcon/extcon.c
1387
kfree(edev->nh);
drivers/extcon/extcon.c
456
raw_notifier_call_chain(&edev->nh[index], state, edev);
drivers/extcon/extcon.c
927
ret = raw_notifier_chain_register(&edev->nh[idx], nb);
drivers/extcon/extcon.c
956
ret = raw_notifier_chain_unregister(&edev->nh[idx], nb);
drivers/extcon/extcon.h
52
struct raw_notifier_head *nh;
drivers/iio/light/iqs621-als.c
198
ret = blocking_notifier_chain_unregister(&iqs621_als->iqs62x->nh,
drivers/iio/light/iqs621-als.c
591
ret = blocking_notifier_chain_register(&iqs621_als->iqs62x->nh,
drivers/iio/position/iqs624-pos.c
105
ret = blocking_notifier_chain_unregister(&iqs624_pos->iqs62x->nh,
drivers/iio/position/iqs624-pos.c
258
ret = blocking_notifier_chain_register(&iqs624_pos->iqs62x->nh,
drivers/input/keyboard/iqs62x-keys.c
302
ret = blocking_notifier_chain_register(&iqs62x_keys->iqs62x->nh,
drivers/input/keyboard/iqs62x-keys.c
315
ret = blocking_notifier_chain_unregister(&iqs62x_keys->iqs62x->nh,
drivers/mfd/iqs62x.c
565
ret = blocking_notifier_call_chain(&iqs62x->nh, event_flags,
drivers/mfd/iqs62x.c
910
BLOCKING_INIT_NOTIFIER_HEAD(&iqs62x->nh);
drivers/net/bareudp.c
158
nh = skb_network_header(skb) - skb->head;
drivers/net/bareudp.c
169
oiph = skb->head + nh;
drivers/net/bareudp.c
71
int nh;
drivers/net/ethernet/marvell/prestera/prestera_hw.c
2096
req.nh[i].is_active = nhs[i].connected;
drivers/net/ethernet/marvell/prestera/prestera_hw.c
2097
memcpy(&req.nh[i].mac, nhs[i].ha, ETH_ALEN);
drivers/net/ethernet/marvell/prestera/prestera_hw.c
2098
err = prestera_iface_to_msg(&nhs[i].iface, &req.nh[i].oif);
drivers/net/ethernet/marvell/prestera/prestera_hw.c
588
struct prestera_msg_nh nh[PRESTERA_NHGR_SIZE_MAX];
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c
1746
if (fen_info->fi->nh)
drivers/net/ethernet/mellanox/mlx5/core/eq.c
1239
return atomic_notifier_chain_register(&eqt->nh[nb->event_type], &nb->nb);
drivers/net/ethernet/mellanox/mlx5/core/eq.c
1247
return atomic_notifier_chain_unregister(&eqt->nh[nb->event_type], &nb->nb);
drivers/net/ethernet/mellanox/mlx5/core/eq.c
217
atomic_notifier_call_chain(&eqt->nh[eqe->type], eqe->type, eqe);
drivers/net/ethernet/mellanox/mlx5/core/eq.c
218
atomic_notifier_call_chain(&eqt->nh[MLX5_EVENT_TYPE_NOTIFY_ANY], eqe->type, eqe);
drivers/net/ethernet/mellanox/mlx5/core/eq.c
444
ATOMIC_INIT_NOTIFIER_HEAD(&eq_table->nh[i]);
drivers/net/ethernet/mellanox/mlx5/core/eq.c
53
struct atomic_notifier_head nh[MLX5_EVENT_TYPE_MAX];
drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c
329
if (fi->nh)
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
172
free_irq(irq->map.virq, &irq->nh);
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
227
static irqreturn_t irq_int_handler(int irq, void *nh)
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
229
atomic_notifier_call_chain(nh, 0, NULL);
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
297
ATOMIC_INIT_NOTIFIER_HEAD(&irq->nh);
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
301
&irq->nh);
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
31
struct atomic_notifier_head nh;
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
324
free_irq(irq->map.virq, &irq->nh);
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
349
ret = atomic_notifier_chain_register(&irq->nh, nb);
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
359
err = atomic_notifier_chain_unregister(&irq->nh, nb);
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1065
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1068
struct mlxsw_sp_rif *rif = mlxsw_sp_nexthop_rif(nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1069
unsigned char *ha = mlxsw_sp_nexthop_ha(nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1075
mlxsw_sp_nexthop_indexes(nh, &adj_index, &adj_size, &adj_hash_index);
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1078
err = mlxsw_sp_nexthop_counter_get(mlxsw_sp, nh, &entry->counter);
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1089
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1106
mlxsw_sp_nexthop_for_each(nh, mlxsw_sp->router) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1107
if (!mlxsw_sp_nexthop_is_forward(nh) ||
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1108
mlxsw_sp_nexthop_group_has_ipip(nh))
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1114
mlxsw_sp_dpipe_table_adj_entry_fill(mlxsw_sp, nh, entry);
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1183
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1190
mlxsw_sp_nexthop_for_each(nh, mlxsw_sp->router) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1191
if (!mlxsw_sp_nexthop_is_forward(nh) ||
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1192
mlxsw_sp_nexthop_group_has_ipip(nh))
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1195
mlxsw_sp_nexthop_indexes(nh, &adj_index, &adj_size,
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1198
err = mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1202
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1205
adj_index + adj_hash_index, nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1212
mlxsw_sp_nexthop_for_each(nh, mlxsw_sp->router) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
1215
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
911
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
914
mlxsw_sp_nexthop_for_each(nh, mlxsw_sp->router)
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
915
if (mlxsw_sp_nexthop_is_forward(nh) &&
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
916
!mlxsw_sp_nexthop_group_has_ipip(nh))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3094
mlxsw_sp_nexthop_dev(const struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3096
if (!nh->crif)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3098
return nh->crif->key.dev;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3199
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3201
struct mlxsw_sp_nexthop_group *nh_grp = nh->nhgi->nh_grp;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3205
nhct = xa_load(&nh_grp->nhgi->nexthop_counters, nh->id);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3215
err = xa_err(xa_store(&nh_grp->nhgi->nexthop_counters, nh->id, nhct,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3228
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3230
struct mlxsw_sp_nexthop_group *nh_grp = nh->nhgi->nh_grp;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3233
nhct = xa_load(&nh_grp->nhgi->nexthop_counters, nh->id);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3240
xa_erase(&nh_grp->nhgi->nexthop_counters, nh->id);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3245
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3252
if (nh->counter)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3257
if (!(nh->nhgi->hw_stats || dpipe_stats))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3260
if (nh->id)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3261
nhct = mlxsw_sp_nexthop_sh_counter_get(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3267
nh->counter = nhct;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3272
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3274
if (!nh->counter)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3277
if (nh->id)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3278
mlxsw_sp_nexthop_sh_counter_put(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3280
mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh->counter);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3281
nh->counter = NULL;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3285
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3287
if (nh->nhgi->hw_stats)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3288
return mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3289
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3294
struct mlxsw_sp_nexthop *nh, u64 *p_counter)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3296
if (!nh->counter)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3299
return mlxsw_sp_flow_counter_get(mlxsw_sp, nh->counter->counter_index,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3304
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3306
if (!nh) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3311
typeof(*nh), router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3313
if (list_is_last(&nh->router_list_node, &router->nexthop_list))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3315
return list_next_entry(nh, router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3318
bool mlxsw_sp_nexthop_is_forward(const struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3320
return nh->offloaded && nh->action == MLXSW_SP_NEXTHOP_ACTION_FORWARD;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3323
unsigned char *mlxsw_sp_nexthop_ha(struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3325
if (nh->type != MLXSW_SP_NEXTHOP_TYPE_ETH ||
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3326
!mlxsw_sp_nexthop_is_forward(nh))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3328
return nh->neigh_entry->ha;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3331
int mlxsw_sp_nexthop_indexes(struct mlxsw_sp_nexthop *nh, u32 *p_adj_index,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3334
struct mlxsw_sp_nexthop_group_info *nhgi = nh->nhgi;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3338
if (!nh->offloaded || !nhgi->adj_index_valid)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3347
if (nh_iter == nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3357
struct mlxsw_sp_rif *mlxsw_sp_nexthop_rif(struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3359
if (WARN_ON(!nh->crif))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3361
return nh->crif->rif;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3364
bool mlxsw_sp_nexthop_group_has_ipip(struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3366
struct mlxsw_sp_nexthop_group_info *nhgi = nh->nhgi;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3485
const struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3487
nh = &nh_grp->nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3488
if (nh->ifindex == ifindex && nh->nh_weight == weight &&
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3489
ipv6_addr_equal(gw, (struct in6_addr *) nh->gw_addr))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3547
const struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3559
nh = &nh_grp->nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3560
val ^= jhash(&nh->ifindex, sizeof(nh->ifindex), seed);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3561
val ^= jhash(&nh->gw_addr, sizeof(nh->gw_addr), seed);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3672
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3675
&nh->ht_node, mlxsw_sp_nexthop_ht_params);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3679
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3681
rhashtable_remove_fast(&mlxsw_sp->router->nexthop_ht, &nh->ht_node,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3742
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3745
struct mlxsw_sp_neigh_entry *neigh_entry = nh->neigh_entry;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3746
struct mlxsw_sp_rif *rif = mlxsw_sp_nexthop_rif(nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3756
switch (nh->action) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3773
if (nh->counter)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3774
mlxsw_reg_ratr_counter_pack(ratr_pl, nh->counter->counter_index,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3783
struct mlxsw_sp_nexthop *nh, bool force,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3788
for (i = 0; i < nh->num_adj_entries; i++) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3792
nh, force, ratr_pl);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3802
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3807
ipip_ops = mlxsw_sp->router->ipip_ops_arr[nh->ipip_entry->ipipt];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3808
return ipip_ops->nexthop_update(mlxsw_sp, adj_index, nh->ipip_entry,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3814
struct mlxsw_sp_nexthop *nh, bool force,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3819
for (i = 0; i < nh->num_adj_entries; i++) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3823
nh, force, ratr_pl);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3832
struct mlxsw_sp_nexthop *nh, bool force,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3838
if (nh->type == MLXSW_SP_NEXTHOP_TYPE_ETH ||
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3839
nh->action == MLXSW_SP_NEXTHOP_ACTION_DISCARD ||
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3840
nh->action == MLXSW_SP_NEXTHOP_ACTION_TRAP)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3841
return mlxsw_sp_nexthop_eth_update(mlxsw_sp, adj_index, nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3844
return mlxsw_sp_nexthop_ipip_update(mlxsw_sp, adj_index, nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3855
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3859
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3861
if (!nh->should_offload) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3862
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3863
nh->offloaded = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3867
if (nh->update || reallocate) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3870
err = mlxsw_sp_nexthop_counter_update(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3874
err = mlxsw_sp_nexthop_update(mlxsw_sp, adj_index, nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3878
nh->update = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3879
nh->offloaded = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3881
adj_index += nh->num_adj_entries;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3994
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3997
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3999
if (!nh->should_offload)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4002
g = gcd(nh->nh_weight, g);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4004
g = nh->nh_weight;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4008
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4010
if (!nh->should_offload)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4012
nh->norm_nh_weight = nh->nh_weight / g;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4013
sum_norm_weight += nh->norm_nh_weight;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4027
struct mlxsw_sp_nexthop *nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4030
if (!nh->should_offload)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4032
weight += nh->norm_nh_weight;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4034
nh->num_adj_entries = upper_bound - lower_bound;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4050
struct mlxsw_sp_nexthop *nh = &nh_grp->nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4052
if (nh->offloaded)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4053
nh->key.fib_nh->fib_nh_flags |= RTNH_F_OFFLOAD;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4055
nh->key.fib_nh->fib_nh_flags &= ~RTNH_F_OFFLOAD;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4067
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4069
nh = mlxsw_sp_rt6_nexthop(nh_grp, mlxsw_sp_rt6);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4070
if (nh && nh->offloaded)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4094
const struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4097
struct mlxsw_sp_nexthop_group *nh_grp = nh->nhgi->nh_grp;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4100
if (nh->offloaded) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4101
if (nh->action == MLXSW_SP_NEXTHOP_ACTION_TRAP)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4137
struct mlxsw_sp_nexthop *nh = &nh_grp->nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4139
mlxsw_sp_nexthop_bucket_offload_refresh(mlxsw_sp, nh, i);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4166
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4177
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4179
if (nh->should_offload != nh->offloaded) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4181
if (nh->should_offload)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4182
nh->update = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4266
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4267
nh->offloaded = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4279
static void __mlxsw_sp_nexthop_neigh_update(struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4283
nh->action = MLXSW_SP_NEXTHOP_ACTION_FORWARD;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4284
nh->should_offload = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4285
} else if (nh->nhgi->is_resilient) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4286
nh->action = MLXSW_SP_NEXTHOP_ACTION_TRAP;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4287
nh->should_offload = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4289
nh->should_offload = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4291
nh->update = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4299
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4305
nh = list_first_entry(&neigh_entry->nexthop_list,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4307
dev = mlxsw_sp_nexthop_dev(nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4309
n = neigh_lookup(nh->neigh_tbl, &nh->gw_addr, dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4311
n = neigh_create(nh->neigh_tbl, &nh->gw_addr, dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4331
list_for_each_entry(nh, &neigh_entry->nexthop_list,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4333
__mlxsw_sp_nexthop_neigh_update(nh, !entry_connected);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4334
mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nhgi->nh_grp);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4351
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4366
list_for_each_entry(nh, &neigh_entry->nexthop_list,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4368
__mlxsw_sp_nexthop_neigh_update(nh, removing);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4369
mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nhgi->nh_grp);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4373
static void mlxsw_sp_nexthop_crif_init(struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4376
if (nh->crif)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4379
nh->crif = crif;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4380
list_add(&nh->crif_list_node, &crif->nexthop_list);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4383
static void mlxsw_sp_nexthop_crif_fini(struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4385
if (!nh->crif)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4388
list_del(&nh->crif_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4389
nh->crif = NULL;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4393
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4401
if (WARN_ON(!nh->crif->rif))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4404
if (!nh->nhgi->gateway || nh->neigh_entry)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4406
dev = mlxsw_sp_nexthop_dev(nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4413
n = neigh_lookup(nh->neigh_tbl, &nh->gw_addr, dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4415
n = neigh_create(nh->neigh_tbl, &nh->gw_addr, dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4441
nh->neigh_entry = neigh_entry;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4442
list_add_tail(&nh->neigh_list_node, &neigh_entry->nexthop_list);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4447
__mlxsw_sp_nexthop_neigh_update(nh, !(nud_state & NUD_VALID && !dead));
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4457
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4459
struct mlxsw_sp_neigh_entry *neigh_entry = nh->neigh_entry;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4464
__mlxsw_sp_nexthop_neigh_update(nh, true);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4465
list_del(&nh->neigh_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4466
nh->neigh_entry = NULL;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4492
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4498
if (!nh->nhgi->gateway || nh->ipip_entry)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4505
nh->ipip_entry = ipip_entry;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4507
__mlxsw_sp_nexthop_neigh_update(nh, removing);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4508
mlxsw_sp_nexthop_crif_init(nh, crif);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4512
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4514
struct mlxsw_sp_ipip_entry *ipip_entry = nh->ipip_entry;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4519
__mlxsw_sp_nexthop_neigh_update(nh, true);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4520
nh->ipip_entry = NULL;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4535
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4547
nh->type = MLXSW_SP_NEXTHOP_TYPE_IPIP;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4548
mlxsw_sp_nexthop_ipip_init(mlxsw_sp, nh, ipip_entry);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4553
nh->type = MLXSW_SP_NEXTHOP_TYPE_ETH;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4558
mlxsw_sp_nexthop_crif_init(nh, crif);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4563
err = mlxsw_sp_nexthop_neigh_init(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4570
mlxsw_sp_nexthop_crif_fini(nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4575
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4577
switch (nh->type) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4579
return mlxsw_sp_nexthop_neigh_init(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4588
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4590
switch (nh->type) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4592
mlxsw_sp_nexthop_neigh_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4595
mlxsw_sp_nexthop_ipip_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4601
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4603
mlxsw_sp_nexthop_type_rif_gone(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4604
mlxsw_sp_nexthop_crif_fini(nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4609
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4616
nh->nhgi = nh_grp->nhgi;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4617
nh->key.fib_nh = fib_nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4619
nh->nh_weight = fib_nh->fib_nh_weight;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4621
nh->nh_weight = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4623
memcpy(&nh->gw_addr, &fib_nh->fib_nh_gw4, sizeof(fib_nh->fib_nh_gw4));
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4624
nh->neigh_tbl = &arp_tbl;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4625
err = mlxsw_sp_nexthop_insert(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4629
err = mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4633
list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4637
nh->ifindex = dev->ifindex;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4648
err = mlxsw_sp_nexthop_type_init(mlxsw_sp, nh, dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4655
list_del(&nh->router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4656
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4658
mlxsw_sp_nexthop_remove(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4663
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4665
mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4666
list_del(&nh->router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4667
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4668
mlxsw_sp_nexthop_remove(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4675
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4678
nh = mlxsw_sp_nexthop_lookup(mlxsw_sp, key);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4679
if (!nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4684
mlxsw_sp_nexthop_type_init(mlxsw_sp, nh, fib_nh->fib_nh_dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4687
mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4691
mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nhgi->nh_grp);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4698
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4701
list_for_each_entry(nh, &rif->crif->nexthop_list, crif_list_node) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4702
switch (nh->type) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4714
__mlxsw_sp_nexthop_neigh_update(nh, removing);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4715
mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nhgi->nh_grp);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4722
struct mlxsw_sp_nexthop *nh, *tmp;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4726
list_for_each_entry_safe(nh, tmp, &rif->crif->nexthop_list,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4728
err = mlxsw_sp_nexthop_type_rif_made(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4731
mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nhgi->nh_grp);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4738
list_for_each_entry_safe(nh, tmp, &rif->crif->nexthop_list,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4742
mlxsw_sp_nexthop_type_rif_gone(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4743
mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nhgi->nh_grp);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4751
struct mlxsw_sp_nexthop *nh, *tmp;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4753
list_for_each_entry_safe(nh, tmp, &rif->crif->nexthop_list,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4755
mlxsw_sp_nexthop_type_rif_gone(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4756
mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nhgi->nh_grp);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4901
const struct nh_notifier_single_info *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4906
if (nh->is_fdb)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4908
else if (nh->has_encap)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4918
const struct nh_notifier_single_info *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4923
err = mlxsw_sp_nexthop_obj_single_validate(mlxsw_sp, nh, extack);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4930
if (!nh->gw_family && !nh->is_reject &&
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4931
!mlxsw_sp_netdev_ipip_type(mlxsw_sp, nh->dev, NULL)) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4952
const struct nh_notifier_single_info *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4955
nh = &nh_grp->nh_entries[i].nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4956
err = mlxsw_sp_nexthop_obj_group_entry_validate(mlxsw_sp, nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5023
const struct nh_notifier_single_info *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5026
nh = &nh_res_table->nhs[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5027
err = mlxsw_sp_nexthop_obj_group_entry_validate(mlxsw_sp, nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5040
struct nh_notifier_single_info *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5049
return mlxsw_sp_nexthop_obj_single_validate(mlxsw_sp, info->nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5060
nh = &info->nh_res_bucket->new_nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5061
return mlxsw_sp_nexthop_obj_group_entry_validate(mlxsw_sp, nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5076
dev = info->nh->dev;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5077
return info->nh->gw_family || info->nh->is_reject ||
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5089
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5091
nh->action = MLXSW_SP_NEXTHOP_ACTION_DISCARD;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5092
nh->should_offload = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5097
nh->crif = mlxsw_sp->router->lb_crif;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5101
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5103
nh->crif = NULL;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5104
nh->should_offload = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5110
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5116
nh->nhgi = nh_grp->nhgi;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5117
nh->nh_weight = weight;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5121
memcpy(&nh->gw_addr, &nh_obj->ipv4, sizeof(nh_obj->ipv4));
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5122
nh->neigh_tbl = &arp_tbl;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5125
memcpy(&nh->gw_addr, &nh_obj->ipv6, sizeof(nh_obj->ipv6));
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5127
nh->neigh_tbl = &nd_tbl;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5132
list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5133
nh->ifindex = dev->ifindex;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5134
nh->id = nh_obj->id;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5136
err = mlxsw_sp_nexthop_type_init(mlxsw_sp, nh, dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5141
mlxsw_sp_nexthop_obj_blackhole_init(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5147
if (nh_grp->nhgi->is_resilient && !nh->should_offload) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5148
nh->action = MLXSW_SP_NEXTHOP_ACTION_TRAP;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5149
nh->should_offload = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5155
list_del(&nh->router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5160
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5162
if (nh->action == MLXSW_SP_NEXTHOP_ACTION_DISCARD)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5163
mlxsw_sp_nexthop_obj_blackhole_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5164
mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5165
list_del(&nh->router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5166
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5167
nh->should_offload = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5176
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5215
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5218
nh_obj = info->nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5222
nh_obj = &info->nh_grp->nh_entries[i].nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5233
err = mlxsw_sp_nexthop_obj_init(mlxsw_sp, nh_grp, nh, nh_obj,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5264
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5265
mlxsw_sp_nexthop_obj_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5287
struct mlxsw_sp_nexthop *nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5289
mlxsw_sp_nexthop_obj_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5454
struct mlxsw_sp_nexthop *nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5456
if (nh->offloaded)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5457
nh->update = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5549
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5567
adj_index = nh->nhgi->adj_index + bucket_index;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5568
err = mlxsw_sp_nexthop_update(mlxsw_sp, adj_index, nh, force, ratr_pl);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5589
nh->update = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5590
nh->offloaded = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5591
mlxsw_sp_nexthop_bucket_offload_refresh(mlxsw_sp, nh, bucket_index);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5604
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5620
nh = &nhgi->nexthops[bucket_index];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5621
mlxsw_sp_nexthop_obj_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5624
err = mlxsw_sp_nexthop_obj_init(mlxsw_sp, nh_grp, nh, nh_obj, 1);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5630
err = mlxsw_sp_nexthop_obj_bucket_adj_update(mlxsw_sp, nh, info);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5637
mlxsw_sp_nexthop_obj_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5640
mlxsw_sp_nexthop_obj_init(mlxsw_sp, nh_grp, nh, nh_obj, 1);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5642
nh->update = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5643
nh->offloaded = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5655
struct mlxsw_sp_nexthop *nh = &nhgi->nexthops[nhi];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5659
err = mlxsw_sp_nexthop_counter_get(mlxsw_sp, nh, &packets);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5676
struct mlxsw_sp_nexthop *nh = &nhgi->nexthops[bucket];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5680
if (nhi == -1 || info->stats[nhi].id != nh->id) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5682
if (info->stats[nhi].id == nh->id)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5690
err = mlxsw_sp_nexthop_counter_get(mlxsw_sp, nh, &packets);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5765
const struct fib_nh *nh = fib_info_nh(fi, 0);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5767
return nh->fib_nh_gw_family ||
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5768
mlxsw_sp_nexthop4_ipip_type(mlxsw_sp, nh, NULL);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5777
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5790
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5792
err = mlxsw_sp_nexthop4_init(mlxsw_sp, nh_grp, nh, fib_nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5811
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5812
mlxsw_sp_nexthop4_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5827
struct mlxsw_sp_nexthop *nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5829
mlxsw_sp_nexthop4_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5897
if (fi->nh) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5899
fi->nh->id);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5979
struct mlxsw_sp_nexthop *nh = &nh_grp->nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5980
struct net_device *dev = mlxsw_sp_nexthop_dev(nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5984
ipv6_addr_equal((const struct in6_addr *) &nh->gw_addr,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5986
return nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6820
if (fen_info->fi->nh &&
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6821
!mlxsw_sp_nexthop_obj_group_lookup(mlxsw_sp, fen_info->fi->nh->id))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6936
if (!mlxsw_sp_rt6->rt->nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6973
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6979
nh->nhgi = nh_grp->nhgi;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6980
nh->nh_weight = rt->fib6_nh->fib_nh_weight;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6981
memcpy(&nh->gw_addr, &rt->fib6_nh->fib_nh_gw6, sizeof(nh->gw_addr));
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6983
nh->neigh_tbl = &nd_tbl;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6986
err = mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6990
list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6994
nh->ifindex = dev->ifindex;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6996
err = mlxsw_sp_nexthop_type_init(mlxsw_sp, nh, dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7003
list_del(&nh->router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7004
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7009
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7011
mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7012
list_del(&nh->router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7013
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7030
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7045
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7046
err = mlxsw_sp_nexthop6_init(mlxsw_sp, nh_grp, nh, rt);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7067
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7068
mlxsw_sp_nexthop6_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7083
struct mlxsw_sp_nexthop *nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7085
mlxsw_sp_nexthop6_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7150
if (rt->nh) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7152
rt->nh->id);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7518
if (rt->nh && !mlxsw_sp_nexthop_obj_group_lookup(mlxsw_sp, rt->nh->id))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
9789
struct mlxsw_sp_nexthop *nh, *tmp;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
9793
list_for_each_entry_safe(nh, tmp, &crif->nexthop_list, crif_list_node)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
9794
mlxsw_sp_nexthop_type_fini(router->mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h
143
struct mlxsw_sp_nexthop *nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h
144
bool mlxsw_sp_nexthop_is_forward(const struct mlxsw_sp_nexthop *nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h
145
unsigned char *mlxsw_sp_nexthop_ha(struct mlxsw_sp_nexthop *nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h
146
int mlxsw_sp_nexthop_indexes(struct mlxsw_sp_nexthop *nh, u32 *p_adj_index,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h
148
struct mlxsw_sp_rif *mlxsw_sp_nexthop_rif(struct mlxsw_sp_nexthop *nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h
149
bool mlxsw_sp_nexthop_group_has_ipip(struct mlxsw_sp_nexthop *nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h
150
#define mlxsw_sp_nexthop_for_each(nh, router) \
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h
151
for (nh = mlxsw_sp_nexthop_next(router, NULL); nh; \
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h
152
nh = mlxsw_sp_nexthop_next(router, nh))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h
154
struct mlxsw_sp_nexthop *nh, u64 *p_counter);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h
156
struct mlxsw_sp_nexthop *nh, bool force,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h
159
struct mlxsw_sp_nexthop *nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h
161
struct mlxsw_sp_nexthop *nh);
drivers/net/ethernet/rocker/rocker_main.c
2176
if (fen_info->fi->nh) {
drivers/net/ethernet/rocker/rocker_ofdpa.c
2272
const struct fib_nh *nh;
drivers/net/ethernet/rocker/rocker_ofdpa.c
2287
nh = fib_info_nh(fi, 0);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2288
nh_on_port = (nh->fib_nh_dev == ofdpa_port->dev);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2289
has_gw = !!nh->fib_nh_gw4;
drivers/net/ethernet/rocker/rocker_ofdpa.c
2293
nh->fib_nh_gw4, &index);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2726
struct fib_nh *nh;
drivers/net/ethernet/rocker/rocker_ofdpa.c
2731
nh = fib_info_nh(fen_info->fi, 0);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2732
ofdpa_port = ofdpa_port_dev_lower_find(nh->fib_nh_dev, rocker);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2740
nh->fib_nh_flags |= RTNH_F_OFFLOAD;
drivers/net/ethernet/rocker/rocker_ofdpa.c
2749
struct fib_nh *nh;
drivers/net/ethernet/rocker/rocker_ofdpa.c
2753
nh = fib_info_nh(fen_info->fi, 0);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2754
ofdpa_port = ofdpa_port_dev_lower_find(nh->fib_nh_dev, rocker);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2757
nh->fib_nh_flags &= ~RTNH_F_OFFLOAD;
drivers/net/ethernet/rocker/rocker_ofdpa.c
2777
struct fib_nh *nh;
drivers/net/ethernet/rocker/rocker_ofdpa.c
2782
nh = fib_info_nh(flow_entry->fi, 0);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2783
ofdpa_port = ofdpa_port_dev_lower_find(nh->fib_nh_dev, rocker);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2786
nh->fib_nh_flags &= ~RTNH_F_OFFLOAD;
drivers/net/geneve.c
266
int nh, err = 0;
drivers/net/geneve.c
324
nh = skb_network_header(skb) - skb->head;
drivers/net/geneve.c
335
oiph = skb->head + nh;
drivers/net/geneve.c
799
void *nested, *nested2, *nh, *nh2;
drivers/net/geneve.c
829
nh = nested + gro_hint->nested_nh_offset;
drivers/net/geneve.c
832
struct ipv6hdr *iph = nh, *iph2 = nh2;
drivers/net/geneve.c
850
struct iphdr *iph = nh, *iph2 = nh2;
drivers/net/vxlan/vxlan_core.c
1349
if (rcu_access_pointer(f->nh)) {
drivers/net/vxlan/vxlan_core.c
1450
if (rcu_access_pointer(f->nh))
drivers/net/vxlan/vxlan_core.c
165
struct nexthop *nh;
drivers/net/vxlan/vxlan_core.c
1657
int nh;
drivers/net/vxlan/vxlan_core.c
1762
nh = skb_network_header(skb) - skb->head;
drivers/net/vxlan/vxlan_core.c
1776
oiph = skb->head + nh;
drivers/net/vxlan/vxlan_core.c
180
nh = rcu_dereference(fdb->nh);
drivers/net/vxlan/vxlan_core.c
181
if (nh) {
drivers/net/vxlan/vxlan_core.c
182
nh_family = nexthop_get_family(nh);
drivers/net/vxlan/vxlan_core.c
183
nh_id = nh->id;
drivers/net/vxlan/vxlan_core.c
191
} else if (nh) {
drivers/net/vxlan/vxlan_core.c
211
if (nh) {
drivers/net/vxlan/vxlan_core.c
2654
struct nexthop *nh;
drivers/net/vxlan/vxlan_core.c
2661
nh = rcu_dereference(f->nh);
drivers/net/vxlan/vxlan_core.c
2662
if (!nh)
drivers/net/vxlan/vxlan_core.c
2664
do_xmit = vxlan_fdb_nh_path_select(nh, hash, &nh_rdst);
drivers/net/vxlan/vxlan_core.c
2685
struct nexthop *nh;
drivers/net/vxlan/vxlan_core.c
2693
nh = nexthop_find_by_id(dev_net(dev), nhid);
drivers/net/vxlan/vxlan_core.c
2694
if (unlikely(!nh || !nexthop_is_fdb(nh) || !nexthop_is_multipath(nh))) {
drivers/net/vxlan/vxlan_core.c
2698
do_xmit = vxlan_fdb_nh_path_select(nh, hash, &nh_rdst);
drivers/net/vxlan/vxlan_core.c
2818
if (rcu_access_pointer(f->nh)) {
drivers/net/vxlan/vxlan_core.c
2999
struct nexthop *nh = rtnl_dereference(f->nh);
drivers/net/vxlan/vxlan_core.c
3001
return nh && nh->id == nhid;
drivers/net/vxlan/vxlan_core.c
4886
static void vxlan_fdb_nh_flush(struct nexthop *nh)
drivers/net/vxlan/vxlan_core.c
4892
list_for_each_entry_rcu(fdb, &nh->fdb_list, nh_list) {
drivers/net/vxlan/vxlan_core.c
4907
struct nexthop *nh;
drivers/net/vxlan/vxlan_core.c
4912
nh = nexthop_find_by_id(info->net, info->id);
drivers/net/vxlan/vxlan_core.c
4913
if (!nh)
drivers/net/vxlan/vxlan_core.c
4916
vxlan_fdb_nh_flush(nh);
drivers/net/vxlan/vxlan_core.c
785
f->nh = NULL;
drivers/net/vxlan/vxlan_core.c
797
struct nexthop *old_nh = rtnl_dereference(fdb->nh);
drivers/net/vxlan/vxlan_core.c
798
struct nexthop *nh;
drivers/net/vxlan/vxlan_core.c
804
nh = nexthop_find_by_id(vxlan->net, nhid);
drivers/net/vxlan/vxlan_core.c
805
if (!nh) {
drivers/net/vxlan/vxlan_core.c
810
if (!nexthop_get(nh)) {
drivers/net/vxlan/vxlan_core.c
812
nh = NULL;
drivers/net/vxlan/vxlan_core.c
815
if (!nexthop_is_fdb(nh)) {
drivers/net/vxlan/vxlan_core.c
820
if (!nexthop_is_multipath(nh)) {
drivers/net/vxlan/vxlan_core.c
828
if (!nexthop_has_v4(nh)) {
drivers/net/vxlan/vxlan_core.c
835
if (nexthop_has_v4(nh)) {
drivers/net/vxlan/vxlan_core.c
846
rcu_assign_pointer(fdb->nh, nh);
drivers/net/vxlan/vxlan_core.c
847
list_add_tail_rcu(&fdb->nh_list, &nh->fdb_list);
drivers/net/vxlan/vxlan_core.c
851
if (nh)
drivers/net/vxlan/vxlan_core.c
852
nexthop_put(nh);
drivers/net/vxlan/vxlan_core.c
896
if (rcu_access_pointer(f->nh)) {
drivers/net/vxlan/vxlan_core.c
898
nexthop_put(rtnl_dereference(f->nh));
drivers/net/vxlan/vxlan_core.c
912
struct nexthop *nh;
drivers/net/vxlan/vxlan_core.c
914
nh = rcu_dereference_raw(f->nh);
drivers/net/vxlan/vxlan_core.c
915
if (nh) {
drivers/net/vxlan/vxlan_core.c
916
rcu_assign_pointer(f->nh, NULL);
drivers/net/vxlan/vxlan_core.c
918
nexthop_put(nh);
drivers/net/vxlan/vxlan_core.c
944
if (rcu_access_pointer(f->nh))
drivers/net/vxlan/vxlan_core.c
984
if (nhid && !rcu_access_pointer(f->nh)) {
drivers/net/vxlan/vxlan_private.h
44
struct nexthop __rcu *nh;
drivers/net/vxlan/vxlan_private.h
67
if (rcu_access_pointer(fdb->nh))
drivers/net/vxlan/vxlan_private.h
74
if (rcu_access_pointer(fdb->nh))
drivers/of/unittest.c
365
struct node_hash *nh;
drivers/of/unittest.c
373
hash_for_each_possible(phandle_ht, nh, node, np->phandle) {
drivers/of/unittest.c
374
if (nh->np->phandle == np->phandle) {
drivers/of/unittest.c
376
np->phandle, nh->np, np);
drivers/of/unittest.c
382
nh = kzalloc_obj(*nh);
drivers/of/unittest.c
383
if (!nh)
drivers/of/unittest.c
386
nh->np = np;
drivers/of/unittest.c
387
hash_add(phandle_ht, &nh->node, np->phandle);
drivers/of/unittest.c
394
hash_for_each_safe(phandle_ht, i, tmp, nh, node) {
drivers/of/unittest.c
395
hash_del(&nh->node);
drivers/of/unittest.c
396
kfree(nh);
drivers/platform/surface/aggregator/controller.c
148
static int ssam_nfblk_call_chain(struct ssam_nf_head *nh, struct ssam_event *event)
drivers/platform/surface/aggregator/controller.c
153
idx = srcu_read_lock(&nh->srcu);
drivers/platform/surface/aggregator/controller.c
155
list_for_each_entry_rcu(nf, &nh->head, base.node,
drivers/platform/surface/aggregator/controller.c
156
srcu_read_lock_held(&nh->srcu)) {
drivers/platform/surface/aggregator/controller.c
164
srcu_read_unlock(&nh->srcu, idx);
drivers/platform/surface/aggregator/controller.c
180
static int ssam_nfblk_insert(struct ssam_nf_head *nh, struct ssam_notifier_block *nb)
drivers/platform/surface/aggregator/controller.c
186
list_for_each(h, &nh->head) {
drivers/platform/surface/aggregator/controller.c
215
static bool ssam_nfblk_find(struct ssam_nf_head *nh, struct ssam_notifier_block *nb)
drivers/platform/surface/aggregator/controller.c
220
list_for_each_entry(p, &nh->head, node) {
drivers/platform/surface/aggregator/controller.c
247
static int ssam_nf_head_init(struct ssam_nf_head *nh)
drivers/platform/surface/aggregator/controller.c
251
status = init_srcu_struct(&nh->srcu);
drivers/platform/surface/aggregator/controller.c
255
INIT_LIST_HEAD(&nh->head);
drivers/platform/surface/aggregator/controller.c
263
static void ssam_nf_head_destroy(struct ssam_nf_head *nh)
drivers/platform/surface/aggregator/controller.c
265
cleanup_srcu_struct(&nh->srcu);
drivers/platform/surface/surface_acpi_notify.c
124
return blocking_notifier_chain_register(&san_rqsg_if.nh, nb);
drivers/platform/surface/surface_acpi_notify.c
134
return blocking_notifier_chain_unregister(&san_rqsg_if.nh, nb);
drivers/platform/surface/surface_acpi_notify.c
142
ret = blocking_notifier_call_chain(&san_rqsg_if.nh, evt->command, evt);
drivers/platform/surface/surface_acpi_notify.c
47
struct blocking_notifier_head nh;
drivers/platform/surface/surface_acpi_notify.c
53
.nh = BLOCKING_NOTIFIER_INIT(san_rqsg_if.nh),
drivers/pwm/pwm-iqs620a.c
181
ret = blocking_notifier_chain_unregister(&iqs620_pwm->iqs62x->nh,
drivers/pwm/pwm-iqs620a.c
221
ret = blocking_notifier_chain_register(&iqs620_pwm->iqs62x->nh,
include/crypto/nh.h
49
void nh(const u32 *key, const u8 *message, size_t message_len,
include/linux/filter.h
782
struct bpf_nh_params nh;
include/linux/filter.h
821
memset(&bpf_net_ctx->ri, 0, offsetof(struct bpf_net_context, ri.nh));
include/linux/mfd/iqs62x.h
131
struct blocking_notifier_head nh;
include/linux/notifier.h
146
extern int atomic_notifier_chain_register(struct atomic_notifier_head *nh,
include/linux/notifier.h
148
extern int blocking_notifier_chain_register(struct blocking_notifier_head *nh,
include/linux/notifier.h
150
extern int raw_notifier_chain_register(struct raw_notifier_head *nh,
include/linux/notifier.h
152
extern int srcu_notifier_chain_register(struct srcu_notifier_head *nh,
include/linux/notifier.h
156
struct atomic_notifier_head *nh, struct notifier_block *nb);
include/linux/notifier.h
158
struct blocking_notifier_head *nh, struct notifier_block *nb);
include/linux/notifier.h
160
extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *nh,
include/linux/notifier.h
162
extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *nh,
include/linux/notifier.h
164
extern int raw_notifier_chain_unregister(struct raw_notifier_head *nh,
include/linux/notifier.h
166
extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *nh,
include/linux/notifier.h
169
extern int atomic_notifier_call_chain(struct atomic_notifier_head *nh,
include/linux/notifier.h
171
extern int blocking_notifier_call_chain(struct blocking_notifier_head *nh,
include/linux/notifier.h
173
extern int raw_notifier_call_chain(struct raw_notifier_head *nh,
include/linux/notifier.h
175
extern int srcu_notifier_call_chain(struct srcu_notifier_head *nh,
include/linux/notifier.h
178
extern int blocking_notifier_call_chain_robust(struct blocking_notifier_head *nh,
include/linux/notifier.h
180
extern int raw_notifier_call_chain_robust(struct raw_notifier_head *nh,
include/linux/notifier.h
183
extern bool atomic_notifier_call_chain_is_empty(struct atomic_notifier_head *nh);
include/linux/notifier.h
94
extern void srcu_init_notifier_head(struct srcu_notifier_head *nh);
include/net/dsa.h
134
struct raw_notifier_head nh;
include/net/gro.h
479
const void *nh = th - diff;
include/net/gro.h
482
if (((struct iphdr *)nh)->version == 6)
include/net/gro.h
483
return ipv6_gro_flush(nh, nh2);
include/net/gro.h
485
return inet_gro_flush(nh, nh2, p, inner);
include/net/ip6_fib.h
203
struct nexthop *nh;
include/net/ip6_fib.h
223
struct fib6_nh *nh;
include/net/ip6_route.h
322
if (a->nh || b->nh)
include/net/ip6_route.h
323
return nexthop_cmp(a->nh, b->nh);
include/net/ip6_route.h
76
return !(f6i->fib6_flags & RTF_ADDRCONF) && !f6i->nh &&
include/net/ip_fib.h
160
struct nexthop *nh;
include/net/ip_fib.h
575
int fib_check_nh(struct net *net, struct fib_nh *nh, u32 table, u8 scope,
include/net/ip_fib.h
607
struct fib_nh *nh;
include/net/ip_fib.h
609
nh = container_of(nhc, struct fib_nh, nh_common);
include/net/ip_fib.h
610
*itag = nh->nh_tclassid << 16;
include/net/ip_fib.h
657
int fib_nexthop_info(struct sk_buff *skb, const struct fib_nh_common *nh,
include/net/ip_fib.h
659
int fib_add_nexthop(struct sk_buff *skb, const struct fib_nh_common *nh,
include/net/nexthop.h
106
struct nexthop *nh;
include/net/nexthop.h
198
struct nh_notifier_single_info nh;
include/net/nexthop.h
239
struct nh_notifier_single_info *nh;
include/net/nexthop.h
264
static inline bool nexthop_get(struct nexthop *nh)
include/net/nexthop.h
266
return refcount_inc_not_zero(&nh->refcnt);
include/net/nexthop.h
269
static inline void nexthop_put(struct nexthop *nh)
include/net/nexthop.h
271
if (refcount_dec_and_test(&nh->refcnt))
include/net/nexthop.h
272
call_rcu_hurry(&nh->rcu, nexthop_free_rcu);
include/net/nexthop.h
281
static inline bool nexthop_is_fdb(const struct nexthop *nh)
include/net/nexthop.h
283
if (nh->is_group) {
include/net/nexthop.h
286
nh_grp = rcu_dereference_rtnl(nh->nh_grp);
include/net/nexthop.h
291
nhi = rcu_dereference_rtnl(nh->nh_info);
include/net/nexthop.h
296
static inline bool nexthop_has_v4(const struct nexthop *nh)
include/net/nexthop.h
298
if (nh->is_group) {
include/net/nexthop.h
301
nh_grp = rcu_dereference_rtnl(nh->nh_grp);
include/net/nexthop.h
307
static inline bool nexthop_is_multipath(const struct nexthop *nh)
include/net/nexthop.h
309
if (nh->is_group) {
include/net/nexthop.h
312
nh_grp = rcu_dereference_rtnl(nh->nh_grp);
include/net/nexthop.h
318
struct nexthop *nexthop_select_path(struct nexthop *nh, int hash);
include/net/nexthop.h
320
static inline unsigned int nexthop_num_path(const struct nexthop *nh)
include/net/nexthop.h
324
if (nh->is_group) {
include/net/nexthop.h
327
nh_grp = rcu_dereference_rtnl(nh->nh_grp);
include/net/nexthop.h
344
return nhg->nh_entries[nhsel].nh;
include/net/nexthop.h
348
int nexthop_mpath_fill_node(struct sk_buff *skb, struct nexthop *nh,
include/net/nexthop.h
351
struct nh_group *nhg = rcu_dereference_rtnl(nh->nh_grp);
include/net/nexthop.h
355
struct nexthop *nhe = nhg->nh_entries[i].nh;
include/net/nexthop.h
368
static inline bool nexthop_is_blackhole(const struct nexthop *nh)
include/net/nexthop.h
372
if (nh->is_group) {
include/net/nexthop.h
375
nh_grp = rcu_dereference_rtnl(nh->nh_grp);
include/net/nexthop.h
379
nh = nh_grp->nh_entries[0].nh;
include/net/nexthop.h
382
nhi = rcu_dereference_rtnl(nh->nh_info);
include/net/nexthop.h
389
struct nexthop *nh;
include/net/nexthop.h
391
nh = nexthop_select_path(res->fi->nh, hash);
include/net/nexthop.h
392
nhi = rcu_dereference(nh->nh_info);
include/net/nexthop.h
398
struct fib_nh_common *nexthop_fib_nhc(struct nexthop *nh, int nhsel)
include/net/nexthop.h
405
if (nh->is_group) {
include/net/nexthop.h
408
nh_grp = rcu_dereference_rtnl(nh->nh_grp);
include/net/nexthop.h
410
nh = nexthop_mpath_select(nh_grp, nhsel);
include/net/nexthop.h
411
if (!nh)
include/net/nexthop.h
416
nhi = rcu_dereference_rtnl(nh->nh_info);
include/net/nexthop.h
422
struct fib_nh_common *nexthop_get_nhc_lookup(const struct nexthop *nh,
include/net/nexthop.h
429
if (nh->is_group) {
include/net/nexthop.h
430
struct nh_group *nhg = rcu_dereference(nh->nh_grp);
include/net/nexthop.h
434
struct nexthop *nhe = nhg->nh_entries[i].nh;
include/net/nexthop.h
443
nhi = rcu_dereference(nh->nh_info);
include/net/nexthop.h
453
static inline bool nexthop_uses_dev(const struct nexthop *nh,
include/net/nexthop.h
458
if (nh->is_group) {
include/net/nexthop.h
459
struct nh_group *nhg = rcu_dereference(nh->nh_grp);
include/net/nexthop.h
463
struct nexthop *nhe = nhg->nh_entries[i].nh;
include/net/nexthop.h
470
nhi = rcu_dereference(nh->nh_info);
include/net/nexthop.h
480
if (unlikely(fi->nh))
include/net/nexthop.h
481
return nexthop_num_path(fi->nh);
include/net/nexthop.h
486
int fib_check_nexthop(struct nexthop *nh, u8 scope,
include/net/nexthop.h
491
if (unlikely(fi->nh))
include/net/nexthop.h
492
return nexthop_fib_nhc(fi->nh, nhsel);
include/net/nexthop.h
500
WARN_ON(fi->nh);
include/net/nexthop.h
508
int fib6_check_nexthop(struct nexthop *nh, struct fib6_config *cfg,
include/net/nexthop.h
512
static inline struct fib6_nh *nexthop_fib6_nh(struct nexthop *nh)
include/net/nexthop.h
516
if (nh->is_group) {
include/net/nexthop.h
519
nh_grp = rcu_dereference_rtnl(nh->nh_grp);
include/net/nexthop.h
520
nh = nexthop_mpath_select(nh_grp, 0);
include/net/nexthop.h
521
if (!nh)
include/net/nexthop.h
525
nhi = rcu_dereference_rtnl(nh->nh_info);
include/net/nexthop.h
536
fib6_nh = f6i->nh ? nexthop_fib6_nh(f6i->nh) : f6i->fib6_nh;
include/net/nexthop.h
542
struct nexthop *nh = res->f6i->nh;
include/net/nexthop.h
545
nh = nexthop_select_path(nh, hash);
include/net/nexthop.h
547
nhi = rcu_dereference_rtnl(nh->nh_info);
include/net/nexthop.h
551
res->nh = nexthop_fib6_nh(nh);
include/net/nexthop.h
553
res->nh = &nhi->fib6_nh;
include/net/nexthop.h
557
int nexthop_for_each_fib6_nh(struct nexthop *nh,
include/net/nexthop.h
558
int (*cb)(struct fib6_nh *nh, void *arg),
include/net/nexthop.h
561
static inline int nexthop_get_family(struct nexthop *nh)
include/net/nexthop.h
563
struct nh_info *nhi = rcu_dereference_rtnl(nh->nh_info);
include/net/nexthop.h
569
struct fib_nh_common *nexthop_fdb_nhc(struct nexthop *nh)
include/net/nexthop.h
571
struct nh_info *nhi = rcu_dereference_rtnl(nh->nh_info);
include/net/nexthop.h
576
static inline struct fib_nh_common *nexthop_path_fdb_result(struct nexthop *nh,
include/net/nexthop.h
582
nhp = nexthop_select_path(nh, hash);
include/net/vxlan.h
564
static inline bool vxlan_fdb_nh_path_select(struct nexthop *nh,
include/net/vxlan.h
570
nhc = nexthop_path_fdb_result(nh, hash >> 1);
include/trace/events/fib6.h
67
if (res->nh && res->nh->fib_nh_dev) {
include/trace/events/fib6.h
68
strscpy(__entry->name, res->nh->fib_nh_dev->name, IFNAMSIZ);
include/trace/events/fib6.h
75
} else if (res->nh) {
include/trace/events/fib6.h
77
*in6 = res->nh->fib_nh_gw6;
kernel/notifier.c
141
int atomic_notifier_chain_register(struct atomic_notifier_head *nh,
kernel/notifier.c
147
spin_lock_irqsave(&nh->lock, flags);
kernel/notifier.c
148
ret = notifier_chain_register(&nh->head, n, false);
kernel/notifier.c
149
spin_unlock_irqrestore(&nh->lock, flags);
kernel/notifier.c
164
int atomic_notifier_chain_register_unique_prio(struct atomic_notifier_head *nh,
kernel/notifier.c
170
spin_lock_irqsave(&nh->lock, flags);
kernel/notifier.c
171
ret = notifier_chain_register(&nh->head, n, true);
kernel/notifier.c
172
spin_unlock_irqrestore(&nh->lock, flags);
kernel/notifier.c
186
int atomic_notifier_chain_unregister(struct atomic_notifier_head *nh,
kernel/notifier.c
192
spin_lock_irqsave(&nh->lock, flags);
kernel/notifier.c
193
ret = notifier_chain_unregister(&nh->head, n);
kernel/notifier.c
194
spin_unlock_irqrestore(&nh->lock, flags);
kernel/notifier.c
217
int atomic_notifier_call_chain(struct atomic_notifier_head *nh,
kernel/notifier.c
223
ret = notifier_call_chain(&nh->head, val, v, -1, NULL);
kernel/notifier.c
239
bool atomic_notifier_call_chain_is_empty(struct atomic_notifier_head *nh)
kernel/notifier.c
241
return !rcu_access_pointer(nh->head);
kernel/notifier.c
249
static int __blocking_notifier_chain_register(struct blocking_notifier_head *nh,
kernel/notifier.c
261
return notifier_chain_register(&nh->head, n, unique_priority);
kernel/notifier.c
263
down_write(&nh->rwsem);
kernel/notifier.c
264
ret = notifier_chain_register(&nh->head, n, unique_priority);
kernel/notifier.c
265
up_write(&nh->rwsem);
kernel/notifier.c
279
int blocking_notifier_chain_register(struct blocking_notifier_head *nh,
kernel/notifier.c
282
return __blocking_notifier_chain_register(nh, n, false);
kernel/notifier.c
296
int blocking_notifier_chain_register_unique_prio(struct blocking_notifier_head *nh,
kernel/notifier.c
299
return __blocking_notifier_chain_register(nh, n, true);
kernel/notifier.c
313
int blocking_notifier_chain_unregister(struct blocking_notifier_head *nh,
kernel/notifier.c
324
return notifier_chain_unregister(&nh->head, n);
kernel/notifier.c
326
down_write(&nh->rwsem);
kernel/notifier.c
327
ret = notifier_chain_unregister(&nh->head, n);
kernel/notifier.c
328
up_write(&nh->rwsem);
kernel/notifier.c
333
int blocking_notifier_call_chain_robust(struct blocking_notifier_head *nh,
kernel/notifier.c
343
if (rcu_access_pointer(nh->head)) {
kernel/notifier.c
344
down_read(&nh->rwsem);
kernel/notifier.c
345
ret = notifier_call_chain_robust(&nh->head, val_up, val_down, v);
kernel/notifier.c
346
up_read(&nh->rwsem);
kernel/notifier.c
368
int blocking_notifier_call_chain(struct blocking_notifier_head *nh,
kernel/notifier.c
378
if (rcu_access_pointer(nh->head)) {
kernel/notifier.c
379
down_read(&nh->rwsem);
kernel/notifier.c
380
ret = notifier_call_chain(&nh->head, val, v, -1, NULL);
kernel/notifier.c
381
up_read(&nh->rwsem);
kernel/notifier.c
402
int raw_notifier_chain_register(struct raw_notifier_head *nh,
kernel/notifier.c
405
return notifier_chain_register(&nh->head, n, false);
kernel/notifier.c
419
int raw_notifier_chain_unregister(struct raw_notifier_head *nh,
kernel/notifier.c
422
return notifier_chain_unregister(&nh->head, n);
kernel/notifier.c
426
int raw_notifier_call_chain_robust(struct raw_notifier_head *nh,
kernel/notifier.c
429
return notifier_call_chain_robust(&nh->head, val_up, val_down, v);
kernel/notifier.c
450
int raw_notifier_call_chain(struct raw_notifier_head *nh,
kernel/notifier.c
453
return notifier_call_chain(&nh->head, val, v, -1, NULL);
kernel/notifier.c
472
int srcu_notifier_chain_register(struct srcu_notifier_head *nh,
kernel/notifier.c
483
return notifier_chain_register(&nh->head, n, false);
kernel/notifier.c
485
mutex_lock(&nh->mutex);
kernel/notifier.c
486
ret = notifier_chain_register(&nh->head, n, false);
kernel/notifier.c
487
mutex_unlock(&nh->mutex);
kernel/notifier.c
502
int srcu_notifier_chain_unregister(struct srcu_notifier_head *nh,
kernel/notifier.c
513
return notifier_chain_unregister(&nh->head, n);
kernel/notifier.c
515
mutex_lock(&nh->mutex);
kernel/notifier.c
516
ret = notifier_chain_unregister(&nh->head, n);
kernel/notifier.c
517
mutex_unlock(&nh->mutex);
kernel/notifier.c
518
synchronize_srcu(&nh->srcu);
kernel/notifier.c
539
int srcu_notifier_call_chain(struct srcu_notifier_head *nh,
kernel/notifier.c
545
idx = srcu_read_lock(&nh->srcu);
kernel/notifier.c
546
ret = notifier_call_chain(&nh->head, val, v, -1, NULL);
kernel/notifier.c
547
srcu_read_unlock(&nh->srcu, idx);
kernel/notifier.c
564
void srcu_init_notifier_head(struct srcu_notifier_head *nh)
kernel/notifier.c
566
mutex_init(&nh->mutex);
kernel/notifier.c
567
if (init_srcu_struct(&nh->srcu) < 0)
kernel/notifier.c
569
nh->head = NULL;
lib/crypto/mpi/longlong.h
1345
#define udiv_qrnnd(q, r, nh, nl, d) \
lib/crypto/mpi/longlong.h
1348
(q) = __MPN(udiv_w_sdiv) (&__r, nh, nl, d); \
lib/crypto/mpi/longlong.h
287
#define udiv_qrnnd(q, r, nh, nl, d) \
lib/crypto/mpi/longlong.h
291
: "1" ((USItype)(nh)), \
lib/crypto/mpi/longlong.h
486
#define udiv_qrnnd(q, r, nh, nl, d) \
lib/crypto/mpi/longlong.h
491
__nn.__i.__h = (nh); __nn.__i.__l = (nl); \
lib/crypto/mpi/longlong.h
827
#define sdiv_qrnnd(q, r, nh, nl, d) \
lib/crypto/mpi/longlong.h
830
: "r" ((SItype)(nh)), "1" ((SItype)(nl)), "r" ((SItype)(d)))
lib/crypto/mpi/mpi-internal.h
108
#define UDIV_QRNND_PREINV(q, r, nh, nl, d, di) \
lib/crypto/mpi/mpi-internal.h
113
umul_ppmm(_q, _ql, (nh), (di)); \
lib/crypto/mpi/mpi-internal.h
114
_q += (nh); /* DI is 2**BITS_PER_MPI_LIMB too small */ \
lib/crypto/mpi/mpi-internal.h
116
sub_ddmmss(_xh, _r, (nh), (nl), _xh, _xl); \
lib/crypto/nh.c
65
EXPORT_SYMBOL_GPL(nh);
lib/crypto/tests/nh_kunit.c
18
nh(key, nh_test_msg, 16, hash);
lib/crypto/tests/nh_kunit.c
21
nh(key, nh_test_msg, 96, hash);
lib/crypto/tests/nh_kunit.c
24
nh(key, nh_test_msg, 256, hash);
lib/crypto/tests/nh_kunit.c
27
nh(key, nh_test_msg, 1024, hash);
net/core/filter.c
2210
struct net_device *dev, struct bpf_nh_params *nh)
net/core/filter.c
2235
if (!nh) {
net/core/filter.c
2240
nexthop = &nh->ipv6_nh;
net/core/filter.c
2264
struct bpf_nh_params *nh)
net/core/filter.c
2270
if (!nh) {
net/core/filter.c
2288
} else if (nh->nh_family != AF_INET6) {
net/core/filter.c
2292
err = bpf_out_neigh_v6(net, skb, dev, nh);
net/core/filter.c
2306
struct bpf_nh_params *nh)
net/core/filter.c
2315
struct net_device *dev, struct bpf_nh_params *nh)
net/core/filter.c
2336
if (!nh) {
net/core/filter.c
2340
} else if (nh->nh_family == AF_INET6) {
net/core/filter.c
2345
neigh = ip_neigh_gw6(dev, &nh->ipv6_nh);
net/core/filter.c
2347
} else if (nh->nh_family == AF_INET) {
net/core/filter.c
2348
neigh = ip_neigh_gw4(dev, nh->ipv4_nh);
net/core/filter.c
2373
struct bpf_nh_params *nh)
net/core/filter.c
2379
if (!nh) {
net/core/filter.c
2403
err = bpf_out_neigh_v4(net, skb, dev, nh);
net/core/filter.c
2417
struct bpf_nh_params *nh)
net/core/filter.c
2425
struct bpf_nh_params *nh)
net/core/filter.c
2440
return __bpf_redirect_neigh_v4(skb, dev, nh);
net/core/filter.c
2442
return __bpf_redirect_neigh_v6(skb, dev, nh);
net/core/filter.c
2542
&ri->nh : NULL) :
net/core/filter.c
2604
memcpy(&ri->nh, params, sizeof(ri->nh));
net/core/filter.c
6340
if (res.nh->fib_nh_lws)
net/core/filter.c
6343
if (res.nh->fib_nh_gw_family)
net/core/filter.c
6344
*dst = res.nh->fib_nh_gw6;
net/core/filter.c
6346
dev = res.nh->fib_nh_dev;
net/dsa/switch.c
1086
struct raw_notifier_head *nh = &dst->nh;
net/dsa/switch.c
1089
err = raw_notifier_call_chain(nh, e, v);
net/dsa/switch.c
1124
return raw_notifier_chain_register(&ds->dst->nh, &ds->nb);
net/dsa/switch.c
1131
err = raw_notifier_chain_unregister(&ds->dst->nh, &ds->nb);
net/ipv4/fib_frontend.c
314
if (unlikely(fi->nh)) {
net/ipv4/fib_frontend.c
315
dev_match = nexthop_uses_dev(fi->nh, dev);
net/ipv4/fib_semantics.c
1002
cfg2.fc_gw4 != nh->fib_nh_gw4)
net/ipv4/fib_semantics.c
1008
&nh->fib_nh_gw6))
net/ipv4/fib_semantics.c
1021
if (nla_get_u32(nla) != nh->nh_tclassid)
net/ipv4/fib_semantics.c
1074
static int fib_check_nh_v6_gw(struct net *net, struct fib_nh *nh,
net/ipv4/fib_semantics.c
1079
.fc_flags = nh->fib_nh_flags | RTF_GATEWAY,
net/ipv4/fib_semantics.c
1080
.fc_ifindex = nh->fib_nh_oif,
net/ipv4/fib_semantics.c
1081
.fc_gateway = nh->fib_nh_gw6,
net/ipv4/fib_semantics.c
1088
nh->fib_nh_dev = fib6_nh.fib_nh_dev;
net/ipv4/fib_semantics.c
1089
netdev_hold(nh->fib_nh_dev, &nh->fib_nh_dev_tracker,
net/ipv4/fib_semantics.c
1091
nh->fib_nh_oif = nh->fib_nh_dev->ifindex;
net/ipv4/fib_semantics.c
1092
nh->fib_nh_scope = RT_SCOPE_LINK;
net/ipv4/fib_semantics.c
1143
static int fib_check_nh_v4_gw(struct net *net, struct fib_nh *nh, u32 table,
net/ipv4/fib_semantics.c
1150
if (nh->fib_nh_flags & RTNH_F_ONLINK) {
net/ipv4/fib_semantics.c
1157
dev = __dev_get_by_index(net, nh->fib_nh_oif);
net/ipv4/fib_semantics.c
1166
addr_type = inet_addr_type_dev_table(net, dev, nh->fib_nh_gw4);
net/ipv4/fib_semantics.c
1172
nh->fib_nh_flags |= RTNH_F_LINKDOWN;
net/ipv4/fib_semantics.c
1173
nh->fib_nh_dev = dev;
net/ipv4/fib_semantics.c
1174
netdev_hold(dev, &nh->fib_nh_dev_tracker, GFP_ATOMIC);
net/ipv4/fib_semantics.c
1175
nh->fib_nh_scope = RT_SCOPE_LINK;
net/ipv4/fib_semantics.c
1182
.daddr = nh->fib_nh_gw4,
net/ipv4/fib_semantics.c
1184
.flowi4_oif = nh->fib_nh_oif,
net/ipv4/fib_semantics.c
1220
nh->fib_nh_scope = res.scope;
net/ipv4/fib_semantics.c
1221
nh->fib_nh_oif = FIB_RES_OIF(res);
net/ipv4/fib_semantics.c
1222
nh->fib_nh_dev = dev = FIB_RES_DEV(res);
net/ipv4/fib_semantics.c
1228
netdev_hold(dev, &nh->fib_nh_dev_tracker, GFP_ATOMIC);
net/ipv4/fib_semantics.c
1230
nh->fib_nh_flags |= RTNH_F_LINKDOWN;
net/ipv4/fib_semantics.c
1237
static int fib_check_nh_nongw(struct net *net, struct fib_nh *nh,
net/ipv4/fib_semantics.c
1243
if (nh->fib_nh_flags & (RTNH_F_PERVASIVE | RTNH_F_ONLINK)) {
net/ipv4/fib_semantics.c
1252
in_dev = inetdev_by_index(net, nh->fib_nh_oif);
net/ipv4/fib_semantics.c
1261
nh->fib_nh_dev = in_dev->dev;
net/ipv4/fib_semantics.c
1262
netdev_hold(nh->fib_nh_dev, &nh->fib_nh_dev_tracker, GFP_ATOMIC);
net/ipv4/fib_semantics.c
1263
nh->fib_nh_scope = RT_SCOPE_HOST;
net/ipv4/fib_semantics.c
1264
if (!netif_carrier_ok(nh->fib_nh_dev))
net/ipv4/fib_semantics.c
1265
nh->fib_nh_flags |= RTNH_F_LINKDOWN;
net/ipv4/fib_semantics.c
1272
int fib_check_nh(struct net *net, struct fib_nh *nh, u32 table, u8 scope,
net/ipv4/fib_semantics.c
1277
if (nh->fib_nh_gw_family == AF_INET)
net/ipv4/fib_semantics.c
1278
err = fib_check_nh_v4_gw(net, nh, table, scope, extack);
net/ipv4/fib_semantics.c
1279
else if (nh->fib_nh_gw_family == AF_INET6)
net/ipv4/fib_semantics.c
1280
err = fib_check_nh_v6_gw(net, nh, table, extack);
net/ipv4/fib_semantics.c
1282
err = fib_check_nh_nongw(net, nh, extack);
net/ipv4/fib_semantics.c
1290
struct fib_nh *nh;
net/ipv4/fib_semantics.c
1296
nh = container_of(nhc, struct fib_nh, nh_common);
net/ipv4/fib_semantics.c
1297
saddr = inet_select_addr(nh->fib_nh_dev, nh->fib_nh_gw4, scope);
net/ipv4/fib_semantics.c
1299
WRITE_ONCE(nh->nh_saddr, saddr);
net/ipv4/fib_semantics.c
1300
WRITE_ONCE(nh->nh_saddr_genid, atomic_read(&net->ipv4.dev_addr_genid));
net/ipv4/fib_semantics.c
1313
struct fib_nh *nh;
net/ipv4/fib_semantics.c
1315
nh = container_of(nhc, struct fib_nh, nh_common);
net/ipv4/fib_semantics.c
1316
if (READ_ONCE(nh->nh_saddr_genid) ==
net/ipv4/fib_semantics.c
1318
return READ_ONCE(nh->nh_saddr);
net/ipv4/fib_semantics.c
1353
struct nexthop *nh = NULL;
net/ipv4/fib_semantics.c
1383
nh = nexthop_find_by_id(net, cfg->fc_nh_id);
net/ipv4/fib_semantics.c
1384
if (!nh) {
net/ipv4/fib_semantics.c
1424
if (nh) {
net/ipv4/fib_semantics.c
1425
if (!nexthop_get(nh)) {
net/ipv4/fib_semantics.c
1430
fi->nh = nh;
net/ipv4/fib_semantics.c
1473
if (fi->nh) {
net/ipv4/fib_semantics.c
1474
err = fib_check_nexthop(fi->nh, cfg->fc_scope, extack);
net/ipv4/fib_semantics.c
1478
struct fib_nh *nh = fi->fib_nh;
net/ipv4/fib_semantics.c
1486
if (nh->fib_nh_gw_family) {
net/ipv4/fib_semantics.c
1491
nh->fib_nh_scope = RT_SCOPE_NOWHERE;
net/ipv4/fib_semantics.c
1492
nh->fib_nh_dev = dev_get_by_index(net, nh->fib_nh_oif);
net/ipv4/fib_semantics.c
1494
if (!nh->fib_nh_dev)
net/ipv4/fib_semantics.c
1496
netdev_tracker_alloc(nh->fib_nh_dev, &nh->fib_nh_dev_tracker,
net/ipv4/fib_semantics.c
1519
if (!fi->nh) {
net/ipv4/fib_semantics.c
1552
if (fi->nh) {
net/ipv4/fib_semantics.c
1553
list_add(&fi->nh_list, &nh->fi_list);
net/ipv4/fib_semantics.c
1691
if (unlikely(fi->nh)) {
net/ipv4/fib_semantics.c
1692
if (nexthop_mpath_fill_node(skb, fi->nh, AF_INET) < 0)
net/ipv4/fib_semantics.c
1700
nh_tclassid = nh->nh_tclassid;
net/ipv4/fib_semantics.c
1702
if (fib_add_nexthop(skb, &nh->nh_common, nh->fib_nh_weight,
net/ipv4/fib_semantics.c
1764
if (fi->nh) {
net/ipv4/fib_semantics.c
1765
if (nla_put_u32(skb, RTA_NH_ID, fi->nh->id))
net/ipv4/fib_semantics.c
1767
if (nexthop_is_blackhole(fi->nh))
net/ipv4/fib_semantics.c
1783
struct fib_nh *nh;
net/ipv4/fib_semantics.c
1785
nh = container_of(nhc, struct fib_nh, nh_common);
net/ipv4/fib_semantics.c
1786
if (nh->nh_tclassid &&
net/ipv4/fib_semantics.c
1787
nla_put_u32(skb, RTA_FLOW, nh->nh_tclassid))
net/ipv4/fib_semantics.c
1843
static int call_fib_nh_notifiers(struct fib_nh *nh,
net/ipv4/fib_semantics.c
1846
bool ignore_link_down = ip_ignore_linkdown(nh->fib_nh_dev);
net/ipv4/fib_semantics.c
1848
.fib_nh = nh,
net/ipv4/fib_semantics.c
1853
if (nh->fib_nh_flags & RTNH_F_DEAD)
net/ipv4/fib_semantics.c
1855
if (ignore_link_down && nh->fib_nh_flags & RTNH_F_LINKDOWN)
net/ipv4/fib_semantics.c
1857
return call_fib4_notifiers(dev_net(nh->fib_nh_dev), event_type,
net/ipv4/fib_semantics.c
1860
if ((ignore_link_down && nh->fib_nh_flags & RTNH_F_LINKDOWN) ||
net/ipv4/fib_semantics.c
1861
(nh->fib_nh_flags & RTNH_F_DEAD))
net/ipv4/fib_semantics.c
1862
return call_fib4_notifiers(dev_net(nh->fib_nh_dev),
net/ipv4/fib_semantics.c
1913
struct fib_nh *nh;
net/ipv4/fib_semantics.c
1915
hlist_for_each_entry(nh, head, nh_hash) {
net/ipv4/fib_semantics.c
1916
DEBUG_NET_WARN_ON_ONCE(nh->fib_nh_dev != dev);
net/ipv4/fib_semantics.c
1917
fib_nhc_update_mtu(&nh->nh_common, dev->mtu, orig_mtu);
net/ipv4/fib_semantics.c
1934
struct fib_nh *nh;
net/ipv4/fib_semantics.c
1940
hlist_for_each_entry(nh, head, nh_hash) {
net/ipv4/fib_semantics.c
1941
struct fib_info *fi = nh->nh_parent;
net/ipv4/fib_semantics.c
1945
DEBUG_NET_WARN_ON_ONCE(nh->fib_nh_dev != dev);
net/ipv4/fib_semantics.c
2082
struct fib_nh *nh;
net/ipv4/fib_semantics.c
2099
hlist_for_each_entry(nh, head, nh_hash) {
net/ipv4/fib_semantics.c
2100
struct fib_info *fi = nh->nh_parent;
net/ipv4/fib_semantics.c
2104
DEBUG_NET_WARN_ON_ONCE(nh->fib_nh_dev != dev);
net/ipv4/fib_semantics.c
2138
static bool fib_good_nh(const struct fib_nh *nh)
net/ipv4/fib_semantics.c
2142
if (nh->fib_nh_scope == RT_SCOPE_LINK) {
net/ipv4/fib_semantics.c
2147
if (likely(nh->fib_nh_gw_family == AF_INET))
net/ipv4/fib_semantics.c
2148
n = __ipv4_neigh_lookup_noref(nh->fib_nh_dev,
net/ipv4/fib_semantics.c
2149
(__force u32)nh->fib_nh_gw4);
net/ipv4/fib_semantics.c
2150
else if (nh->fib_nh_gw_family == AF_INET6)
net/ipv4/fib_semantics.c
2151
n = __ipv6_neigh_lookup_noref_stub(nh->fib_nh_dev,
net/ipv4/fib_semantics.c
2152
&nh->fib_nh_gw6);
net/ipv4/fib_semantics.c
2173
if (unlikely(res->fi->nh)) {
net/ipv4/fib_semantics.c
226
if (fi->nh) {
net/ipv4/fib_semantics.c
227
nexthop_put(fi->nh);
net/ipv4/fib_semantics.c
259
if (fi->nh) {
net/ipv4/fib_semantics.c
278
if (fi->nh || ofi->nh)
net/ipv4/fib_semantics.c
279
return nexthop_cmp(fi->nh, ofi->nh) ? 0 : -1;
net/ipv4/fib_semantics.c
287
if (nh->fib_nh_oif != onh->fib_nh_oif ||
net/ipv4/fib_semantics.c
288
nh->fib_nh_gw_family != onh->fib_nh_gw_family ||
net/ipv4/fib_semantics.c
289
nh->fib_nh_scope != onh->fib_nh_scope ||
net/ipv4/fib_semantics.c
291
nh->fib_nh_weight != onh->fib_nh_weight ||
net/ipv4/fib_semantics.c
294
nh->nh_tclassid != onh->nh_tclassid ||
net/ipv4/fib_semantics.c
296
lwtunnel_cmp_encap(nh->fib_nh_lws, onh->fib_nh_lws) ||
net/ipv4/fib_semantics.c
297
((nh->fib_nh_flags ^ onh->fib_nh_flags) & ~RTNH_COMPARE_MASK))
net/ipv4/fib_semantics.c
300
if (nh->fib_nh_gw_family == AF_INET &&
net/ipv4/fib_semantics.c
301
nh->fib_nh_gw4 != onh->fib_nh_gw4)
net/ipv4/fib_semantics.c
304
if (nh->fib_nh_gw_family == AF_INET6 &&
net/ipv4/fib_semantics.c
305
ipv6_addr_cmp(&nh->fib_nh_gw6, &onh->fib_nh_gw6))
net/ipv4/fib_semantics.c
343
if (fi->nh) {
net/ipv4/fib_semantics.c
344
val ^= fi->nh->id;
net/ipv4/fib_semantics.c
347
val ^= nh->fib_nh_oif;
net/ipv4/fib_semantics.c
432
if (!fi->nh || fi->nh->id != cfg->fc_nh_id)
net/ipv4/fib_semantics.c
479
struct fib_nh *nh;
net/ipv4/fib_semantics.c
483
hlist_for_each_entry_rcu(nh, head, nh_hash) {
net/ipv4/fib_semantics.c
484
DEBUG_NET_WARN_ON_ONCE(nh->fib_nh_dev != dev);
net/ipv4/fib_semantics.c
485
if (nh->fib_nh_gw4 == gw &&
net/ipv4/fib_semantics.c
486
!(nh->fib_nh_flags & RTNH_F_DEAD)) {
net/ipv4/fib_semantics.c
507
if (fi->nh)
net/ipv4/fib_semantics.c
59
int nhsel; const struct fib_nh *nh; \
net/ipv4/fib_semantics.c
60
for (nhsel = 0, nh = (fi)->fib_nh; \
net/ipv4/fib_semantics.c
62
nh++, nhsel++)
net/ipv4/fib_semantics.c
645
int fib_nh_init(struct net *net, struct fib_nh *nh,
net/ipv4/fib_semantics.c
651
nh->fib_nh_family = AF_INET;
net/ipv4/fib_semantics.c
653
err = fib_nh_common_init(net, &nh->nh_common, cfg->fc_encap,
net/ipv4/fib_semantics.c
658
nh->fib_nh_oif = cfg->fc_oif;
net/ipv4/fib_semantics.c
659
nh->fib_nh_gw_family = cfg->fc_gw_family;
net/ipv4/fib_semantics.c
661
nh->fib_nh_gw4 = cfg->fc_gw4;
net/ipv4/fib_semantics.c
663
nh->fib_nh_gw6 = cfg->fc_gw6;
net/ipv4/fib_semantics.c
665
nh->fib_nh_flags = cfg->fc_flags;
net/ipv4/fib_semantics.c
668
nh->nh_tclassid = cfg->fc_flow;
net/ipv4/fib_semantics.c
669
if (nh->nh_tclassid)
net/ipv4/fib_semantics.c
673
nh->fib_nh_weight = nh_weight;
net/ipv4/fib_semantics.c
720
struct fib_nh *nh;
net/ipv4/fib_semantics.c
75
int nhsel; const struct fib_nh *nh = (fi)->fib_nh; \
net/ipv4/fib_semantics.c
795
nh = fib_info_nh(fi, 0);
net/ipv4/fib_semantics.c
796
if (cfg->fc_oif && nh->fib_nh_oif != cfg->fc_oif) {
net/ipv4/fib_semantics.c
802
if (cfg->fc_gw_family != nh->fib_nh_gw_family ||
net/ipv4/fib_semantics.c
804
nh->fib_nh_gw4 != cfg->fc_gw4) ||
net/ipv4/fib_semantics.c
806
ipv6_addr_cmp(&nh->fib_nh_gw6, &cfg->fc_gw6))) {
net/ipv4/fib_semantics.c
813
if (cfg->fc_flow && nh->nh_tclassid != cfg->fc_flow) {
net/ipv4/fib_semantics.c
835
if (nh->fib_nh_flags & RTNH_F_DEAD)
net/ipv4/fib_semantics.c
838
if (ip_ignore_linkdown(nh->fib_nh_dev) &&
net/ipv4/fib_semantics.c
839
nh->fib_nh_flags & RTNH_F_LINKDOWN)
net/ipv4/fib_semantics.c
842
total += nh->fib_nh_weight;
net/ipv4/fib_semantics.c
880
const struct fib_nh *nh,
net/ipv4/fib_semantics.c
893
result = lwtunnel_cmp_encap(lwtstate, nh->fib_nh_lws);
net/ipv4/fib_semantics.c
912
if (fi->nh && cfg->fc_nh_id == fi->nh->id)
net/ipv4/fib_semantics.c
917
if (fi->nh) {
net/ipv4/fib_semantics.c
924
struct fib_nh *nh;
net/ipv4/fib_semantics.c
926
nh = fib_info_nh(fi, 0);
net/ipv4/fib_semantics.c
929
cfg->fc_encap, nh, cfg, extack))
net/ipv4/fib_semantics.c
934
cfg->fc_flow != nh->nh_tclassid)
net/ipv4/fib_semantics.c
937
if ((cfg->fc_oif && cfg->fc_oif != nh->fib_nh_oif) ||
net/ipv4/fib_semantics.c
939
cfg->fc_gw_family != nh->fib_nh_gw_family))
net/ipv4/fib_semantics.c
943
cfg->fc_gw4 != nh->fib_nh_gw4)
net/ipv4/fib_semantics.c
947
ipv6_addr_cmp(&cfg->fc_gw6, &nh->fib_nh_gw6))
net/ipv4/fib_semantics.c
966
if (rtnh->rtnh_ifindex && rtnh->rtnh_ifindex != nh->fib_nh_oif)
net/ipv4/fib_semantics.c
989
if (nh->fib_nh_gw_family != AF_INET ||
net/ipv4/fib_semantics.c
990
gw != nh->fib_nh_gw4)
net/ipv4/fib_semantics.c
999
switch (nh->fib_nh_gw_family) {
net/ipv4/fib_trie.c
1578
if (unlikely(fi->nh)) {
net/ipv4/fib_trie.c
1579
if (nexthop_is_blackhole(fi->nh)) {
net/ipv4/fib_trie.c
1584
nhc = nexthop_get_nhc_lookup(fi->nh, fib_flags, flp,
net/ipv4/icmp.c
1442
int nh;
net/ipv4/icmp.c
1453
nh = skb_network_offset(skb);
net/ipv4/icmp.c
1462
skb_set_network_header(skb, nh);
net/ipv4/ip_tunnel.c
382
int nh, err;
net/ipv4/ip_tunnel.c
412
nh = skb_network_header(skb) - skb->head;
net/ipv4/ip_tunnel.c
421
iph = (struct iphdr *)(skb->head + nh);
net/ipv4/nexthop.c
1007
static size_t nh_nlmsg_size_grp(struct nexthop *nh)
net/ipv4/nexthop.c
1009
struct nh_group *nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
1020
static size_t nh_nlmsg_size_single(struct nexthop *nh)
net/ipv4/nexthop.c
1022
struct nh_info *nhi = rtnl_dereference(nh->nh_info);
net/ipv4/nexthop.c
1051
static size_t nh_nlmsg_size(struct nexthop *nh)
net/ipv4/nexthop.c
1057
if (nh->is_group)
net/ipv4/nexthop.c
1058
sz += nh_nlmsg_size_grp(nh) +
net/ipv4/nexthop.c
1062
sz += nh_nlmsg_size_single(nh);
net/ipv4/nexthop.c
1067
static void nexthop_notify(int event, struct nexthop *nh, struct nl_info *info)
net/ipv4/nexthop.c
1074
skb = nlmsg_new(nh_nlmsg_size(nh), gfp_any());
net/ipv4/nexthop.c
1078
err = nh_fill_node(skb, nh, event, info->portid, seq, nlflags, 0);
net/ipv4/nexthop.c
1139
static int nh_fill_res_bucket(struct sk_buff *skb, struct nexthop *nh,
net/ipv4/nexthop.c
114
const struct nexthop *nh)
net/ipv4/nexthop.c
1157
nhm->nh_protocol = nh->protocol;
net/ipv4/nexthop.c
116
struct nh_info *nhi = rtnl_dereference(nh->nh_info);
net/ipv4/nexthop.c
1161
if (nla_put_u32(skb, NHA_ID, nh->id))
net/ipv4/nexthop.c
1169
nla_put_u32(skb, NHA_RES_BUCKET_NH_ID, nhge->nh->id) ||
net/ipv4/nexthop.c
119
info->nh = kzalloc_obj(*info->nh);
net/ipv4/nexthop.c
1191
struct nexthop *nh = nhge->nh_parent;
net/ipv4/nexthop.c
1199
err = nh_fill_res_bucket(skb, nh, bucket, bucket_index,
net/ipv4/nexthop.c
120
if (!info->nh)
net/ipv4/nexthop.c
1207
rtnl_notify(skb, nh->net, 0, RTNLGRP_NEXTHOP, NULL, GFP_KERNEL);
net/ipv4/nexthop.c
1210
rtnl_set_sk_err(nh->net, RTNLGRP_NEXTHOP, err);
net/ipv4/nexthop.c
1213
static bool valid_group_nh(struct nexthop *nh, unsigned int npaths,
net/ipv4/nexthop.c
1216
if (nh->is_group) {
net/ipv4/nexthop.c
1217
struct nh_group *nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
123
__nh_notifier_single_info_init(info->nh, nhi);
net/ipv4/nexthop.c
1232
struct nh_info *nhi = rtnl_dereference(nh->nh_info);
net/ipv4/nexthop.c
1245
static int nh_check_attr_fdb_group(struct nexthop *nh, u8 *nh_family,
net/ipv4/nexthop.c
1250
nhi = rtnl_dereference(nh->nh_info);
net/ipv4/nexthop.c
130
kfree(info->nh);
net/ipv4/nexthop.c
1340
struct nexthop *nh;
net/ipv4/nexthop.c
1343
nh = nexthop_find_by_id(net, nhg[i].id);
net/ipv4/nexthop.c
1344
if (!nh) {
net/ipv4/nexthop.c
1348
if (!valid_group_nh(nh, len, &is_fdb_nh, extack))
net/ipv4/nexthop.c
1351
if (nhg_fdb && nh_check_attr_fdb_group(nh, &nh_family, extack))
net/ipv4/nexthop.c
1363
static bool ipv6_good_nh(const struct fib6_nh *nh)
net/ipv4/nexthop.c
1370
n = __ipv6_neigh_lookup_noref_stub(nh->fib_nh_dev, &nh->fib_nh_gw6);
net/ipv4/nexthop.c
1379
static bool ipv4_good_nh(const struct fib_nh *nh)
net/ipv4/nexthop.c
1386
n = __ipv4_neigh_lookup_noref(nh->fib_nh_dev,
net/ipv4/nexthop.c
1387
(__force u32)nh->fib_nh_gw4);
net/ipv4/nexthop.c
1396
static bool nexthop_is_good_nh(const struct nexthop *nh)
net/ipv4/nexthop.c
1398
struct nh_info *nhi = rcu_dereference(nh->nh_info);
net/ipv4/nexthop.c
1421
return nhge->nh;
net/ipv4/nexthop.c
1442
if (!nexthop_is_good_nh(nhge->nh))
net/ipv4/nexthop.c
1452
return nhge->nh;
net/ipv4/nexthop.c
1458
return nhge0->nh;
net/ipv4/nexthop.c
1475
return nhge->nh;
net/ipv4/nexthop.c
1478
struct nexthop *nexthop_select_path(struct nexthop *nh, int hash)
net/ipv4/nexthop.c
1482
if (!nh->is_group)
net/ipv4/nexthop.c
1483
return nh;
net/ipv4/nexthop.c
1485
nhg = rcu_dereference(nh->nh_grp);
net/ipv4/nexthop.c
1496
int nexthop_for_each_fib6_nh(struct nexthop *nh,
net/ipv4/nexthop.c
1497
int (*cb)(struct fib6_nh *nh, void *arg),
net/ipv4/nexthop.c
1503
if (nh->is_group) {
net/ipv4/nexthop.c
1507
nhg = rcu_dereference_rtnl(nh->nh_grp);
net/ipv4/nexthop.c
1511
nhi = rcu_dereference_rtnl(nhge->nh->nh_info);
net/ipv4/nexthop.c
1517
nhi = rcu_dereference_rtnl(nh->nh_info);
net/ipv4/nexthop.c
152
nhi = rtnl_dereference(nhge->nh->nh_info);
net/ipv4/nexthop.c
1537
int fib6_check_nexthop(struct nexthop *nh, struct fib6_config *cfg,
net/ipv4/nexthop.c
154
__nh_notifier_single_info_init(&info->nh_grp->nh_entries[i].nh,
net/ipv4/nexthop.c
1552
if (nh->is_group) {
net/ipv4/nexthop.c
1555
nhg = rcu_dereference_rtnl(nh->nh_grp);
net/ipv4/nexthop.c
1560
nhi = rcu_dereference_rtnl(nh->nh_info);
net/ipv4/nexthop.c
1618
int fib_check_nexthop(struct nexthop *nh, u8 scope,
net/ipv4/nexthop.c
1624
if (nh->is_group) {
net/ipv4/nexthop.c
1627
nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
1641
nhi = rtnl_dereference(nhg->nh_entries[0].nh->nh_info);
net/ipv4/nexthop.c
1644
nhi = rtnl_dereference(nh->nh_info);
net/ipv4/nexthop.c
1798
old_nhge->nh,
net/ipv4/nexthop.c
1799
new_nhge->nh, &extack);
net/ipv4/nexthop.c
185
nhi = rtnl_dereference(nhge->nh->nh_info);
net/ipv4/nexthop.c
194
const struct nexthop *nh)
net/ipv4/nexthop.c
1945
u32 id = rtnl_dereference(bucket->nh_entry)->nh->id;
net/ipv4/nexthop.c
1952
if (nhge->nh->id == id) {
net/ipv4/nexthop.c
196
struct nh_group *nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
2011
struct nexthop *nh = nhge->nh;
net/ipv4/nexthop.c
2015
WARN_ON(!nh);
net/ipv4/nexthop.c
2040
if (nhg->nh_entries[i].nh == nh) {
net/ipv4/nexthop.c
2045
nhi = rtnl_dereference(nhges[i].nh->nh_info);
net/ipv4/nexthop.c
2052
new_nhges[j].nh = nhges[i].nh;
net/ipv4/nexthop.c
2054
list_add(&new_nhges[j].nh_list, &new_nhges[j].nh->grp_list);
net/ipv4/nexthop.c
206
const struct nexthop *nh)
net/ipv4/nexthop.c
2066
nexthop_put(nhge->nh);
net/ipv4/nexthop.c
208
struct nh_group *nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
2083
static void remove_nexthop_from_groups(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
2092
if (list_empty(&nh->grp_list))
net/ipv4/nexthop.c
2095
list_for_each_entry_safe(nhge, tmp, &nh->grp_list, nh_list)
net/ipv4/nexthop.c
2108
static void remove_nexthop_group(struct nexthop *nh, struct nl_info *nlinfo)
net/ipv4/nexthop.c
2110
struct nh_group *nhg = rcu_dereference_rtnl(nh->nh_grp);
net/ipv4/nexthop.c
2117
if (WARN_ON(!nhge->nh))
net/ipv4/nexthop.c
2130
static void __remove_nexthop_fib(struct net *net, struct nexthop *nh)
net/ipv4/nexthop.c
2136
list_for_each_entry(fi, &nh->fi_list, nh_list) {
net/ipv4/nexthop.c
2143
spin_lock_bh(&nh->lock);
net/ipv4/nexthop.c
2145
nh->dead = true;
net/ipv4/nexthop.c
2147
while (!list_empty(&nh->f6i_list)) {
net/ipv4/nexthop.c
2148
f6i = list_first_entry(&nh->f6i_list, typeof(*f6i), nh_list);
net/ipv4/nexthop.c
2153
spin_unlock_bh(&nh->lock);
net/ipv4/nexthop.c
2157
spin_lock_bh(&nh->lock);
net/ipv4/nexthop.c
2160
spin_unlock_bh(&nh->lock);
net/ipv4/nexthop.c
2163
static void __remove_nexthop(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
2166
__remove_nexthop_fib(net, nh);
net/ipv4/nexthop.c
2168
if (nh->is_group) {
net/ipv4/nexthop.c
2169
remove_nexthop_group(nh, nlinfo);
net/ipv4/nexthop.c
217
const struct nexthop *nh)
net/ipv4/nexthop.c
2173
nhi = rtnl_dereference(nh->nh_info);
net/ipv4/nexthop.c
2177
remove_nexthop_from_groups(net, nh, nlinfo);
net/ipv4/nexthop.c
2181
static void remove_nexthop(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
2184
call_nexthop_notifiers(net, NEXTHOP_EVENT_DEL, nh, NULL);
net/ipv4/nexthop.c
2187
rb_erase(&nh->rb_node, &net->nexthop.rb_root);
net/ipv4/nexthop.c
219
info->id = nh->id;
net/ipv4/nexthop.c
2190
nexthop_notify(RTM_DELNEXTHOP, nh, nlinfo);
net/ipv4/nexthop.c
2192
__remove_nexthop(net, nh, nlinfo);
net/ipv4/nexthop.c
2195
nexthop_put(nh);
net/ipv4/nexthop.c
2201
static void nh_rt_cache_flush(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
2208
if (!list_empty(&nh->fi_list))
net/ipv4/nexthop.c
221
if (nh->is_group)
net/ipv4/nexthop.c
2211
list_for_each_entry(f6i, &nh->f6i_list, nh_list)
net/ipv4/nexthop.c
222
return nh_notifier_grp_info_init(info, nh);
net/ipv4/nexthop.c
2223
struct nh_info *nhi = rtnl_dereference(nhge->nh->nh_info);
net/ipv4/nexthop.c
224
return nh_notifier_single_info_init(info, nh);
net/ipv4/nexthop.c
228
const struct nexthop *nh)
net/ipv4/nexthop.c
23
static void remove_nexthop(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
230
if (nh->is_group)
net/ipv4/nexthop.c
231
nh_notifier_grp_info_fini(info, nh);
net/ipv4/nexthop.c
2327
nhi = rtnl_dereference(nhges[i].nh->nh_info);
net/ipv4/nexthop.c
2350
if (nhge->nh == old) {
net/ipv4/nexthop.c
2368
if (nhge->nh == old)
net/ipv4/nexthop.c
238
struct nexthop *nh,
net/ipv4/nexthop.c
2485
static void __nexthop_replace_notify(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
2490
if (!list_empty(&nh->fi_list)) {
net/ipv4/nexthop.c
2497
list_for_each_entry(fi, &nh->fi_list, nh_list)
net/ipv4/nexthop.c
2502
list_for_each_entry(fi, &nh->fi_list, nh_list)
net/ipv4/nexthop.c
2506
list_for_each_entry(f6i, &nh->f6i_list, nh_list)
net/ipv4/nexthop.c
2514
static void nexthop_replace_notify(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
2519
__nexthop_replace_notify(net, nh, info);
net/ipv4/nexthop.c
252
err = nh_notifier_info_init(&info, nh);
net/ipv4/nexthop.c
2521
list_for_each_entry(nhge, &nh->grp_list, nh_list)
net/ipv4/nexthop.c
2598
struct nexthop *nh;
net/ipv4/nexthop.c
260
nh_notifier_info_fini(&info, nh);
net/ipv4/nexthop.c
2606
nh = rb_entry(parent, struct nexthop, rb_node);
net/ipv4/nexthop.c
2607
if (new_id < nh->id) {
net/ipv4/nexthop.c
2609
} else if (new_id > nh->id) {
net/ipv4/nexthop.c
2612
rc = replace_nexthop(net, nh, new_nh, cfg, extack);
net/ipv4/nexthop.c
2614
new_nh = nh; /* send notification with old nh */
net/ipv4/nexthop.c
2704
struct nexthop *nh;
net/ipv4/nexthop.c
2707
nh = rb_entry(node, struct nexthop, rb_node);
net/ipv4/nexthop.c
2708
remove_nexthop(net, nh, NULL);
net/ipv4/nexthop.c
271
struct nexthop *nh;
net/ipv4/nexthop.c
2720
struct nexthop *nh;
net/ipv4/nexthop.c
2724
nh = nexthop_alloc();
net/ipv4/nexthop.c
2725
if (!nh)
net/ipv4/nexthop.c
2728
nh->is_group = 1;
net/ipv4/nexthop.c
2732
kfree(nh);
net/ipv4/nexthop.c
2740
kfree(nh);
net/ipv4/nexthop.c
2766
nhg->nh_entries[i].nh = nhe;
net/ipv4/nexthop.c
2770
nhg->nh_entries[i].nh_parent = nh;
net/ipv4/nexthop.c
2802
rcu_assign_pointer(nh->nh_grp, nhg);
net/ipv4/nexthop.c
2804
return nh;
net/ipv4/nexthop.c
2810
nexthop_put(nhg->nh_entries[i].nh);
net/ipv4/nexthop.c
2815
kfree(nh);
net/ipv4/nexthop.c
2820
static int nh_create_ipv4(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
2849
nh->nh_flags = fib_nh->fib_nh_flags;
net/ipv4/nexthop.c
2859
static int nh_create_ipv6(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
2888
nh->nh_flags = fib6_nh->fib_nh_flags;
net/ipv4/nexthop.c
2898
struct nexthop *nh;
net/ipv4/nexthop.c
290
nh = nexthop_find_by_id(info->net, info->id);
net/ipv4/nexthop.c
2901
nh = nexthop_alloc();
net/ipv4/nexthop.c
2902
if (!nh)
net/ipv4/nexthop.c
2907
kfree(nh);
net/ipv4/nexthop.c
291
if (!nh) {
net/ipv4/nexthop.c
2911
nh->nh_flags = cfg->nh_flags;
net/ipv4/nexthop.c
2912
nh->net = net;
net/ipv4/nexthop.c
2914
nhi->nh_parent = nh;
net/ipv4/nexthop.c
2928
err = nh_create_ipv4(net, nh, nhi, cfg, extack);
net/ipv4/nexthop.c
2931
err = nh_create_ipv6(net, nh, nhi, cfg, extack);
net/ipv4/nexthop.c
2937
kfree(nh);
net/ipv4/nexthop.c
2945
rcu_assign_pointer(nh->nh_info, nhi);
net/ipv4/nexthop.c
2947
return nh;
net/ipv4/nexthop.c
2954
struct nexthop *nh;
net/ipv4/nexthop.c
296
nhg = rcu_dereference(nh->nh_grp);
net/ipv4/nexthop.c
2966
nh = nexthop_create_group(net, cfg);
net/ipv4/nexthop.c
2968
nh = nexthop_create(net, cfg, extack);
net/ipv4/nexthop.c
2970
if (IS_ERR(nh))
net/ipv4/nexthop.c
2971
return nh;
net/ipv4/nexthop.c
2973
refcount_set(&nh->refcnt, 1);
net/ipv4/nexthop.c
2974
nh->id = cfg->nh_id;
net/ipv4/nexthop.c
2975
nh->protocol = cfg->nh_protocol;
net/ipv4/nexthop.c
2976
nh->net = net;
net/ipv4/nexthop.c
2978
err = insert_nexthop(net, nh, cfg, extack);
net/ipv4/nexthop.c
2980
__remove_nexthop(net, nh, NULL);
net/ipv4/nexthop.c
2981
nexthop_put(nh);
net/ipv4/nexthop.c
2982
nh = ERR_PTR(err);
net/ipv4/nexthop.c
2985
return nh;
net/ipv4/nexthop.c
3257
struct nexthop *nh;
net/ipv4/nexthop.c
3282
nh = nexthop_add(net, &cfg, extack);
net/ipv4/nexthop.c
3283
if (IS_ERR(nh))
net/ipv4/nexthop.c
3284
err = PTR_ERR(nh);
net/ipv4/nexthop.c
3331
struct nexthop *nh;
net/ipv4/nexthop.c
3347
nh = nexthop_find_by_id(net, id);
net/ipv4/nexthop.c
3348
if (nh)
net/ipv4/nexthop.c
3349
remove_nexthop(net, nh, &nlinfo);
net/ipv4/nexthop.c
3365
struct nexthop *nh;
net/ipv4/nexthop.c
3386
nh = nexthop_find_by_id(net, id);
net/ipv4/nexthop.c
3387
if (!nh)
net/ipv4/nexthop.c
3390
err = nh_fill_node(skb, nh, RTM_NEWNEXTHOP, NETLINK_CB(in_skb).portid,
net/ipv4/nexthop.c
3415
static bool nh_dump_filtered(struct nexthop *nh,
net/ipv4/nexthop.c
3421
if (filter->group_filter && !nh->is_group)
net/ipv4/nexthop.c
3427
if (nh->is_group)
net/ipv4/nexthop.c
3430
nhi = rtnl_dereference(nh->nh_info);
net/ipv4/nexthop.c
3524
struct nexthop *nh, void *data),
net/ipv4/nexthop.c
3546
struct nexthop *nh;
net/ipv4/nexthop.c
3548
nh = rb_entry(tmp, struct nexthop, rb_node);
net/ipv4/nexthop.c
3549
if (nh->id < s_idx) {
net/ipv4/nexthop.c
3565
struct nexthop *nh;
net/ipv4/nexthop.c
3567
nh = rb_entry(node, struct nexthop, rb_node);
net/ipv4/nexthop.c
3569
ctx->idx = nh->id;
net/ipv4/nexthop.c
3570
err = nh_cb(skb, cb, nh, data);
net/ipv4/nexthop.c
3579
struct nexthop *nh, void *data)
net/ipv4/nexthop.c
3584
if (nh_dump_filtered(nh, filter, nhm->nh_family))
net/ipv4/nexthop.c
3587
return nh_fill_node(skb, nh, RTM_NEWNEXTHOP,
net/ipv4/nexthop.c
3618
struct nexthop *nh;
net/ipv4/nexthop.c
3620
nh = nexthop_find_by_id(net, id);
net/ipv4/nexthop.c
3621
if (!nh)
net/ipv4/nexthop.c
3624
if (!nh->is_group) {
net/ipv4/nexthop.c
3629
nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
3635
return nh;
net/ipv4/nexthop.c
3696
struct rtm_dump_nh_ctx nh;
net/ipv4/nexthop.c
3716
struct nexthop *nh,
net/ipv4/nexthop.c
3726
nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
3736
if (nh_dump_filtered(nhge->nh, &dd->filter, nhm->nh_family))
net/ipv4/nexthop.c
3740
dd->filter.res_bucket_nh_id != nhge->nh->id)
net/ipv4/nexthop.c
3744
err = nh_fill_res_bucket(skb, nh, bucket, bucket_index,
net/ipv4/nexthop.c
3759
struct nexthop *nh, void *data)
net/ipv4/nexthop.c
3764
if (!nh->is_group)
net/ipv4/nexthop.c
3767
nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
3771
return rtm_dump_nexthop_bucket_nh(skb, cb, nh, dd);
net/ipv4/nexthop.c
3781
struct nexthop *nh;
net/ipv4/nexthop.c
3789
nh = nexthop_find_group_resilient(net, dd.filter.nh_id,
net/ipv4/nexthop.c
3791
if (IS_ERR(nh))
net/ipv4/nexthop.c
3792
return PTR_ERR(nh);
net/ipv4/nexthop.c
3793
err = rtm_dump_nexthop_bucket_nh(skb, cb, nh, &dd);
net/ipv4/nexthop.c
3797
err = rtm_dump_walk_nexthops(skb, cb, root, &ctx->nh,
net/ipv4/nexthop.c
3865
struct nexthop *nh;
net/ipv4/nexthop.c
3874
nh = nexthop_find_group_resilient(net, id, extack);
net/ipv4/nexthop.c
3875
if (IS_ERR(nh))
net/ipv4/nexthop.c
3876
return PTR_ERR(nh);
net/ipv4/nexthop.c
3878
nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
3889
err = nh_fill_res_bucket(skb, nh, &res_table->nh_buckets[bucket_index],
net/ipv4/nexthop.c
3960
struct nexthop *nh;
net/ipv4/nexthop.c
3962
nh = rb_entry(node, struct nexthop, rb_node);
net/ipv4/nexthop.c
3963
err = call_nexthop_notifier(nb, net, event_type, nh, extack);
net/ipv4/nexthop.c
402
static int call_nexthop_res_table_notifiers(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
408
.id = nh->id,
net/ipv4/nexthop.c
422
nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
439
struct nexthop *nh,
net/ipv4/nexthop.c
448
err = nh_notifier_info_init(&info, nh);
net/ipv4/nexthop.c
453
nh_notifier_info_fini(&info, nh);
net/ipv4/nexthop.c
480
static void nexthop_free_group(struct nexthop *nh)
net/ipv4/nexthop.c
485
nhg = rcu_dereference_raw(nh->nh_grp);
net/ipv4/nexthop.c
491
nexthop_put(nhge->nh);
net/ipv4/nexthop.c
503
static void nexthop_free_single(struct nexthop *nh)
net/ipv4/nexthop.c
507
nhi = rcu_dereference_raw(nh->nh_info);
net/ipv4/nexthop.c
510
fib_nh_release(nh->net, &nhi->fib_nh);
net/ipv4/nexthop.c
521
struct nexthop *nh = container_of(head, struct nexthop, rcu);
net/ipv4/nexthop.c
523
if (nh->is_group)
net/ipv4/nexthop.c
524
nexthop_free_group(nh);
net/ipv4/nexthop.c
526
nexthop_free_single(nh);
net/ipv4/nexthop.c
528
kfree(nh);
net/ipv4/nexthop.c
534
struct nexthop *nh;
net/ipv4/nexthop.c
536
nh = kzalloc_obj(struct nexthop);
net/ipv4/nexthop.c
537
if (nh) {
net/ipv4/nexthop.c
538
INIT_LIST_HEAD(&nh->fi_list);
net/ipv4/nexthop.c
539
INIT_LIST_HEAD(&nh->f6i_list);
net/ipv4/nexthop.c
540
INIT_LIST_HEAD(&nh->grp_list);
net/ipv4/nexthop.c
541
INIT_LIST_HEAD(&nh->fdb_list);
net/ipv4/nexthop.c
542
spin_lock_init(&nh->lock);
net/ipv4/nexthop.c
544
return nh;
net/ipv4/nexthop.c
595
struct nexthop *nh;
net/ipv4/nexthop.c
602
nh = rb_entry(parent, struct nexthop, rb_node);
net/ipv4/nexthop.c
603
if (id < nh->id)
net/ipv4/nexthop.c
605
else if (id > nh->id)
net/ipv4/nexthop.c
608
return nh;
net/ipv4/nexthop.c
706
const struct nexthop *nh)
net/ipv4/nexthop.c
712
nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
714
info->id = nh->id;
net/ipv4/nexthop.c
725
info->nh_grp_hw_stats->stats[i].id = nhge->nh->id;
net/ipv4/nexthop.c
745
static void nh_grp_hw_stats_apply_update(struct nexthop *nh,
net/ipv4/nexthop.c
752
nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
761
static int nh_grp_hw_stats_update(struct nexthop *nh, bool *hw_stats_used)
net/ipv4/nexthop.c
764
.net = nh->net,
net/ipv4/nexthop.c
766
struct net *net = nh->net;
net/ipv4/nexthop.c
774
err = nh_notifier_grp_hw_stats_init(&info, nh);
net/ipv4/nexthop.c
785
nh_grp_hw_stats_apply_update(nh, &info);
net/ipv4/nexthop.c
805
if (nla_put_u32(skb, NHA_GROUP_STATS_ENTRY_ID, nhge->nh->id) ||
net/ipv4/nexthop.c
823
static int nla_put_nh_group_stats(struct sk_buff *skb, struct nexthop *nh,
net/ipv4/nexthop.c
826
struct nh_group *nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
837
err = nh_grp_hw_stats_update(nh, &hw_stats_used);
net/ipv4/nexthop.c
865
static int nla_put_nh_group(struct sk_buff *skb, struct nexthop *nh,
net/ipv4/nexthop.c
868
struct nh_group *nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
895
.id = nhg->nh_entries[i].nh->id,
net/ipv4/nexthop.c
906
nla_put_nh_group_stats(skb, nh, op_flags)))
net/ipv4/nexthop.c
915
static int nh_fill_node(struct sk_buff *skb, struct nexthop *nh,
net/ipv4/nexthop.c
931
nhm->nh_flags = nh->nh_flags;
net/ipv4/nexthop.c
932
nhm->nh_protocol = nh->protocol;
net/ipv4/nexthop.c
936
if (nla_put_u32(skb, NHA_ID, nh->id))
net/ipv4/nexthop.c
939
if (nh->is_group) {
net/ipv4/nexthop.c
940
struct nh_group *nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
945
if (nla_put_nh_group(skb, nh, op_flags, &resp_op_flags) ||
net/ipv4/nexthop.c
951
nhi = rtnl_dereference(nh->nh_info);
net/ipv4/route.c
1611
struct fib_nh *nh;
net/ipv4/route.c
1613
nh = container_of(nhc, struct fib_nh, nh_common);
net/ipv4/route.c
1614
rt->dst.tclassid = nh->nh_tclassid;
net/ipv6/addrconf.c
2513
if (rt->nh)
net/ipv6/addrconf.c
6676
struct fib6_nh *nh = ifa->rt->fib6_nh;
net/ipv6/addrconf.c
6681
if (nh->rt6i_pcpu) {
net/ipv6/addrconf.c
6685
rtp = per_cpu_ptr(nh->rt6i_pcpu, cpu);
net/ipv6/datagram.c
488
const unsigned char *nh = skb_network_header(skb);
net/ipv6/datagram.c
493
const struct ipv6hdr *ip6h = container_of((struct in6_addr *)(nh + serr->addr_offset),
net/ipv6/datagram.c
502
ipv6_addr_set_v4mapped(*(__be32 *)(nh + serr->addr_offset),
net/ipv6/datagram.c
626
unsigned char *nh = skb_network_header(skb);
net/ipv6/datagram.c
639
__be32 flowinfo = ip6_flowinfo((struct ipv6hdr *)nh);
net/ipv6/datagram.c
646
u8 *ptr = nh + sizeof(struct ipv6hdr);
net/ipv6/datagram.c
666
u8 *ptr = nh + off;
net/ipv6/datagram.c
708
u8 *ptr = nh + sizeof(struct ipv6hdr);
net/ipv6/datagram.c
712
u8 *ptr = nh + opt->dst0;
net/ipv6/datagram.c
716
struct ipv6_rt_hdr *rthdr = (struct ipv6_rt_hdr *)(nh + opt->srcrt);
net/ipv6/datagram.c
720
u8 *ptr = nh + opt->dst1;
net/ipv6/exthdrs.c
1023
const unsigned char *nh = skb_network_header(skb);
net/ipv6/exthdrs.c
1025
if (nh[optoff + 1] < 8)
net/ipv6/exthdrs.c
1028
if (nh[optoff + 6] * 4 + 8 > nh[optoff + 1])
net/ipv6/exthdrs.c
1031
if (!calipso_validate(skb, nh + optoff))
net/ipv6/exthdrs.c
119
const unsigned char *nh = skb_network_header(skb);
net/ipv6/exthdrs.c
136
if (nh[off] == IPV6_TLV_PAD1) {
net/ipv6/exthdrs.c
146
optlen = nh[off + 1] + 2;
net/ipv6/exthdrs.c
150
if (nh[off] == IPV6_TLV_PADN) {
net/ipv6/exthdrs.c
164
if (nh[off + i] != 0)
net/ipv6/exthdrs.c
173
switch (nh[off]) {
net/ipv6/exthdrs.c
182
nh = skb_network_header(skb);
net/ipv6/exthdrs.c
199
switch (nh[off]) {
net/ipv6/exthdrs.c
893
const unsigned char *nh = skb_network_header(skb);
net/ipv6/exthdrs.c
895
if (nh[optoff + 1] == 2) {
net/ipv6/exthdrs.c
897
memcpy(&IP6CB(skb)->ra, nh + optoff + 2, sizeof(IP6CB(skb)->ra));
net/ipv6/exthdrs.c
901
nh[optoff + 1]);
net/ipv6/exthdrs.c
980
const unsigned char *nh = skb_network_header(skb);
net/ipv6/exthdrs.c
984
if (nh[optoff + 1] != 4 || (optoff & 3) != 2) {
net/ipv6/exthdrs.c
986
nh[optoff+1]);
net/ipv6/exthdrs.c
991
pkt_len = ntohl(*(__be32 *)(nh + optoff + 2));
net/ipv6/exthdrs_core.c
118
const unsigned char *nh = skb_network_header(skb);
net/ipv6/exthdrs_core.c
125
hdr = (struct ipv6_opt_hdr *)(nh + offset);
net/ipv6/exthdrs_core.c
135
int opttype = nh[offset];
net/ipv6/exthdrs_core.c
148
optlen = nh[offset + 1] + 2;
net/ipv6/fib6_rules.c
193
res->nh->fib_nh_dev);
net/ipv6/icmp.c
1113
int nh;
net/ipv6/icmp.c
1124
nh = skb_network_offset(skb);
net/ipv6/icmp.c
1133
skb_set_network_header(skb, nh);
net/ipv6/ip6_fib.c
1011
static int fib6_nh_drop_pcpu_from(struct fib6_nh *nh, void *_arg)
net/ipv6/ip6_fib.c
1015
__fib6_drop_pcpu_from(nh, arg);
net/ipv6/ip6_fib.c
1027
if (f6i->nh) {
net/ipv6/ip6_fib.c
1029
nexthop_for_each_fib6_nh(f6i->nh, fib6_nh_drop_pcpu_from, f6i);
net/ipv6/ip6_fib.c
1048
if (rt->nh) {
net/ipv6/ip6_fib.c
1049
spin_lock(&rt->nh->lock);
net/ipv6/ip6_fib.c
1054
spin_unlock(&rt->nh->lock);
net/ipv6/ip6_fib.c
1150
(iter->nh || !iter->fib6_nh->fib_nh_gw_family)) {
net/ipv6/ip6_fib.c
1365
spin_lock(&rt->nh->lock);
net/ipv6/ip6_fib.c
1367
if (rt->nh->dead) {
net/ipv6/ip6_fib.c
1373
list_add(&rt->nh_list, &rt->nh->f6i_list);
net/ipv6/ip6_fib.c
1376
spin_unlock(&rt->nh->lock);
net/ipv6/ip6_fib.c
1538
if (rt->nh)
net/ipv6/ip6_fib.c
174
if (f6i->nh)
net/ipv6/ip6_fib.c
175
nexthop_put(f6i->nh);
net/ipv6/ip6_fib.c
2616
if (rt->nh)
net/ipv6/ip6_fib.c
2617
fib6_nh = nexthop_fib6_nh(rt->nh);
net/ipv6/ip6_tunnel.c
807
int nh, err;
net/ipv6/ip6_tunnel.c
848
nh = skb_network_header(skb) - skb->head;
net/ipv6/ip6_tunnel.c
859
ipv6h = (struct ipv6hdr *)(skb->head + nh);
net/ipv6/netfilter/nf_conntrack_reasm.c
199
const unsigned char *nh = skb_network_header(skb);
net/ipv6/netfilter/nf_conntrack_reasm.c
201
csum_partial(nh, (u8 *)(fhdr + 1) - nh,
net/ipv6/reassembly.c
141
const unsigned char *nh = skb_network_header(skb);
net/ipv6/reassembly.c
143
csum_partial(nh, (u8 *)(fhdr + 1) - nh,
net/ipv6/route.c
1057
struct net_device *dev = res->nh->fib_nh_dev;
net/ipv6/route.c
107
static int rt6_score_route(const struct fib6_nh *nh, u32 fib6_flags, int oif,
net/ipv6/route.c
1153
if (res->nh->fib_nh_lws) {
net/ipv6/route.c
1154
rt->dst.lwtstate = lwtstate_get(res->nh->fib_nh_lws);
net/ipv6/route.c
1172
const struct fib6_nh *nh = res->nh;
net/ipv6/route.c
1173
const struct net_device *dev = nh->fib_nh_dev;
net/ipv6/route.c
1181
if (nh->fib_nh_gw_family) {
net/ipv6/route.c
1182
rt->rt6i_gateway = nh->fib_nh_gw6;
net/ipv6/route.c
1228
struct net_device *dev = res->nh->fib_nh_dev;
net/ipv6/route.c
1428
if (f6i->nh)
net/ipv6/route.c
1444
pcpu_rt = this_cpu_read(*res->nh->rt6i_pcpu);
net/ipv6/route.c
1449
p = this_cpu_ptr(res->nh->rt6i_pcpu);
net/ipv6/route.c
1472
p = this_cpu_ptr(res->nh->rt6i_pcpu);
net/ipv6/route.c
1637
const struct fib6_nh *nh = res->nh;
net/ipv6/route.c
1643
struct net_device *dev = nh->fib_nh_dev;
net/ipv6/route.c
1654
return mtu - lwtunnel_headroom(nh->fib_nh_lws, mtu);
net/ipv6/route.c
1665
struct rt6_exception_bucket *fib6_nh_get_excptn_bucket(const struct fib6_nh *nh,
net/ipv6/route.c
1671
bucket = rcu_dereference_protected(nh->rt6i_exception_bucket,
net/ipv6/route.c
1674
bucket = rcu_dereference(nh->rt6i_exception_bucket);
net/ipv6/route.c
1695
static void fib6_nh_excptn_bucket_set_flushed(struct fib6_nh *nh,
net/ipv6/route.c
1701
bucket = rcu_dereference_protected(nh->rt6i_exception_bucket,
net/ipv6/route.c
1707
rcu_assign_pointer(nh->rt6i_exception_bucket, bucket);
net/ipv6/route.c
1718
struct fib6_nh *nh = res->nh;
net/ipv6/route.c
1724
bucket = rcu_dereference_protected(nh->rt6i_exception_bucket,
net/ipv6/route.c
1733
rcu_assign_pointer(nh->rt6i_exception_bucket, bucket);
net/ipv6/route.c
1794
static void fib6_nh_flush_exceptions(struct fib6_nh *nh, struct fib6_info *from)
net/ipv6/route.c
1803
bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
net/ipv6/route.c
1809
fib6_nh_excptn_bucket_set_flushed(nh, &rt6_exception_lock);
net/ipv6/route.c
1824
static int rt6_nh_flush_exceptions(struct fib6_nh *nh, void *arg)
net/ipv6/route.c
1828
fib6_nh_flush_exceptions(nh, f6i);
net/ipv6/route.c
1835
if (f6i->nh) {
net/ipv6/route.c
1837
nexthop_for_each_fib6_nh(f6i->nh, rt6_nh_flush_exceptions, f6i);
net/ipv6/route.c
1872
bucket = fib6_nh_get_excptn_bucket(res->nh, NULL);
net/ipv6/route.c
1890
static int fib6_nh_remove_exception(const struct fib6_nh *nh, int plen,
net/ipv6/route.c
1898
if (!rcu_access_pointer(nh->rt6i_exception_bucket))
net/ipv6/route.c
1902
bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
net/ipv6/route.c
1933
static int rt6_nh_remove_exception_rt(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
1938
err = fib6_nh_remove_exception(nh, arg->plen, arg->rt);
net/ipv6/route.c
1953
if (from->nh) {
net/ipv6/route.c
1961
rc = nexthop_for_each_fib6_nh(from->nh,
net/ipv6/route.c
1974
static void fib6_nh_update_exception(const struct fib6_nh *nh, int plen,
net/ipv6/route.c
1981
bucket = fib6_nh_get_excptn_bucket(nh, NULL);
net/ipv6/route.c
2004
static int fib6_nh_find_match(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
2008
if (arg->dev != nh->fib_nh_dev ||
net/ipv6/route.c
2009
(arg->gw && !nh->fib_nh_gw_family) ||
net/ipv6/route.c
2010
(!arg->gw && nh->fib_nh_gw_family) ||
net/ipv6/route.c
2011
(arg->gw && !ipv6_addr_equal(arg->gw, &nh->fib_nh_gw6)))
net/ipv6/route.c
2014
arg->match = nh;
net/ipv6/route.c
2031
if (from->nh) {
net/ipv6/route.c
2037
nexthop_for_each_fib6_nh(from->nh, fib6_nh_find_match, &arg);
net/ipv6/route.c
2075
const struct fib6_nh *nh, int mtu)
net/ipv6/route.c
2081
bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
net/ipv6/route.c
2103
static void fib6_nh_exceptions_clean_tohost(const struct fib6_nh *nh,
net/ipv6/route.c
2111
if (!rcu_access_pointer(nh->rt6i_exception_bucket))
net/ipv6/route.c
2115
bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
net/ipv6/route.c
2178
static void fib6_nh_age_exceptions(const struct fib6_nh *nh,
net/ipv6/route.c
2187
if (!rcu_access_pointer(nh->rt6i_exception_bucket))
net/ipv6/route.c
2192
bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
net/ipv6/route.c
2212
static int rt6_nh_age_exceptions(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
2216
fib6_nh_age_exceptions(nh, arg->gc_args, arg->now);
net/ipv6/route.c
2224
if (f6i->nh) {
net/ipv6/route.c
2230
nexthop_for_each_fib6_nh(f6i->nh, rt6_nh_age_exceptions,
net/ipv6/route.c
2294
!res.nh->fib_nh_gw_family)) {
net/ipv6/route.c
2958
if (res.f6i->nh) {
net/ipv6/route.c
2964
nexthop_for_each_fib6_nh(res.f6i->nh,
net/ipv6/route.c
2973
res.nh = arg.match;
net/ipv6/route.c
2975
res.nh = res.f6i->fib6_nh;
net/ipv6/route.c
3062
const struct fib6_nh *nh = res->nh;
net/ipv6/route.c
3064
if (nh->fib_nh_flags & RTNH_F_DEAD || !nh->fib_nh_gw_family ||
net/ipv6/route.c
3065
fl6->flowi6_oif != nh->fib_nh_dev->ifindex)
net/ipv6/route.c
3073
if (!ipv6_addr_equal(gw, &nh->fib_nh_gw6)) {
net/ipv6/route.c
3094
static int fib6_nh_redirect_match(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
3098
arg->res->nh = nh;
net/ipv6/route.c
3145
if (unlikely(rt->nh)) {
net/ipv6/route.c
3146
if (nexthop_is_blackhole(rt->nh))
net/ipv6/route.c
3149
if (nexthop_for_each_fib6_nh(rt->nh,
net/ipv6/route.c
3154
res.nh = rt->fib6_nh;
net/ipv6/route.c
3175
res.nh = rt->fib6_nh;
net/ipv6/route.c
3296
const struct fib6_nh *nh = res->nh;
net/ipv6/route.c
3312
struct net_device *dev = nh->fib_nh_dev;
net/ipv6/route.c
3322
return mtu - lwtunnel_headroom(nh->fib_nh_lws, mtu);
net/ipv6/route.c
3452
res.nh->fib_nh_gw_family ||
net/ipv6/route.c
3453
(dev && dev != res.nh->fib_nh_dev))
net/ipv6/route.c
3465
res.nh->fib_nh_gw_family)
net/ipv6/route.c
3477
if (dev != res.nh->fib_nh_dev)
net/ipv6/route.c
3480
*_dev = dev = res.nh->fib_nh_dev;
net/ipv6/route.c
3871
struct nexthop *nh;
net/ipv6/route.c
3875
nh = nexthop_find_by_id(net, cfg->fc_nh_id);
net/ipv6/route.c
3876
if (!nh) {
net/ipv6/route.c
3882
err = fib6_check_nexthop(nh, cfg, extack);
net/ipv6/route.c
3886
if (!nexthop_get(nh)) {
net/ipv6/route.c
3892
rt->nh = nh;
net/ipv6/route.c
3893
fib6_nh = nexthop_fib6_nh(rt->nh);
net/ipv6/route.c
4088
struct fib6_nh *nh)
net/ipv6/route.c
4092
.nh = nh,
net/ipv6/route.c
4108
static int fib6_nh_del_cached_rt(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
4113
rc = ip6_del_cached_rt(arg->cfg, arg->f6i, nh);
net/ipv6/route.c
4124
return nexthop_for_each_fib6_nh(f6i->nh, fib6_nh_del_cached_rt, &arg);
net/ipv6/route.c
4150
struct fib6_nh *nh;
net/ipv6/route.c
4152
if (rt->nh && cfg->fc_nh_id &&
net/ipv6/route.c
4153
rt->nh->id != cfg->fc_nh_id)
net/ipv6/route.c
4159
if (rt->nh) {
net/ipv6/route.c
4164
nh = rt->fib6_nh;
net/ipv6/route.c
4165
rc = ip6_del_cached_rt(cfg, rt, nh);
net/ipv6/route.c
4180
if (rt->nh) {
net/ipv6/route.c
4190
nh = rt->fib6_nh;
net/ipv6/route.c
4192
(!nh->fib_nh_dev ||
net/ipv6/route.c
4193
nh->fib_nh_dev->ifindex != cfg->fc_ifindex))
net/ipv6/route.c
4196
!ipv6_addr_equal(&cfg->fc_gateway, &nh->fib_nh_gw6))
net/ipv6/route.c
4309
if (res.f6i->nh) {
net/ipv6/route.c
4315
nexthop_for_each_fib6_nh(res.f6i->nh,
net/ipv6/route.c
4323
res.nh = arg.match;
net/ipv6/route.c
4325
res.nh = res.f6i->fib6_nh;
net/ipv6/route.c
4380
if (rt->nh)
net/ipv6/route.c
4445
struct fib6_nh *nh;
net/ipv6/route.c
4448
if (rt->nh)
net/ipv6/route.c
4451
nh = rt->fib6_nh;
net/ipv6/route.c
4452
if (dev == nh->fib_nh_dev &&
net/ipv6/route.c
4454
ipv6_addr_equal(&nh->fib_nh_gw6, addr))
net/ipv6/route.c
446
if (!match->nh && (!match->fib6_nsiblings || have_oif_match))
net/ipv6/route.c
449
if (match->nh && have_oif_match && res->nh)
net/ipv6/route.c
459
(!match->nh || nexthop_is_multipath(match->nh)))
net/ipv6/route.c
462
if (unlikely(match->nh)) {
net/ipv6/route.c
4716
if (!rt->nh &&
net/ipv6/route.c
4744
struct fib6_nh *nh;
net/ipv6/route.c
4747
if (rt->nh)
net/ipv6/route.c
4750
nh = rt->fib6_nh;
net/ipv6/route.c
4752
nh->fib_nh_gw_family && ipv6_addr_equal(gateway, &nh->fib_nh_gw6))
net/ipv6/route.c
4759
fib6_nh_exceptions_clean_tohost(nh, gateway);
net/ipv6/route.c
481
const struct fib6_nh *nh = sibling->fib6_nh;
net/ipv6/route.c
484
nh_upper_bound = atomic_read(&nh->fib_nh_upper_bound);
net/ipv6/route.c
487
if (rt6_score_route(nh, sibling->fib6_flags, oif, strict) < 0)
net/ipv6/route.c
4876
if (rt != net->ipv6.fib6_null_entry && !rt->nh &&
net/ipv6/route.c
495
res->nh = match->fib6_nh;
net/ipv6/route.c
4962
if (rt == net->ipv6.fib6_null_entry || rt->nh)
net/ipv6/route.c
502
static bool __rt6_device_match(struct net *net, const struct fib6_nh *nh,
net/ipv6/route.c
5028
static int fib6_nh_mtu_change(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
5038
if (nh->fib_nh_dev == arg->dev) {
net/ipv6/route.c
5047
rt6_exceptions_update_pmtu(idev, nh, arg->mtu);
net/ipv6/route.c
507
if (nh->fib_nh_flags & RTNH_F_DEAD)
net/ipv6/route.c
5073
if (f6i->nh) {
net/ipv6/route.c
5075
return nexthop_for_each_fib6_nh(f6i->nh, fib6_nh_mtu_change,
net/ipv6/route.c
510
dev = nh->fib_nh_dev;
net/ipv6/route.c
528
struct fib6_nh *nh;
net/ipv6/route.c
531
static int __rt6_nh_dev_match(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
5325
struct rt6_nh *nh;
net/ipv6/route.c
5327
list_for_each_entry(nh, rt6_nh_list, list) {
net/ipv6/route.c
5329
if (rt6_duplicate_nexthop(nh->fib6_info, rt))
net/ipv6/route.c
5333
nh = kzalloc_obj(*nh);
net/ipv6/route.c
5334
if (!nh)
net/ipv6/route.c
5337
nh->fib6_info = rt;
net/ipv6/route.c
5338
memcpy(&nh->r_cfg, r_cfg, sizeof(*r_cfg));
net/ipv6/route.c
5339
list_add_tail(&nh->list, rt6_nh_list);
net/ipv6/route.c
535
arg->nh = nh;
net/ipv6/route.c
536
return __rt6_device_match(arg->net, nh, arg->saddr, arg->oif,
net/ipv6/route.c
5401
struct rt6_nh *nh, *nh_safe;
net/ipv6/route.c
541
static struct fib6_nh *rt6_nh_dev_match(struct net *net, struct nexthop *nh,
net/ipv6/route.c
5489
list_for_each_entry(nh, &rt6_nh_list, list) {
net/ipv6/route.c
5490
err = __ip6_ins_rt(nh->fib6_info, info, extack);
net/ipv6/route.c
5496
err_nh = nh;
net/ipv6/route.c
5500
rt_last = nh->fib6_info;
net/ipv6/route.c
5504
rt_notif = nh->fib6_info;
net/ipv6/route.c
553
if (nexthop_is_blackhole(nh))
net/ipv6/route.c
5557
list_for_each_entry(nh, &rt6_nh_list, list) {
net/ipv6/route.c
5558
if (err_nh == nh)
net/ipv6/route.c
556
if (nexthop_for_each_fib6_nh(nh, __rt6_nh_dev_match, &arg))
net/ipv6/route.c
5560
ip6_route_del(&nh->r_cfg, extack);
net/ipv6/route.c
5564
list_for_each_entry_safe(nh, nh_safe, &rt6_nh_list, list) {
net/ipv6/route.c
5565
fib6_info_release(nh->fib6_info);
net/ipv6/route.c
5566
list_del(&nh->list);
net/ipv6/route.c
5567
kfree(nh);
net/ipv6/route.c
557
return arg.nh;
net/ipv6/route.c
5662
static int rt6_nh_nlmsg_size(struct fib6_nh *nh, void *arg)
net/ipv6/route.c
567
struct fib6_nh *nh;
net/ipv6/route.c
5670
if (nh->fib_nh_lws) {
net/ipv6/route.c
5672
*nexthop_len += lwtunnel_get_encap_size(nh->fib_nh_lws);
net/ipv6/route.c
5683
struct fib6_nh *nh;
net/ipv6/route.c
5686
if (f6i->nh) {
net/ipv6/route.c
5688
nexthop_for_each_fib6_nh(f6i->nh, rt6_nh_nlmsg_size,
net/ipv6/route.c
5695
nh = f6i->fib6_nh;
net/ipv6/route.c
5698
rt6_nh_nlmsg_size(nh, &nexthop_len);
net/ipv6/route.c
570
if (unlikely(f6i->nh)) {
net/ipv6/route.c
5708
nexthop_len += lwtunnel_get_encap_size(nh->fib_nh_lws);
net/ipv6/route.c
571
nh = nexthop_fib6_nh(f6i->nh);
net/ipv6/route.c
572
if (nexthop_is_blackhole(f6i->nh))
net/ipv6/route.c
5726
static int rt6_fill_node_nexthop(struct sk_buff *skb, struct nexthop *nh,
net/ipv6/route.c
5729
if (nexthop_is_multipath(nh)) {
net/ipv6/route.c
5736
if (nexthop_mpath_fill_node(skb, nh, AF_INET6))
net/ipv6/route.c
5743
fib6_nh = nexthop_fib6_nh(nh);
net/ipv6/route.c
575
nh = f6i->fib6_nh;
net/ipv6/route.c
577
if (!(nh->fib_nh_flags & RTNH_F_DEAD))
net/ipv6/route.c
584
if (unlikely(spf6i->nh)) {
net/ipv6/route.c
585
nh = rt6_nh_dev_match(net, spf6i->nh, res, saddr,
net/ipv6/route.c
587
if (nh)
net/ipv6/route.c
5899
} else if (rt->nh) {
net/ipv6/route.c
590
nh = spf6i->fib6_nh;
net/ipv6/route.c
5900
if (nla_put_u32(skb, RTA_NH_ID, rt->nh->id))
net/ipv6/route.c
5903
if (nexthop_is_blackhole(rt->nh))
net/ipv6/route.c
5907
rt6_fill_node_nexthop(skb, rt->nh, &nh_flags) < 0)
net/ipv6/route.c
591
if (__rt6_device_match(net, nh, saddr, oif, flags))
net/ipv6/route.c
5948
static int fib6_info_nh_uses_dev(struct fib6_nh *nh, void *arg)
net/ipv6/route.c
5952
if (nh->fib_nh_dev == dev)
net/ipv6/route.c
5961
if (f6i->nh) {
net/ipv6/route.c
5964
return !!nexthop_for_each_fib6_nh(f6i->nh,
net/ipv6/route.c
5998
static int rt6_nh_dump_exceptions(struct fib6_nh *nh, void *arg)
net/ipv6/route.c
6006
bucket = fib6_nh_get_excptn_bucket(nh, NULL);
net/ipv6/route.c
602
nh = res->f6i->fib6_nh;
net/ipv6/route.c
606
if (unlikely(f6i->nh)) {
net/ipv6/route.c
607
nh = nexthop_fib6_nh(f6i->nh);
net/ipv6/route.c
608
if (nexthop_is_blackhole(f6i->nh))
net/ipv6/route.c
6101
if (rt->nh) {
net/ipv6/route.c
6102
err = nexthop_for_each_fib6_nh(rt->nh,
net/ipv6/route.c
611
nh = f6i->fib6_nh;
net/ipv6/route.c
614
if (nh->fib_nh_flags & RTNH_F_DEAD) {
net/ipv6/route.c
616
nh = res->f6i->fib6_nh;
net/ipv6/route.c
619
res->nh = nh;
net/ipv6/route.c
627
res->nh = nh;
net/ipv6/route.c
748
static int rt6_score_route(const struct fib6_nh *nh, u32 fib6_flags, int oif,
net/ipv6/route.c
753
if (!oif || nh->fib_nh_dev->ifindex == oif)
net/ipv6/route.c
762
!(fib6_flags & RTF_NONEXTHOP) && nh->fib_nh_gw_family) {
net/ipv6/route.c
763
int n = rt6_check_neigh(nh);
net/ipv6/route.c
770
static bool find_match(struct fib6_nh *nh, u32 fib6_flags,
net/ipv6/route.c
777
if (nh->fib_nh_flags & RTNH_F_DEAD)
net/ipv6/route.c
780
if (ip6_ignore_linkdown(nh->fib_nh_dev) &&
net/ipv6/route.c
781
nh->fib_nh_flags & RTNH_F_LINKDOWN &&
net/ipv6/route.c
785
m = rt6_score_route(nh, fib6_flags, oif, strict);
net/ipv6/route.c
794
rt6_probe(nh);
net/ipv6/route.c
812
struct fib6_nh *nh;
net/ipv6/route.c
815
static int rt6_nh_find_match(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
819
arg->nh = nh;
net/ipv6/route.c
820
return find_match(nh, arg->flags, arg->oif, arg->strict,
net/ipv6/route.c
835
struct fib6_nh *nh;
net/ipv6/route.c
845
if (unlikely(f6i->nh)) {
net/ipv6/route.c
854
if (nexthop_is_blackhole(f6i->nh)) {
net/ipv6/route.c
858
res->nh = nexthop_fib6_nh(f6i->nh);
net/ipv6/route.c
861
if (nexthop_for_each_fib6_nh(f6i->nh, rt6_nh_find_match,
net/ipv6/route.c
864
nh = arg.nh;
net/ipv6/route.c
867
nh = f6i->fib6_nh;
net/ipv6/route.c
868
if (find_match(nh, f6i->fib6_flags, oif, strict,
net/ipv6/route.c
874
res->nh = nh;
net/ipv6/route.c
953
res->nh = res->f6i->fib6_nh;
net/ipv6/route.c
962
res->nh->fib_nh_gw_family;
net/mpls/af_mpls.c
119
static u8 *__mpls_nh_via(struct mpls_route *rt, struct mpls_nh *nh)
net/mpls/af_mpls.c
121
return (u8 *)nh + rt->rt_via_offset;
net/mpls/af_mpls.c
125
const struct mpls_nh *nh)
net/mpls/af_mpls.c
127
return __mpls_nh_via((struct mpls_route *)rt, (struct mpls_nh *)nh);
net/mpls/af_mpls.c
130
static unsigned int mpls_nh_header_size(const struct mpls_nh *nh)
net/mpls/af_mpls.c
133
return nh->nh_labels * sizeof(struct mpls_shim_hdr);
net/mpls/af_mpls.c
1546
if (!nh->nh_dev || nh->nh_dev == dev)
net/mpls/af_mpls.c
1548
if (nh->nh_dev == dev)
net/mpls/af_mpls.c
1570
unsigned int nh_flags = nh->nh_flags;
net/mpls/af_mpls.c
1572
if (nh->nh_dev != dev) {
net/mpls/af_mpls.c
1574
netdev_hold(nh->nh_dev, &nh->nh_dev_tracker,
net/mpls/af_mpls.c
1589
nh->nh_dev = NULL;
net/mpls/af_mpls.c
1591
if (nh->nh_flags != nh_flags)
net/mpls/af_mpls.c
1592
WRITE_ONCE(nh->nh_flags, nh_flags);
net/mpls/af_mpls.c
1622
unsigned int nh_flags = nh->nh_flags;
net/mpls/af_mpls.c
1628
if (nh->nh_dev != dev)
net/mpls/af_mpls.c
1632
WRITE_ONCE(nh->nh_flags, nh_flags);
net/mpls/af_mpls.c
2072
const struct mpls_nh *nh = rt->rt_nh;
net/mpls/af_mpls.c
2074
if (nh->nh_labels &&
net/mpls/af_mpls.c
2075
nla_put_labels(skb, RTA_NEWDST, nh->nh_labels,
net/mpls/af_mpls.c
2076
nh->nh_label))
net/mpls/af_mpls.c
2078
if (nh->nh_via_table != MPLS_NEIGH_TABLE_UNSPEC &&
net/mpls/af_mpls.c
2079
nla_put_via(skb, nh->nh_via_table, mpls_nh_via(rt, nh),
net/mpls/af_mpls.c
2080
nh->nh_via_alen))
net/mpls/af_mpls.c
2082
dev = nh->nh_dev;
net/mpls/af_mpls.c
2085
if (nh->nh_flags & RTNH_F_LINKDOWN)
net/mpls/af_mpls.c
2087
if (nh->nh_flags & RTNH_F_DEAD)
net/mpls/af_mpls.c
2100
dev = nh->nh_dev;
net/mpls/af_mpls.c
2109
if (nh->nh_flags & RTNH_F_LINKDOWN) {
net/mpls/af_mpls.c
2113
if (nh->nh_flags & RTNH_F_DEAD) {
net/mpls/af_mpls.c
2118
if (nh->nh_labels && nla_put_labels(skb, RTA_NEWDST,
net/mpls/af_mpls.c
2119
nh->nh_labels,
net/mpls/af_mpls.c
2120
nh->nh_label))
net/mpls/af_mpls.c
2122
if (nh->nh_via_table != MPLS_NEIGH_TABLE_UNSPEC &&
net/mpls/af_mpls.c
2123
nla_put_via(skb, nh->nh_via_table,
net/mpls/af_mpls.c
2124
mpls_nh_via(rt, nh),
net/mpls/af_mpls.c
2125
nh->nh_via_alen))
net/mpls/af_mpls.c
2212
struct mpls_nh *nh = rt->rt_nh;
net/mpls/af_mpls.c
2214
if (nh->nh_dev == dev)
net/mpls/af_mpls.c
2218
if (nh->nh_dev == dev)
net/mpls/af_mpls.c
2299
struct mpls_nh *nh = rt->rt_nh;
net/mpls/af_mpls.c
2301
if (nh->nh_dev)
net/mpls/af_mpls.c
2303
if (nh->nh_via_table != MPLS_NEIGH_TABLE_UNSPEC) /* RTA_VIA */
net/mpls/af_mpls.c
2304
payload += nla_total_size(2 + nh->nh_via_alen);
net/mpls/af_mpls.c
2305
if (nh->nh_labels) /* RTA_NEWDST */
net/mpls/af_mpls.c
2306
payload += nla_total_size(nh->nh_labels * 4);
net/mpls/af_mpls.c
2312
if (!nh->nh_dev)
net/mpls/af_mpls.c
2316
if (nh->nh_via_table != MPLS_NEIGH_TABLE_UNSPEC)
net/mpls/af_mpls.c
2317
nhsize += nla_total_size(2 + nh->nh_via_alen);
net/mpls/af_mpls.c
2318
if (nh->nh_labels)
net/mpls/af_mpls.c
2319
nhsize += nla_total_size(nh->nh_labels * 4);
net/mpls/af_mpls.c
2423
const struct mpls_nh *nh;
net/mpls/af_mpls.c
2521
nh = mpls_select_multipath(rt, skb);
net/mpls/af_mpls.c
2522
if (!nh) {
net/mpls/af_mpls.c
2552
if (nh->nh_labels &&
net/mpls/af_mpls.c
2553
nla_put_labels(skb, RTA_NEWDST, nh->nh_labels,
net/mpls/af_mpls.c
2554
nh->nh_label))
net/mpls/af_mpls.c
2557
if (nh->nh_via_table != MPLS_NEIGH_TABLE_UNSPEC &&
net/mpls/af_mpls.c
2558
nla_put_via(skb, nh->nh_via_table, mpls_nh_via(rt, nh),
net/mpls/af_mpls.c
2559
nh->nh_via_alen))
net/mpls/af_mpls.c
2561
dev = nh->nh_dev;
net/mpls/af_mpls.c
281
unsigned int nh_flags = READ_ONCE(nh->nh_flags);
net/mpls/af_mpls.c
286
return nh;
net/mpls/af_mpls.c
371
const struct mpls_nh *nh;
net/mpls/af_mpls.c
417
nh = mpls_select_multipath(rt, skb);
net/mpls/af_mpls.c
418
if (!nh)
net/mpls/af_mpls.c
437
out_dev = nh->nh_dev;
net/mpls/af_mpls.c
442
new_header_size = mpls_nh_header_size(nh);
net/mpls/af_mpls.c
471
for (i = nh->nh_labels - 1; i >= 0; i--) {
net/mpls/af_mpls.c
472
hdr[i] = mpls_entry_encode(nh->nh_label[i],
net/mpls/af_mpls.c
481
if (nh->nh_via_table == MPLS_NEIGH_TABLE_UNSPEC)
net/mpls/af_mpls.c
485
err = neigh_xmit(nh->nh_via_table, out_dev,
net/mpls/af_mpls.c
486
mpls_nh_via(rt, nh), skb);
net/mpls/af_mpls.c
564
netdev_put(nh->nh_dev, &nh->nh_dev_tracker);
net/mpls/af_mpls.c
623
struct mpls_nh *nh,
net/mpls/af_mpls.c
636
netdev_hold(dev, &nh->nh_dev_tracker, GFP_KERNEL);
net/mpls/af_mpls.c
643
struct mpls_nh *nh,
net/mpls/af_mpls.c
652
struct mpls_nh *nh,
net/mpls/af_mpls.c
669
netdev_hold(dev, &nh->nh_dev_tracker, GFP_KERNEL);
net/mpls/af_mpls.c
676
struct mpls_nh *nh,
net/mpls/af_mpls.c
685
struct mpls_nh *nh, int oif)
net/mpls/af_mpls.c
690
switch (nh->nh_via_table) {
net/mpls/af_mpls.c
692
dev = inet_fib_lookup_dev(net, nh, mpls_nh_via(rt, nh));
net/mpls/af_mpls.c
695
dev = inet6_fib_lookup_dev(net, nh, mpls_nh_via(rt, nh));
net/mpls/af_mpls.c
702
&nh->nh_dev_tracker, GFP_KERNEL);
net/mpls/af_mpls.c
711
nh->nh_dev = dev;
net/mpls/af_mpls.c
717
struct mpls_nh *nh, int oif)
net/mpls/af_mpls.c
722
dev = find_outdev(net, rt, nh, oif);
net/mpls/af_mpls.c
733
if ((nh->nh_via_table == NEIGH_LINK_TABLE) &&
net/mpls/af_mpls.c
734
(dev->addr_len != nh->nh_via_alen))
net/mpls/af_mpls.c
738
nh->nh_flags |= RTNH_F_DEAD;
net/mpls/af_mpls.c
744
nh->nh_flags |= RTNH_F_LINKDOWN;
net/mpls/af_mpls.c
750
netdev_put(nh->nh_dev, &nh->nh_dev_tracker);
net/mpls/af_mpls.c
751
nh->nh_dev = NULL;
net/mpls/af_mpls.c
808
struct mpls_nh *nh = rt->rt_nh;
net/mpls/af_mpls.c
812
if (!nh)
net/mpls/af_mpls.c
815
nh->nh_labels = cfg->rc_output_labels;
net/mpls/af_mpls.c
816
for (i = 0; i < nh->nh_labels; i++)
net/mpls/af_mpls.c
817
nh->nh_label[i] = cfg->rc_output_label[i];
net/mpls/af_mpls.c
819
nh->nh_via_table = cfg->rc_via_table;
net/mpls/af_mpls.c
820
memcpy(__mpls_nh_via(rt, nh), cfg->rc_via, cfg->rc_via_alen);
net/mpls/af_mpls.c
821
nh->nh_via_alen = cfg->rc_via_alen;
net/mpls/af_mpls.c
823
err = mpls_nh_assign_dev(net, rt, nh, cfg->rc_ifindex);
net/mpls/af_mpls.c
827
if (nh->nh_flags & (RTNH_F_DEAD | RTNH_F_LINKDOWN))
net/mpls/af_mpls.c
837
struct mpls_nh *nh, int oif, struct nlattr *via,
net/mpls/af_mpls.c
843
if (!nh)
net/mpls/af_mpls.c
847
err = nla_get_labels(newdst, max_labels, &nh->nh_labels,
net/mpls/af_mpls.c
848
nh->nh_label, extack);
net/mpls/af_mpls.c
854
err = nla_get_via(via, &nh->nh_via_alen, &nh->nh_via_table,
net/mpls/af_mpls.c
855
__mpls_nh_via(rt, nh), extack);
net/mpls/af_mpls.c
859
nh->nh_via_table = MPLS_NEIGH_TABLE_UNSPEC;
net/mpls/af_mpls.c
862
err = mpls_nh_assign_dev(net, rt, nh, oif);
net/mpls/af_mpls.c
956
err = mpls_nh_build(cfg->rc_nlinfo.nl_net, rt, nh,
net/mpls/af_mpls.c
962
if (nh->nh_flags & (RTNH_F_DEAD | RTNH_F_LINKDOWN))
net/mpls/internal.h
162
int nhsel; const struct mpls_nh *nh; \
net/mpls/internal.h
163
for (nhsel = 0, nh = (rt)->rt_nh; \
net/mpls/internal.h
165
nh = (void *)nh + (rt)->rt_nh_size, nhsel++)
net/mpls/internal.h
168
int nhsel; struct mpls_nh *nh; \
net/mpls/internal.h
169
for (nhsel = 0, nh = (rt)->rt_nh; \
net/mpls/internal.h
171
nh = (void *)nh + (rt)->rt_nh_size, nhsel++)
net/netfilter/nf_nat_masquerade.c
37
__be32 newsrc, nh;
net/netfilter/nf_nat_masquerade.c
53
nh = rt_nexthop(rt, ip_hdr(skb)->daddr);
net/netfilter/nf_nat_masquerade.c
54
newsrc = inet_select_addr(out, nh, RT_SCOPE_UNIVERSE);
net/netfilter/utils.c
186
unsigned char *nh;
net/netfilter/utils.c
190
nh = (unsigned char *)(ipv6_hdr(skb) + 1);
net/netfilter/utils.c
191
len = (nh[1] + 1) << 3;
net/netfilter/utils.c
195
nh = skb_network_header(skb);
net/netfilter/utils.c
202
if (nh[off] == IPV6_TLV_PAD1) {
net/netfilter/utils.c
209
optlen = nh[off + 1] + 2;
net/netfilter/utils.c
213
if (nh[off] == IPV6_TLV_JUMBO) {
net/netfilter/utils.c
216
if (nh[off + 1] != 4 || (off & 3) != 2)
net/netfilter/utils.c
218
pkt_len = ntohl(*(__be32 *)(nh + off + 2));
net/nsh/nsh.c
17
struct nshhdr *nh;
net/nsh/nsh.c
34
nh = (struct nshhdr *)(skb->data);
net/nsh/nsh.c
35
memcpy(nh, pushed_nh, length);
net/nsh/nsh.c
36
nh->np = next_proto;
net/nsh/nsh.c
37
skb_postpush_rcsum(skb, nh, length);
net/nsh/nsh.c
50
struct nshhdr *nh;
net/nsh/nsh.c
56
nh = (struct nshhdr *)(skb->data);
net/nsh/nsh.c
57
length = nsh_hdr_len(nh);
net/nsh/nsh.c
60
inner_proto = tun_p_to_eth_p(nh->np);
net/openvswitch/actions.c
1177
struct ipv6hdr *nh;
net/openvswitch/actions.c
1180
sizeof(*nh));
net/openvswitch/actions.c
1184
nh = ipv6_hdr(skb);
net/openvswitch/actions.c
1186
if (nh->hop_limit <= 1)
net/openvswitch/actions.c
1189
key->ip.ttl = --nh->hop_limit;
net/openvswitch/actions.c
1191
struct iphdr *nh;
net/openvswitch/actions.c
1195
sizeof(*nh));
net/openvswitch/actions.c
1199
nh = ip_hdr(skb);
net/openvswitch/actions.c
1200
if (nh->ttl <= 1)
net/openvswitch/actions.c
1203
old_ttl = nh->ttl--;
net/openvswitch/actions.c
1204
csum_replace2(&nh->check, htons(old_ttl << 8),
net/openvswitch/actions.c
1205
htons(nh->ttl << 8));
net/openvswitch/actions.c
1206
key->ip.ttl = nh->ttl;
net/openvswitch/actions.c
287
struct nshhdr *nh = (struct nshhdr *)buffer;
net/openvswitch/actions.c
290
err = nsh_hdr_from_nlattr(a, nh, NSH_HDR_MAX_LEN);
net/openvswitch/actions.c
294
err = nsh_push(skb, nh);
net/openvswitch/actions.c
321
static void update_ip_l4_checksum(struct sk_buff *skb, struct iphdr *nh,
net/openvswitch/actions.c
326
if (nh->frag_off & htons(IP_OFFSET))
net/openvswitch/actions.c
329
if (nh->protocol == IPPROTO_TCP) {
net/openvswitch/actions.c
333
} else if (nh->protocol == IPPROTO_UDP) {
net/openvswitch/actions.c
347
static void set_ip_addr(struct sk_buff *skb, struct iphdr *nh,
net/openvswitch/actions.c
350
update_ip_l4_checksum(skb, nh, *addr, new_addr);
net/openvswitch/actions.c
351
csum_replace4(&nh->check, *addr, new_addr);
net/openvswitch/actions.c
405
static void set_ipv6_dsfield(struct sk_buff *skb, struct ipv6hdr *nh, u8 ipv6_tclass, u8 mask)
net/openvswitch/actions.c
407
u8 old_ipv6_tclass = ipv6_get_dsfield(nh);
net/openvswitch/actions.c
415
ipv6_change_dsfield(nh, ~mask, ipv6_tclass);
net/openvswitch/actions.c
418
static void set_ipv6_fl(struct sk_buff *skb, struct ipv6hdr *nh, u32 fl, u32 mask)
net/openvswitch/actions.c
422
ofl = nh->flow_lbl[0] << 16 | nh->flow_lbl[1] << 8 | nh->flow_lbl[2];
net/openvswitch/actions.c
426
nh->flow_lbl[0] = (u8)(fl >> 16);
net/openvswitch/actions.c
427
nh->flow_lbl[1] = (u8)(fl >> 8);
net/openvswitch/actions.c
428
nh->flow_lbl[2] = (u8)fl;
net/openvswitch/actions.c
434
static void set_ipv6_ttl(struct sk_buff *skb, struct ipv6hdr *nh, u8 new_ttl, u8 mask)
net/openvswitch/actions.c
436
new_ttl = OVS_MASKED(nh->hop_limit, new_ttl, mask);
net/openvswitch/actions.c
439
csum_replace(&skb->csum, (__force __wsum)(nh->hop_limit << 8),
net/openvswitch/actions.c
441
nh->hop_limit = new_ttl;
net/openvswitch/actions.c
444
static void set_ip_ttl(struct sk_buff *skb, struct iphdr *nh, u8 new_ttl,
net/openvswitch/actions.c
447
new_ttl = OVS_MASKED(nh->ttl, new_ttl, mask);
net/openvswitch/actions.c
449
csum_replace2(&nh->check, htons(nh->ttl << 8), htons(new_ttl << 8));
net/openvswitch/actions.c
450
nh->ttl = new_ttl;
net/openvswitch/actions.c
457
struct iphdr *nh;
net/openvswitch/actions.c
466
nh = ip_hdr(skb);
net/openvswitch/actions.c
473
new_addr = OVS_MASKED(nh->saddr, key->ipv4_src, mask->ipv4_src);
net/openvswitch/actions.c
475
if (unlikely(new_addr != nh->saddr)) {
net/openvswitch/actions.c
476
set_ip_addr(skb, nh, &nh->saddr, new_addr);
net/openvswitch/actions.c
481
new_addr = OVS_MASKED(nh->daddr, key->ipv4_dst, mask->ipv4_dst);
net/openvswitch/actions.c
483
if (unlikely(new_addr != nh->daddr)) {
net/openvswitch/actions.c
484
set_ip_addr(skb, nh, &nh->daddr, new_addr);
net/openvswitch/actions.c
489
ipv4_change_dsfield(nh, ~mask->ipv4_tos, key->ipv4_tos);
net/openvswitch/actions.c
490
flow_key->ip.tos = nh->tos;
net/openvswitch/actions.c
493
set_ip_ttl(skb, nh, key->ipv4_ttl, mask->ipv4_ttl);
net/openvswitch/actions.c
494
flow_key->ip.ttl = nh->ttl;
net/openvswitch/actions.c
509
struct ipv6hdr *nh;
net/openvswitch/actions.c
517
nh = ipv6_hdr(skb);
net/openvswitch/actions.c
524
__be32 *saddr = (__be32 *)&nh->saddr;
net/openvswitch/actions.c
540
__be32 *daddr = (__be32 *)&nh->daddr;
net/openvswitch/actions.c
546
if (ipv6_ext_hdr(nh->nexthdr))
net/openvswitch/actions.c
559
set_ipv6_dsfield(skb, nh, key->ipv6_tclass, mask->ipv6_tclass);
net/openvswitch/actions.c
560
flow_key->ip.tos = ipv6_get_dsfield(nh);
net/openvswitch/actions.c
563
set_ipv6_fl(skb, nh, ntohl(key->ipv6_label),
net/openvswitch/actions.c
566
*(__be32 *)nh & htonl(IPV6_FLOWINFO_FLOWLABEL);
net/openvswitch/actions.c
569
set_ipv6_ttl(skb, nh, key->ipv6_hlimit, mask->ipv6_hlimit);
net/openvswitch/actions.c
570
flow_key->ip.ttl = nh->hop_limit;
net/openvswitch/flow.c
269
static void get_ipv6_ext_hdrs(struct sk_buff *skb, struct ipv6hdr *nh,
net/openvswitch/flow.c
272
u8 next_type = nh->nexthdr;
net/openvswitch/flow.c
387
struct ipv6hdr *nh;
net/openvswitch/flow.c
390
err = check_header(skb, nh_ofs + sizeof(*nh));
net/openvswitch/flow.c
394
nh = ipv6_hdr(skb);
net/openvswitch/flow.c
396
get_ipv6_ext_hdrs(skb, nh, &key->ipv6.exthdrs);
net/openvswitch/flow.c
399
key->ip.tos = ipv6_get_dsfield(nh);
net/openvswitch/flow.c
400
key->ip.ttl = nh->hop_limit;
net/openvswitch/flow.c
401
key->ipv6.label = *(__be32 *)nh & htonl(IPV6_FLOWINFO_FLOWLABEL);
net/openvswitch/flow.c
402
key->ipv6.addr.src = nh->saddr;
net/openvswitch/flow.c
403
key->ipv6.addr.dst = nh->daddr;
net/openvswitch/flow.c
627
struct nshhdr *nh;
net/openvswitch/flow.c
636
nh = nsh_hdr(skb);
net/openvswitch/flow.c
637
version = nsh_get_ver(nh);
net/openvswitch/flow.c
638
length = nsh_hdr_len(nh);
net/openvswitch/flow.c
647
nh = nsh_hdr(skb);
net/openvswitch/flow.c
648
key->nsh.base.flags = nsh_get_flags(nh);
net/openvswitch/flow.c
649
key->nsh.base.ttl = nsh_get_ttl(nh);
net/openvswitch/flow.c
650
key->nsh.base.mdtype = nh->mdtype;
net/openvswitch/flow.c
651
key->nsh.base.np = nh->np;
net/openvswitch/flow.c
652
key->nsh.base.path_hdr = nh->path_hdr;
net/openvswitch/flow.c
657
memcpy(key->nsh.context, nh->md1.context,
net/openvswitch/flow.c
658
sizeof(nh->md1));
net/openvswitch/flow.c
662
sizeof(nh->md1));
net/openvswitch/flow.c
685
struct iphdr *nh;
net/openvswitch/flow.c
699
nh = ip_hdr(skb);
net/openvswitch/flow.c
700
key->ipv4.addr.src = nh->saddr;
net/openvswitch/flow.c
701
key->ipv4.addr.dst = nh->daddr;
net/openvswitch/flow.c
703
key->ip.proto = nh->protocol;
net/openvswitch/flow.c
704
key->ip.tos = nh->tos;
net/openvswitch/flow.c
705
key->ip.ttl = nh->ttl;
net/openvswitch/flow.c
707
offset = nh->frag_off & htons(IP_OFFSET);
net/openvswitch/flow.c
713
if (nh->frag_off & htons(IP_MF) ||
net/openvswitch/flow_netlink.c
1314
struct nshhdr *nh, size_t size)
net/openvswitch/flow_netlink.c
1334
nh->np = base->np;
net/openvswitch/flow_netlink.c
1335
nh->mdtype = base->mdtype;
net/openvswitch/flow_netlink.c
1336
nh->path_hdr = base->path_hdr;
net/openvswitch/flow_netlink.c
1343
memcpy(&nh->md1, nla_data(a), mdlen);
net/openvswitch/flow_netlink.c
1350
memcpy(&nh->md2, nla_data(a), mdlen);
net/openvswitch/flow_netlink.c
1359
nh->ver_flags_ttl_len = 0;
net/openvswitch/flow_netlink.c
1360
nsh_set_flags_ttl_len(nh, flags, ttl, NSH_BASE_HDR_LEN + mdlen);
net/openvswitch/flow_netlink.h
68
int nsh_hdr_from_nlattr(const struct nlattr *attr, struct nshhdr *nh,
net/xfrm/xfrm_output.c
102
rt = (struct ipv6_rt_hdr *)(nh + offset);
net/xfrm/xfrm_output.c
84
const unsigned char *nh = skb_network_header(skb);
net/xfrm/xfrm_output.c
89
packet_len = skb_tail_pointer(skb) - nh;
samples/bpf/xdp_router_ipv4_user.c
117
for (; NLMSG_OK(nh, nll); nh = NLMSG_NEXT(nh, nll)) {
samples/bpf/xdp_router_ipv4_user.c
118
rt_msg = (struct rtmsg *)NLMSG_DATA(nh);
samples/bpf/xdp_router_ipv4_user.c
124
rtl = RTM_PAYLOAD(nh);
samples/bpf/xdp_router_ipv4_user.c
175
if (nh->nlmsg_type == RTM_DELROUTE) {
samples/bpf/xdp_router_ipv4_user.c
205
if (nh->nlmsg_type == RTM_DELROUTE) {
samples/bpf/xdp_router_ipv4_user.c
254
struct nlmsghdr *nh;
samples/bpf/xdp_router_ipv4_user.c
306
nh = (struct nlmsghdr *)buf;
samples/bpf/xdp_router_ipv4_user.c
307
read_route(nh, nll);
samples/bpf/xdp_router_ipv4_user.c
316
static void read_arp(struct nlmsghdr *nh, int nll)
samples/bpf/xdp_router_ipv4_user.c
333
for (; NLMSG_OK(nh, nll); nh = NLMSG_NEXT(nh, nll)) {
samples/bpf/xdp_router_ipv4_user.c
334
rt_msg = (struct ndmsg *)NLMSG_DATA(nh);
samples/bpf/xdp_router_ipv4_user.c
337
rtl = RTM_PAYLOAD(nh);
samples/bpf/xdp_router_ipv4_user.c
359
if (nh->nlmsg_type == RTM_DELNEIGH) {
samples/bpf/xdp_router_ipv4_user.c
362
} else if (nh->nlmsg_type == RTM_NEWNEIGH) {
samples/bpf/xdp_router_ipv4_user.c
372
if (nh->nlmsg_type == RTM_DELNEIGH) {
samples/bpf/xdp_router_ipv4_user.c
375
} else if (nh->nlmsg_type == RTM_NEWNEIGH) {
samples/bpf/xdp_router_ipv4_user.c
391
struct nlmsghdr *nh;
samples/bpf/xdp_router_ipv4_user.c
441
nh = (struct nlmsghdr *)buf;
samples/bpf/xdp_router_ipv4_user.c
442
read_arp(nh, nll);
samples/bpf/xdp_router_ipv4_user.c
456
struct nlmsghdr *nh;
samples/bpf/xdp_router_ipv4_user.c
517
nh = (struct nlmsghdr *)buf;
samples/bpf/xdp_router_ipv4_user.c
518
read_route(nh, nll);
samples/bpf/xdp_router_ipv4_user.c
530
nh = (struct nlmsghdr *)buf;
samples/bpf/xdp_router_ipv4_user.c
531
read_arp(nh, nll);
samples/bpf/xdp_router_ipv4_user.c
63
struct nlmsghdr *nh;
samples/bpf/xdp_router_ipv4_user.c
73
nh = (struct nlmsghdr *)buf_ptr;
samples/bpf/xdp_router_ipv4_user.c
75
if (nh->nlmsg_type == NLMSG_DONE)
samples/bpf/xdp_router_ipv4_user.c
91
static void read_route(struct nlmsghdr *nh, int nll)
scripts/dtc/libfdt/fdt_ro.c
305
const struct fdt_node_header *nh = fdt_offset_ptr_(fdt, nodeoffset);
scripts/dtc/libfdt/fdt_ro.c
313
nameptr = nh->name;
scripts/dtc/libfdt/fdt_rw.c
343
struct fdt_node_header *nh;
scripts/dtc/libfdt/fdt_rw.c
368
nh = fdt_offset_ptr_w_(fdt, offset);
scripts/dtc/libfdt/fdt_rw.c
369
nodelen = sizeof(*nh) + FDT_TAGALIGN(namelen+1) + FDT_TAGSIZE;
scripts/dtc/libfdt/fdt_rw.c
371
err = fdt_splice_struct_(fdt, nh, 0, nodelen);
scripts/dtc/libfdt/fdt_rw.c
375
nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
scripts/dtc/libfdt/fdt_rw.c
376
memset(nh->name, 0, FDT_TAGALIGN(namelen+1));
scripts/dtc/libfdt/fdt_rw.c
377
memcpy(nh->name, name, namelen);
scripts/dtc/libfdt/fdt_rw.c
378
endtag = (fdt32_t *)((char *)nh + nodelen - FDT_TAGSIZE);
scripts/dtc/libfdt/fdt_sw.c
221
struct fdt_node_header *nh;
scripts/dtc/libfdt/fdt_sw.c
227
nh = fdt_grab_space_(fdt, sizeof(*nh) + FDT_TAGALIGN(namelen));
scripts/dtc/libfdt/fdt_sw.c
228
if (! nh)
scripts/dtc/libfdt/fdt_sw.c
231
nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
scripts/dtc/libfdt/fdt_sw.c
232
memcpy(nh->name, name, namelen);
tools/bpf/bpftool/net.c
158
struct nlmsghdr *nh;
tools/bpf/bpftool/net.c
173
for (nh = (struct nlmsghdr *)buf; NLMSG_OK(nh, (unsigned int)len);
tools/bpf/bpftool/net.c
174
nh = NLMSG_NEXT(nh, len)) {
tools/bpf/bpftool/net.c
175
if (nh->nlmsg_pid != nl_pid) {
tools/bpf/bpftool/net.c
179
if (nh->nlmsg_seq != seq) {
tools/bpf/bpftool/net.c
183
if (nh->nlmsg_flags & NLM_F_MULTI)
tools/bpf/bpftool/net.c
185
switch (nh->nlmsg_type) {
tools/bpf/bpftool/net.c
187
err = (struct nlmsgerr *)NLMSG_DATA(nh);
tools/bpf/bpftool/net.c
191
libbpf_nla_dump_errormsg(nh);
tools/bpf/bpftool/net.c
199
ret = _fn(nh, fn, cookie);
tools/lib/bpf/netlink.c
143
struct nlmsghdr *nh;
tools/lib/bpf/netlink.c
174
for (nh = (struct nlmsghdr *)iov.iov_base; NLMSG_OK(nh, len);
tools/lib/bpf/netlink.c
175
nh = NLMSG_NEXT(nh, len)) {
tools/lib/bpf/netlink.c
176
if (nh->nlmsg_pid != nl_pid) {
tools/lib/bpf/netlink.c
180
if (nh->nlmsg_seq != seq) {
tools/lib/bpf/netlink.c
184
if (nh->nlmsg_flags & NLM_F_MULTI)
tools/lib/bpf/netlink.c
186
switch (nh->nlmsg_type) {
tools/lib/bpf/netlink.c
188
err = (struct nlmsgerr *)NLMSG_DATA(nh);
tools/lib/bpf/netlink.c
192
libbpf_nla_dump_errormsg(nh);
tools/lib/bpf/netlink.c
201
ret = _fn(nh, fn, cookie);
tools/lib/bpf/netlink.c
236
req->nh.nlmsg_pid = 0;
tools/lib/bpf/netlink.c
237
req->nh.nlmsg_seq = time(NULL);
tools/lib/bpf/netlink.c
239
if (send(sock, req, req->nh.nlmsg_len, 0) < 0) {
tools/lib/bpf/netlink.c
244
ret = libbpf_netlink_recv(sock, nl_pid, req->nh.nlmsg_seq,
tools/lib/bpf/netlink.c
251
static int parse_genl_family_id(struct nlmsghdr *nh, libbpf_dump_nlmsg_t fn,
tools/lib/bpf/netlink.c
254
struct genlmsghdr *gnl = NLMSG_DATA(nh);
tools/lib/bpf/netlink.c
260
NLMSG_PAYLOAD(nh, sizeof(*gnl)), NULL);
tools/lib/bpf/netlink.c
272
.nh.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN),
tools/lib/bpf/netlink.c
273
.nh.nlmsg_type = GENL_ID_CTRL,
tools/lib/bpf/netlink.c
274
.nh.nlmsg_flags = NLM_F_REQUEST,
tools/lib/bpf/netlink.c
296
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
tools/lib/bpf/netlink.c
297
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/lib/bpf/netlink.c
298
req.nh.nlmsg_type = RTM_SETLINK;
tools/lib/bpf/netlink.c
407
static int parse_xdp_features(struct nlmsghdr *nh, libbpf_dump_nlmsg_t fn,
tools/lib/bpf/netlink.c
410
struct genlmsghdr *gnl = NLMSG_DATA(nh);
tools/lib/bpf/netlink.c
417
NLMSG_PAYLOAD(nh, sizeof(*gnl)), NULL);
tools/lib/bpf/netlink.c
436
.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)),
tools/lib/bpf/netlink.c
437
.nh.nlmsg_type = RTM_GETLINK,
tools/lib/bpf/netlink.c
438
.nh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
tools/lib/bpf/netlink.c
486
req.nh.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
tools/lib/bpf/netlink.c
487
req.nh.nlmsg_flags = NLM_F_REQUEST;
tools/lib/bpf/netlink.c
488
req.nh.nlmsg_type = id;
tools/lib/bpf/netlink.c
608
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg));
tools/lib/bpf/netlink.c
609
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | flags;
tools/lib/bpf/netlink.c
610
req.nh.nlmsg_type = cmd;
tools/lib/bpf/netlink.c
697
static int get_tc_info(struct nlmsghdr *nh, libbpf_dump_nlmsg_t fn,
tools/lib/bpf/netlink.c
700
struct tcmsg *tc = NLMSG_DATA(nh);
tools/lib/bpf/netlink.c
705
NLMSG_PAYLOAD(nh, sizeof(*tc)), NULL);
tools/lib/bpf/netlink.c
708
return __get_tc_info(cookie, tc, tb, nh->nlmsg_flags & NLM_F_ECHO);
tools/lib/bpf/netlink.c
768
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg));
tools/lib/bpf/netlink.c
769
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE |
tools/lib/bpf/netlink.c
771
req.nh.nlmsg_type = RTM_NEWTFILTER;
tools/lib/bpf/netlink.c
845
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg));
tools/lib/bpf/netlink.c
846
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/lib/bpf/netlink.c
847
req.nh.nlmsg_type = RTM_DELTFILTER;
tools/lib/bpf/netlink.c
912
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct tcmsg));
tools/lib/bpf/netlink.c
913
req.nh.nlmsg_flags = NLM_F_REQUEST;
tools/lib/bpf/netlink.c
914
req.nh.nlmsg_type = RTM_GETTFILTER;
tools/lib/bpf/nlattr.h
138
return (struct nlattr *)((void *)req + NLMSG_ALIGN(req->nh.nlmsg_len));
tools/lib/bpf/nlattr.h
146
if (NLMSG_ALIGN(req->nh.nlmsg_len) + NLA_ALIGN(NLA_HDRLEN + len) > sizeof(*req))
tools/lib/bpf/nlattr.h
156
req->nh.nlmsg_len = NLMSG_ALIGN(req->nh.nlmsg_len) + NLA_ALIGN(nla->nla_len);
tools/lib/bpf/nlattr.h
58
struct nlmsghdr nh;
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
171
static struct rtattr *rtattr_add(struct nlmsghdr *nh, unsigned short type,
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
175
(struct rtattr *)((uint8_t *)nh + RTA_ALIGN(nh->nlmsg_len));
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
178
nh->nlmsg_len = RTA_ALIGN(nh->nlmsg_len) + RTA_ALIGN(rta->rta_len);
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
182
static struct rtattr *rtattr_add_str(struct nlmsghdr *nh, unsigned short type,
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
185
struct rtattr *rta = rtattr_add(nh, type, strlen(s));
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
191
static struct rtattr *rtattr_begin(struct nlmsghdr *nh, unsigned short type)
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
193
return rtattr_add(nh, type, 0);
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
196
static void rtattr_end(struct nlmsghdr *nh, struct rtattr *attr)
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
198
uint8_t *end = (uint8_t *)nh + nh->nlmsg_len;
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
206
struct nlmsghdr nh;
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
213
struct nlmsghdr *nh;
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
216
nh = &req.nh;
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
217
nh->nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
218
nh->nlmsg_type = RTM_NEWLINK;
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
219
nh->nlmsg_flags |= NLM_F_CREATE | NLM_F_REQUEST;
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
221
rtattr_add_str(nh, IFLA_IFNAME, "ipsec0");
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
222
link_info = rtattr_begin(nh, IFLA_LINKINFO);
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
223
rtattr_add_str(nh, IFLA_INFO_KIND, "xfrm");
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
224
info_data = rtattr_begin(nh, IFLA_INFO_DATA);
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
225
rtattr_add(nh, IFLA_XFRM_COLLECT_METADATA, 0);
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
226
rtattr_end(nh, info_data);
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
227
rtattr_end(nh, link_info);
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
236
ret = send(sock, nh, nh->nlmsg_len, 0);
tools/testing/selftests/bpf/prog_tests/xfrm_info.c
237
if (!ASSERT_EQ(ret, nh->nlmsg_len, "netlink send length"))
tools/testing/selftests/bpf/progs/bpf_iter_ipv6_route.c
19
struct nexthop *nh;
tools/testing/selftests/bpf/progs/bpf_iter_ipv6_route.c
28
nh = rt->nh;
tools/testing/selftests/bpf/progs/bpf_iter_ipv6_route.c
29
if (rt->nh)
tools/testing/selftests/bpf/progs/bpf_iter_ipv6_route.c
30
fib6_nh = &nh->nh_info->fib6_nh;
tools/testing/selftests/bpf/xsk.c
338
struct nlmsghdr *nh;
tools/testing/selftests/bpf/xsk.c
368
for (nh = (struct nlmsghdr *)iov.iov_base; NLMSG_OK(nh, len);
tools/testing/selftests/bpf/xsk.c
369
nh = NLMSG_NEXT(nh, len)) {
tools/testing/selftests/bpf/xsk.c
370
if (nh->nlmsg_flags & NLM_F_MULTI)
tools/testing/selftests/bpf/xsk.c
372
switch (nh->nlmsg_type) {
tools/testing/selftests/bpf/xsk.c
374
err = (struct nlmsgerr *)NLMSG_DATA(nh);
tools/testing/selftests/bpf/xsk.c
404
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
tools/testing/selftests/bpf/xsk.c
405
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/bpf/xsk.c
406
req.nh.nlmsg_type = RTM_NEWLINK;
tools/testing/selftests/bpf/xsk.c
409
rta = (struct rtattr *)(((char *)&req) + NLMSG_ALIGN(req.nh.nlmsg_len));
tools/testing/selftests/bpf/xsk.c
412
req.nh.nlmsg_len = NLMSG_ALIGN(req.nh.nlmsg_len) + RTA_LENGTH(sizeof(mtu));
tools/testing/selftests/bpf/xsk.c
415
ret = send(fd, &req, req.nh.nlmsg_len, 0);
tools/testing/selftests/bpf/xsk.c
87
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1016
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1020
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1032
req.nh.nlmsg_len = NLMSG_LENGTH(0);
tools/testing/selftests/net/ipsec.c
1033
req.nh.nlmsg_type = XFRM_MSG_GETSA;
tools/testing/selftests/net/ipsec.c
1034
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
tools/testing/selftests/net/ipsec.c
1035
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
1044
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_ADDRESS_FILTER,
tools/testing/selftests/net/ipsec.c
1048
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1058
if (answer.nh.nlmsg_type == NLMSG_ERROR) {
tools/testing/selftests/net/ipsec.c
1062
} else if (answer.nh.nlmsg_type == NLMSG_DONE) {
tools/testing/selftests/net/ipsec.c
1067
} else if (answer.nh.nlmsg_type == XFRM_MSG_NEWSA) {
tools/testing/selftests/net/ipsec.c
1109
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1117
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/ipsec.c
1118
req.nh.nlmsg_type = XFRM_MSG_NEWPOLICY;
tools/testing/selftests/net/ipsec.c
1119
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
1120
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
1149
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_TMPL, &tmpl, sizeof(tmpl)))
tools/testing/selftests/net/ipsec.c
1152
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1184
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1190
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.id));
tools/testing/selftests/net/ipsec.c
1191
req.nh.nlmsg_type = XFRM_MSG_DELPOLICY;
tools/testing/selftests/net/ipsec.c
1192
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
1193
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
1203
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1234
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1241
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.id));
tools/testing/selftests/net/ipsec.c
1242
req.nh.nlmsg_type = XFRM_MSG_DELSA;
tools/testing/selftests/net/ipsec.c
1243
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
1244
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
1253
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_SRCADDR, &saddr, sizeof(saddr)))
tools/testing/selftests/net/ipsec.c
1256
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1285
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1289
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1297
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.spi));
tools/testing/selftests/net/ipsec.c
1298
req.nh.nlmsg_type = XFRM_MSG_ALLOCSPI;
tools/testing/selftests/net/ipsec.c
1299
req.nh.nlmsg_flags = NLM_F_REQUEST;
tools/testing/selftests/net/ipsec.c
1300
req.nh.nlmsg_seq = (*seq)++;
tools/testing/selftests/net/ipsec.c
1307
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1315
} else if (answer.nh.nlmsg_type == XFRM_MSG_NEWSA) {
tools/testing/selftests/net/ipsec.c
1324
} else if (answer.nh.nlmsg_type != NLMSG_ERROR) {
tools/testing/selftests/net/ipsec.c
1325
printk("expected NLMSG_ERROR, got %d", (int)answer.nh.nlmsg_type);
tools/testing/selftests/net/ipsec.c
1375
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1390
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.acq));
tools/testing/selftests/net/ipsec.c
1391
req.nh.nlmsg_type = XFRM_MSG_ACQUIRE;
tools/testing/selftests/net/ipsec.c
1392
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
1393
req.nh.nlmsg_seq = (*seq)++;
tools/testing/selftests/net/ipsec.c
1402
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_TMPL, &xfrm_tmpl, sizeof(xfrm_tmpl)))
tools/testing/selftests/net/ipsec.c
1405
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1413
} else if (req.nh.nlmsg_type != NLMSG_ERROR) {
tools/testing/selftests/net/ipsec.c
1414
printk("expected NLMSG_ERROR, got %d", (int)req.nh.nlmsg_type);
tools/testing/selftests/net/ipsec.c
1446
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1468
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.expire));
tools/testing/selftests/net/ipsec.c
1469
req.nh.nlmsg_type = XFRM_MSG_EXPIRE;
tools/testing/selftests/net/ipsec.c
1470
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
1471
req.nh.nlmsg_seq = (*seq)++;
tools/testing/selftests/net/ipsec.c
1479
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1487
} else if (req.nh.nlmsg_type != NLMSG_ERROR) {
tools/testing/selftests/net/ipsec.c
1488
printk("expected NLMSG_ERROR, got %d", (int)req.nh.nlmsg_type);
tools/testing/selftests/net/ipsec.c
1518
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1543
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.expire));
tools/testing/selftests/net/ipsec.c
1544
req.nh.nlmsg_type = XFRM_MSG_POLEXPIRE;
tools/testing/selftests/net/ipsec.c
1545
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
1546
req.nh.nlmsg_seq = (*seq)++;
tools/testing/selftests/net/ipsec.c
1557
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1565
} else if (req.nh.nlmsg_type != NLMSG_ERROR) {
tools/testing/selftests/net/ipsec.c
1566
printk("expected NLMSG_ERROR, got %d", (int)req.nh.nlmsg_type);
tools/testing/selftests/net/ipsec.c
1599
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1609
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.unused));
tools/testing/selftests/net/ipsec.c
1610
req.nh.nlmsg_type = XFRM_MSG_NEWSPDINFO;
tools/testing/selftests/net/ipsec.c
1611
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
1612
req.nh.nlmsg_seq = (*seq)++;
tools/testing/selftests/net/ipsec.c
1616
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_SPD_IPV4_HTHRESH, &thresh, sizeof(thresh)))
tools/testing/selftests/net/ipsec.c
1621
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_SPD_IPV6_HTHRESH, &thresh, sizeof(thresh)))
tools/testing/selftests/net/ipsec.c
1626
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_IF_ID, NULL, 0)) {
tools/testing/selftests/net/ipsec.c
1632
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1640
} else if (req.nh.nlmsg_type != NLMSG_ERROR) {
tools/testing/selftests/net/ipsec.c
1641
printk("expected NLMSG_ERROR, got %d", (int)req.nh.nlmsg_type);
tools/testing/selftests/net/ipsec.c
1656
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1671
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.unused));
tools/testing/selftests/net/ipsec.c
1672
req.nh.nlmsg_type = XFRM_MSG_GETSPDINFO;
tools/testing/selftests/net/ipsec.c
1673
req.nh.nlmsg_flags = NLM_F_REQUEST;
tools/testing/selftests/net/ipsec.c
1674
req.nh.nlmsg_seq = (*seq)++;
tools/testing/selftests/net/ipsec.c
1675
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1683
} else if (req.nh.nlmsg_type == XFRM_MSG_NEWSPDINFO) {
tools/testing/selftests/net/ipsec.c
1684
size_t len = NLMSG_PAYLOAD(&req.nh, sizeof(req.unused));
tools/testing/selftests/net/ipsec.c
1714
} else if (req.nh.nlmsg_type != NLMSG_ERROR) {
tools/testing/selftests/net/ipsec.c
1715
printk("expected NLMSG_ERROR, got %d", (int)req.nh.nlmsg_type);
tools/testing/selftests/net/ipsec.c
214
static inline struct rtattr *rtattr_hdr(struct nlmsghdr *nh)
tools/testing/selftests/net/ipsec.c
216
return (struct rtattr *)((char *)(nh) + RTA_ALIGN((nh)->nlmsg_len));
tools/testing/selftests/net/ipsec.c
219
static int rtattr_pack(struct nlmsghdr *nh, size_t req_sz,
tools/testing/selftests/net/ipsec.c
223
struct rtattr *attr = rtattr_hdr(nh);
tools/testing/selftests/net/ipsec.c
224
size_t nl_size = RTA_ALIGN(nh->nlmsg_len) + RTA_LENGTH(size);
tools/testing/selftests/net/ipsec.c
230
nh->nlmsg_len = nl_size;
tools/testing/selftests/net/ipsec.c
240
static struct rtattr *_rtattr_begin(struct nlmsghdr *nh, size_t req_sz,
tools/testing/selftests/net/ipsec.c
243
struct rtattr *ret = rtattr_hdr(nh);
tools/testing/selftests/net/ipsec.c
245
if (rtattr_pack(nh, req_sz, rta_type, payload, size))
tools/testing/selftests/net/ipsec.c
251
static inline struct rtattr *rtattr_begin(struct nlmsghdr *nh, size_t req_sz,
tools/testing/selftests/net/ipsec.c
254
return _rtattr_begin(nh, req_sz, rta_type, 0, 0);
tools/testing/selftests/net/ipsec.c
257
static inline void rtattr_end(struct nlmsghdr *nh, struct rtattr *attr)
tools/testing/selftests/net/ipsec.c
259
char *nlmsg_end = (char *)nh + nh->nlmsg_len;
tools/testing/selftests/net/ipsec.c
264
static int veth_pack_peerb(struct nlmsghdr *nh, size_t req_sz,
tools/testing/selftests/net/ipsec.c
274
peer_attr = _rtattr_begin(nh, req_sz, VETH_INFO_PEER, &pi, sizeof(pi));
tools/testing/selftests/net/ipsec.c
278
if (rtattr_pack(nh, req_sz, IFLA_IFNAME, peer, strlen(peer)))
tools/testing/selftests/net/ipsec.c
281
if (rtattr_pack(nh, req_sz, IFLA_NET_NS_FD, &ns, sizeof(ns)))
tools/testing/selftests/net/ipsec.c
284
rtattr_end(nh, peer_attr);
tools/testing/selftests/net/ipsec.c
317
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
325
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/ipsec.c
326
req.nh.nlmsg_type = RTM_NEWLINK;
tools/testing/selftests/net/ipsec.c
327
req.nh.nlmsg_flags = flags;
tools/testing/selftests/net/ipsec.c
328
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
332
if (rtattr_pack(&req.nh, sizeof(req), IFLA_IFNAME, peera, strlen(peera)))
tools/testing/selftests/net/ipsec.c
335
if (rtattr_pack(&req.nh, sizeof(req), IFLA_NET_NS_FD, &ns_a, sizeof(ns_a)))
tools/testing/selftests/net/ipsec.c
338
link_info = rtattr_begin(&req.nh, sizeof(req), IFLA_LINKINFO);
tools/testing/selftests/net/ipsec.c
342
if (rtattr_pack(&req.nh, sizeof(req), IFLA_INFO_KIND, veth_type, sizeof(veth_type)))
tools/testing/selftests/net/ipsec.c
345
info_data = rtattr_begin(&req.nh, sizeof(req), IFLA_INFO_DATA);
tools/testing/selftests/net/ipsec.c
349
if (veth_pack_peerb(&req.nh, sizeof(req), peerb, ns_b))
tools/testing/selftests/net/ipsec.c
352
rtattr_end(&req.nh, info_data);
tools/testing/selftests/net/ipsec.c
353
rtattr_end(&req.nh, link_info);
tools/testing/selftests/net/ipsec.c
355
if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
367
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
373
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/ipsec.c
374
req.nh.nlmsg_type = RTM_NEWADDR;
tools/testing/selftests/net/ipsec.c
375
req.nh.nlmsg_flags = flags;
tools/testing/selftests/net/ipsec.c
376
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
391
if (rtattr_pack(&req.nh, sizeof(req), IFA_LOCAL, &addr, sizeof(addr)))
tools/testing/selftests/net/ipsec.c
394
if (rtattr_pack(&req.nh, sizeof(req), IFA_ADDRESS, &addr, sizeof(addr)))
tools/testing/selftests/net/ipsec.c
397
if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
407
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
413
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/ipsec.c
414
req.nh.nlmsg_type = RTM_NEWLINK;
tools/testing/selftests/net/ipsec.c
415
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
416
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
423
if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
434
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
441
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.rt));
tools/testing/selftests/net/ipsec.c
442
req.nh.nlmsg_type = RTM_NEWROUTE;
tools/testing/selftests/net/ipsec.c
443
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE;
tools/testing/selftests/net/ipsec.c
444
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
452
if (rtattr_pack(&req.nh, sizeof(req), RTA_DST, &dst, sizeof(dst)))
tools/testing/selftests/net/ipsec.c
455
if (rtattr_pack(&req.nh, sizeof(req), RTA_PREFSRC, &src, sizeof(src)))
tools/testing/selftests/net/ipsec.c
458
if (rtattr_pack(&req.nh, sizeof(req), RTA_OIF, &index, sizeof(index)))
tools/testing/selftests/net/ipsec.c
461
if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
831
static int xfrm_state_pack_algo(struct nlmsghdr *nh, size_t req_sz,
tools/testing/selftests/net/ipsec.c
896
if (rtattr_pack(nh, req_sz, type, &alg, sizeof(alg)))
tools/testing/selftests/net/ipsec.c
911
if (rtattr_pack(nh, req_sz, type, &alg, sizeof(alg)))
tools/testing/selftests/net/ipsec.c
927
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
933
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/ipsec.c
934
req.nh.nlmsg_type = XFRM_MSG_NEWSA;
tools/testing/selftests/net/ipsec.c
935
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
936
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
962
if (xfrm_state_pack_algo(&req.nh, sizeof(req), desc))
tools/testing/selftests/net/ipsec.c
965
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/lib/csum.c
653
static int recv_verify_packet_ipv4(void *nh, int len)
tools/testing/selftests/net/lib/csum.c
655
struct iphdr *iph = nh;
tools/testing/selftests/net/lib/csum.c
674
static int recv_verify_packet_ipv6(void *nh, int len)
tools/testing/selftests/net/lib/csum.c
676
struct ipv6hdr *ip6h = nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
108
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1084
static void print_addrs(struct nlmsghdr *nh, int pm_family, int total_len)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1088
for (; NLMSG_OK(nh, total_len); nh = NLMSG_NEXT(nh, total_len)) {
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1089
int len = nh->nlmsg_len;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1091
if (nh->nlmsg_type == NLMSG_DONE)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1093
if (nh->nlmsg_type == NLMSG_ERROR)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1094
nl_error(nh);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1095
if (nh->nlmsg_type != pm_family)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1099
attrs = (struct rtattr *) ((char *) NLMSG_DATA(nh) +
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1117
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1124
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1159
print_addrs(nh, pm_family, do_nl_req(fd, nh, off, sizeof(data)));
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1169
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1181
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1184
nh->nlmsg_flags |= NLM_F_DUMP;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1185
nh->nlmsg_seq = 1;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1186
nh->nlmsg_pid = pid;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1187
nh->nlmsg_len = off;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1198
print_addrs(nh, pm_family, do_nl_req(fd, nh, off, sizeof(data)));
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1207
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1211
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1215
do_nl_req(fd, nh, off, 0);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1219
static void print_limits(struct nlmsghdr *nh, int pm_family, int total_len)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1224
for (; NLMSG_OK(nh, total_len); nh = NLMSG_NEXT(nh, total_len)) {
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1225
int len = nh->nlmsg_len;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1227
if (nh->nlmsg_type == NLMSG_DONE)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1229
if (nh->nlmsg_type == NLMSG_ERROR)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1230
nl_error(nh);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1231
if (nh->nlmsg_type != pm_family)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1235
attrs = (struct rtattr *) ((char *) NLMSG_DATA(nh) +
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1261
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1274
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1296
len = do_nl_req(fd, nh, off, len);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1298
print_limits(nh, pm_family, len);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
135
nh = (struct nlmsghdr *)buffer;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1356
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1369
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
137
for (; NLMSG_OK(nh, res_len); nh = NLMSG_NEXT(nh, res_len)) {
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
138
if (nh->nlmsg_type == NLMSG_ERROR)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
141
ghdr = (struct genlmsghdr *)NLMSG_DATA(nh);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
148
msg_len = nh->nlmsg_len - NLMSG_LENGTH(GENL_HDRLEN);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1532
do_nl_req(fd, nh, off, 0);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
218
static int do_nl_req(int fd, struct nlmsghdr *nh, int len, int max)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
222
void *data = nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
228
nh->nlmsg_flags |= NLM_F_ACK;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
232
nh->nlmsg_len = len;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
243
for (; NLMSG_OK(nh, rem); nh = NLMSG_NEXT(nh, rem)) {
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
244
if (nh->nlmsg_type == NLMSG_DONE)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
247
if (nh->nlmsg_type == NLMSG_ERROR && nl_error(nh))
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
329
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
335
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
345
do_nl_req(fd, nh, off, sizeof(data));
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
356
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
367
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
456
do_nl_req(fd, nh, off, 0);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
468
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
482
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
50
struct nlmsghdr *nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
54
nh->nlmsg_type = family;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
55
nh->nlmsg_flags = NLM_F_REQUEST;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
56
nh->nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
57
off += NLMSG_ALIGN(sizeof(*nh));
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
590
do_nl_req(fd, nh, off, 0);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
600
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
608
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
640
do_nl_req(fd, nh, off, 0);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
653
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
66
static int nl_error(struct nlmsghdr *nh)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
660
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
68
struct nlmsgerr *err = (struct nlmsgerr *)NLMSG_DATA(nh);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
69
int len = nh->nlmsg_len - sizeof(*nh);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
766
do_nl_req(fd, nh, off, 0);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
777
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
786
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
80
struct rtattr *attrs = (struct rtattr *)NLMSG_DATA(nh);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
902
do_nl_req(fd, nh, off, 0);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
912
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
919
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
970
do_nl_req(fd, nh, off, 0);
tools/testing/selftests/net/msg_zerocopy.c
497
} nh;
tools/testing/selftests/net/msg_zerocopy.c
532
iov[1].iov_len = setup_iph(&nh.iph, cfg_payload_len);
tools/testing/selftests/net/msg_zerocopy.c
534
iov[1].iov_len = setup_ip6h(&nh.ip6h, cfg_payload_len);
tools/testing/selftests/net/msg_zerocopy.c
536
iov[1].iov_base = (void *) &nh;
tools/testing/selftests/net/tap.c
106
rtattr_add_str(&req.nh, IFLA_IFNAME, dev);
tools/testing/selftests/net/tap.c
109
ret = fill_rtattr(&req.nh);
tools/testing/selftests/net/tap.c
114
link_info = rtattr_begin(&req.nh, IFLA_LINKINFO);
tools/testing/selftests/net/tap.c
116
rtattr_add_str(&req.nh, IFLA_INFO_KIND, link_type);
tools/testing/selftests/net/tap.c
119
info_data = rtattr_begin(&req.nh, IFLA_INFO_DATA);
tools/testing/selftests/net/tap.c
120
ret = fill_info_data(&req.nh);
tools/testing/selftests/net/tap.c
123
rtattr_end(&req.nh, info_data);
tools/testing/selftests/net/tap.c
126
rtattr_end(&req.nh, link_info);
tools/testing/selftests/net/tap.c
128
ret = send(rtnl, &req, req.nh.nlmsg_len, 0);
tools/testing/selftests/net/tap.c
131
ret = (unsigned int)ret != req.nh.nlmsg_len;
tools/testing/selftests/net/tap.c
140
struct nlmsghdr nh;
tools/testing/selftests/net/tap.c
153
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/tap.c
154
req.nh.nlmsg_flags = NLM_F_REQUEST;
tools/testing/selftests/net/tap.c
155
req.nh.nlmsg_type = RTM_DELLINK;
tools/testing/selftests/net/tap.c
159
rtattr_add_str(&req.nh, IFLA_IFNAME, dev);
tools/testing/selftests/net/tap.c
161
ret = send(rtnl, &req, req.nh.nlmsg_len, 0);
tools/testing/selftests/net/tap.c
165
ret = (unsigned int)ret != req.nh.nlmsg_len;
tools/testing/selftests/net/tap.c
171
static int macvtap_fill_rtattr(struct nlmsghdr *nh)
tools/testing/selftests/net/tap.c
181
rtattr_add_any(nh, IFLA_LINK, &ifindex, sizeof(ifindex));
tools/testing/selftests/net/tap.c
182
rtattr_add_any(nh, IFLA_ADDRESS, param_hwaddr_src, ETH_ALEN);
tools/testing/selftests/net/tap.c
33
static struct rtattr *rtattr_add(struct nlmsghdr *nh, unsigned short type,
tools/testing/selftests/net/tap.c
37
(struct rtattr *)((uint8_t *)nh + RTA_ALIGN(nh->nlmsg_len));
tools/testing/selftests/net/tap.c
40
nh->nlmsg_len = RTA_ALIGN(nh->nlmsg_len) + RTA_ALIGN(rta->rta_len);
tools/testing/selftests/net/tap.c
44
static struct rtattr *rtattr_begin(struct nlmsghdr *nh, unsigned short type)
tools/testing/selftests/net/tap.c
46
return rtattr_add(nh, type, 0);
tools/testing/selftests/net/tap.c
49
static void rtattr_end(struct nlmsghdr *nh, struct rtattr *attr)
tools/testing/selftests/net/tap.c
51
uint8_t *end = (uint8_t *)nh + nh->nlmsg_len;
tools/testing/selftests/net/tap.c
56
static struct rtattr *rtattr_add_str(struct nlmsghdr *nh, unsigned short type,
tools/testing/selftests/net/tap.c
62
rta = rtattr_add(nh, type, strsz);
tools/testing/selftests/net/tap.c
68
static struct rtattr *rtattr_add_any(struct nlmsghdr *nh, unsigned short type,
tools/testing/selftests/net/tap.c
71
struct rtattr *rta = rtattr_add(nh, type, len);
tools/testing/selftests/net/tap.c
78
int (*fill_rtattr)(struct nlmsghdr *nh),
tools/testing/selftests/net/tap.c
79
int (*fill_info_data)(struct nlmsghdr *nh))
tools/testing/selftests/net/tap.c
82
struct nlmsghdr nh;
tools/testing/selftests/net/tap.c
96
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/tap.c
97
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE;
tools/testing/selftests/net/tap.c
98
req.nh.nlmsg_type = RTM_NEWLINK;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
102
static inline void rtattr_end(struct nlmsghdr *nh, struct rtattr *attr)
tools/testing/selftests/net/tcp_ao/lib/netlink.c
104
char *nlmsg_end = (char *)nh + nh->nlmsg_len;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
109
static int veth_pack_peerb(struct nlmsghdr *nh, size_t req_sz,
tools/testing/selftests/net/tcp_ao/lib/netlink.c
119
peer_attr = _rtattr_begin(nh, req_sz, VETH_INFO_PEER, &pi, sizeof(pi));
tools/testing/selftests/net/tcp_ao/lib/netlink.c
123
if (rtattr_pack(nh, req_sz, IFLA_IFNAME, peer, strlen(peer)))
tools/testing/selftests/net/tcp_ao/lib/netlink.c
126
if (rtattr_pack(nh, req_sz, IFLA_NET_NS_FD, &ns, sizeof(ns)))
tools/testing/selftests/net/tcp_ao/lib/netlink.c
129
rtattr_end(nh, peer_attr);
tools/testing/selftests/net/tcp_ao/lib/netlink.c
139
struct nlmsghdr nh;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
147
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/tcp_ao/lib/netlink.c
148
req.nh.nlmsg_type = RTM_NEWLINK;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
149
req.nh.nlmsg_flags = flags;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
150
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
154
if (rtattr_pack(&req.nh, sizeof(req), IFLA_IFNAME, name, strlen(name)))
tools/testing/selftests/net/tcp_ao/lib/netlink.c
157
if (rtattr_pack(&req.nh, sizeof(req), IFLA_NET_NS_FD, &ns_a, sizeof(ns_a)))
tools/testing/selftests/net/tcp_ao/lib/netlink.c
160
link_info = rtattr_begin(&req.nh, sizeof(req), IFLA_LINKINFO);
tools/testing/selftests/net/tcp_ao/lib/netlink.c
164
if (rtattr_pack(&req.nh, sizeof(req), IFLA_INFO_KIND, veth_type, sizeof(veth_type)))
tools/testing/selftests/net/tcp_ao/lib/netlink.c
167
info_data = rtattr_begin(&req.nh, sizeof(req), IFLA_INFO_DATA);
tools/testing/selftests/net/tcp_ao/lib/netlink.c
171
if (veth_pack_peerb(&req.nh, sizeof(req), name, ns_b))
tools/testing/selftests/net/tcp_ao/lib/netlink.c
174
rtattr_end(&req.nh, info_data);
tools/testing/selftests/net/tcp_ao/lib/netlink.c
175
rtattr_end(&req.nh, link_info);
tools/testing/selftests/net/tcp_ao/lib/netlink.c
177
if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/tcp_ao/lib/netlink.c
202
struct nlmsghdr nh;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
210
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/tcp_ao/lib/netlink.c
211
req.nh.nlmsg_type = RTM_NEWADDR;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
212
req.nh.nlmsg_flags = flags;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
213
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
219
if (rtattr_pack(&req.nh, sizeof(req), IFA_LOCAL, &addr, addr_len))
tools/testing/selftests/net/tcp_ao/lib/netlink.c
222
if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/tcp_ao/lib/netlink.c
249
struct nlmsghdr nh;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
258
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.rt));
tools/testing/selftests/net/tcp_ao/lib/netlink.c
259
req.nh.nlmsg_type = RTM_NEWROUTE;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
260
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
261
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
269
if (rtattr_pack(&req.nh, sizeof(req), RTA_DST, &dst, addr_len))
tools/testing/selftests/net/tcp_ao/lib/netlink.c
272
if (rtattr_pack(&req.nh, sizeof(req), RTA_PREFSRC, &src, addr_len))
tools/testing/selftests/net/tcp_ao/lib/netlink.c
275
if (rtattr_pack(&req.nh, sizeof(req), RTA_OIF, &index, sizeof(index)))
tools/testing/selftests/net/tcp_ao/lib/netlink.c
278
if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/tcp_ao/lib/netlink.c
311
struct nlmsghdr nh;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
317
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/tcp_ao/lib/netlink.c
318
req.nh.nlmsg_type = RTM_NEWLINK;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
319
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
320
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
327
if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/tcp_ao/lib/netlink.c
353
struct nlmsghdr nh;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
361
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/tcp_ao/lib/netlink.c
362
req.nh.nlmsg_type = RTM_NEWLINK;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
363
req.nh.nlmsg_flags = flags;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
364
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
369
if (rtattr_pack(&req.nh, sizeof(req), IFLA_IFNAME, name, strlen(name)))
tools/testing/selftests/net/tcp_ao/lib/netlink.c
373
if (rtattr_pack(&req.nh, sizeof(req), IFLA_NET_NS_FD,
tools/testing/selftests/net/tcp_ao/lib/netlink.c
377
link_info = rtattr_begin(&req.nh, sizeof(req), IFLA_LINKINFO);
tools/testing/selftests/net/tcp_ao/lib/netlink.c
381
if (rtattr_pack(&req.nh, sizeof(req), IFLA_INFO_KIND, vrf_type, sizeof(vrf_type)))
tools/testing/selftests/net/tcp_ao/lib/netlink.c
384
info_data = rtattr_begin(&req.nh, sizeof(req), IFLA_INFO_DATA);
tools/testing/selftests/net/tcp_ao/lib/netlink.c
388
if (rtattr_pack(&req.nh, sizeof(req), IFLA_VRF_TABLE,
tools/testing/selftests/net/tcp_ao/lib/netlink.c
392
rtattr_end(&req.nh, info_data);
tools/testing/selftests/net/tcp_ao/lib/netlink.c
393
rtattr_end(&req.nh, link_info);
tools/testing/selftests/net/tcp_ao/lib/netlink.c
395
if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/tcp_ao/lib/netlink.c
60
static inline struct rtattr *rtattr_hdr(struct nlmsghdr *nh)
tools/testing/selftests/net/tcp_ao/lib/netlink.c
62
return (struct rtattr *)((char *)(nh) + RTA_ALIGN((nh)->nlmsg_len));
tools/testing/selftests/net/tcp_ao/lib/netlink.c
65
static int rtattr_pack(struct nlmsghdr *nh, size_t req_sz,
tools/testing/selftests/net/tcp_ao/lib/netlink.c
69
struct rtattr *attr = rtattr_hdr(nh);
tools/testing/selftests/net/tcp_ao/lib/netlink.c
70
size_t nl_size = RTA_ALIGN(nh->nlmsg_len) + RTA_LENGTH(size);
tools/testing/selftests/net/tcp_ao/lib/netlink.c
76
nh->nlmsg_len = nl_size;
tools/testing/selftests/net/tcp_ao/lib/netlink.c
85
static struct rtattr *_rtattr_begin(struct nlmsghdr *nh, size_t req_sz,
tools/testing/selftests/net/tcp_ao/lib/netlink.c
88
struct rtattr *ret = rtattr_hdr(nh);
tools/testing/selftests/net/tcp_ao/lib/netlink.c
90
if (rtattr_pack(nh, req_sz, rta_type, payload, size))
tools/testing/selftests/net/tcp_ao/lib/netlink.c
96
static inline struct rtattr *rtattr_begin(struct nlmsghdr *nh, size_t req_sz,
tools/testing/selftests/net/tcp_ao/lib/netlink.c
99
return _rtattr_begin(nh, req_sz, rta_type, 0, 0);