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
4672
struct drbd_notification_header nh = {
drivers/block/drbd/drbd_nl.c
4676
return drbd_notification_header_to_skb(msg, &nh);
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
188
ret = blocking_notifier_chain_unregister(&iqs621_als->iqs62x->nh,
drivers/iio/light/iqs621-als.c
566
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
1238
return atomic_notifier_chain_register(&eqt->nh[nb->event_type], &nb->nb);
drivers/net/ethernet/mellanox/mlx5/core/eq.c
1246
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
333
if (fi->nh)
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
159
free_irq(irq->map.virq, &irq->nh);
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
214
static irqreturn_t irq_int_handler(int irq, void *nh)
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
216
atomic_notifier_call_chain(nh, 0, NULL);
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
284
ATOMIC_INIT_NOTIFIER_HEAD(&irq->nh);
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
288
&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
311
free_irq(irq->map.virq, &irq->nh);
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
336
ret = atomic_notifier_chain_register(&irq->nh, nb);
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
346
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
3095
mlxsw_sp_nexthop_dev(const struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3097
if (!nh->crif)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3099
return nh->crif->key.dev;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3200
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3202
struct mlxsw_sp_nexthop_group *nh_grp = nh->nhgi->nh_grp;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3206
nhct = xa_load(&nh_grp->nhgi->nexthop_counters, nh->id);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3216
err = xa_err(xa_store(&nh_grp->nhgi->nexthop_counters, nh->id, nhct,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3229
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3231
struct mlxsw_sp_nexthop_group *nh_grp = nh->nhgi->nh_grp;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3234
nhct = xa_load(&nh_grp->nhgi->nexthop_counters, nh->id);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3241
xa_erase(&nh_grp->nhgi->nexthop_counters, nh->id);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3246
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3253
if (nh->counter)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3258
if (!(nh->nhgi->hw_stats || dpipe_stats))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3261
if (nh->id)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3262
nhct = mlxsw_sp_nexthop_sh_counter_get(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3268
nh->counter = nhct;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3273
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3275
if (!nh->counter)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3278
if (nh->id)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3279
mlxsw_sp_nexthop_sh_counter_put(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3281
mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh->counter);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3282
nh->counter = NULL;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3286
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3288
if (nh->nhgi->hw_stats)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3289
return mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3290
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3295
struct mlxsw_sp_nexthop *nh, u64 *p_counter)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3297
if (!nh->counter)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3300
return mlxsw_sp_flow_counter_get(mlxsw_sp, nh->counter->counter_index,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3305
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3307
if (!nh) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3312
typeof(*nh), router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3314
if (list_is_last(&nh->router_list_node, &router->nexthop_list))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3316
return list_next_entry(nh, router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3319
bool mlxsw_sp_nexthop_is_forward(const struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3321
return nh->offloaded && nh->action == MLXSW_SP_NEXTHOP_ACTION_FORWARD;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3324
unsigned char *mlxsw_sp_nexthop_ha(struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3326
if (nh->type != MLXSW_SP_NEXTHOP_TYPE_ETH ||
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3327
!mlxsw_sp_nexthop_is_forward(nh))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3329
return nh->neigh_entry->ha;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3332
int mlxsw_sp_nexthop_indexes(struct mlxsw_sp_nexthop *nh, u32 *p_adj_index,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3335
struct mlxsw_sp_nexthop_group_info *nhgi = nh->nhgi;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3339
if (!nh->offloaded || !nhgi->adj_index_valid)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3348
if (nh_iter == nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3358
struct mlxsw_sp_rif *mlxsw_sp_nexthop_rif(struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3360
if (WARN_ON(!nh->crif))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3362
return nh->crif->rif;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3365
bool mlxsw_sp_nexthop_group_has_ipip(struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3367
struct mlxsw_sp_nexthop_group_info *nhgi = nh->nhgi;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3486
const struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3488
nh = &nh_grp->nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3489
if (nh->ifindex == ifindex && nh->nh_weight == weight &&
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3490
ipv6_addr_equal(gw, (struct in6_addr *) nh->gw_addr))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3548
const struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3560
nh = &nh_grp->nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3561
val ^= jhash(&nh->ifindex, sizeof(nh->ifindex), seed);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3562
val ^= jhash(&nh->gw_addr, sizeof(nh->gw_addr), seed);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3673
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3676
&nh->ht_node, mlxsw_sp_nexthop_ht_params);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3680
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3682
rhashtable_remove_fast(&mlxsw_sp->router->nexthop_ht, &nh->ht_node,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3743
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3746
struct mlxsw_sp_neigh_entry *neigh_entry = nh->neigh_entry;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3747
struct mlxsw_sp_rif *rif = mlxsw_sp_nexthop_rif(nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3757
switch (nh->action) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3774
if (nh->counter)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3775
mlxsw_reg_ratr_counter_pack(ratr_pl, nh->counter->counter_index,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3784
struct mlxsw_sp_nexthop *nh, bool force,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3789
for (i = 0; i < nh->num_adj_entries; i++) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3793
nh, force, ratr_pl);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3803
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3808
ipip_ops = mlxsw_sp->router->ipip_ops_arr[nh->ipip_entry->ipipt];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3809
return ipip_ops->nexthop_update(mlxsw_sp, adj_index, nh->ipip_entry,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3815
struct mlxsw_sp_nexthop *nh, bool force,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3820
for (i = 0; i < nh->num_adj_entries; i++) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3824
nh, force, ratr_pl);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3833
struct mlxsw_sp_nexthop *nh, bool force,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3839
if (nh->type == MLXSW_SP_NEXTHOP_TYPE_ETH ||
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3840
nh->action == MLXSW_SP_NEXTHOP_ACTION_DISCARD ||
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3841
nh->action == MLXSW_SP_NEXTHOP_ACTION_TRAP)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3842
return mlxsw_sp_nexthop_eth_update(mlxsw_sp, adj_index, nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3845
return mlxsw_sp_nexthop_ipip_update(mlxsw_sp, adj_index, nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3856
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3860
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3862
if (!nh->should_offload) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3863
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3864
nh->offloaded = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3868
if (nh->update || reallocate) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3871
err = mlxsw_sp_nexthop_counter_update(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3875
err = mlxsw_sp_nexthop_update(mlxsw_sp, adj_index, nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3879
nh->update = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3880
nh->offloaded = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3882
adj_index += nh->num_adj_entries;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3995
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
3998
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4000
if (!nh->should_offload)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4003
g = gcd(nh->nh_weight, g);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4005
g = nh->nh_weight;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4009
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4011
if (!nh->should_offload)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4013
nh->norm_nh_weight = nh->nh_weight / g;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4014
sum_norm_weight += nh->norm_nh_weight;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4028
struct mlxsw_sp_nexthop *nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4031
if (!nh->should_offload)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4033
weight += nh->norm_nh_weight;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4035
nh->num_adj_entries = upper_bound - lower_bound;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4051
struct mlxsw_sp_nexthop *nh = &nh_grp->nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4053
if (nh->offloaded)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4054
nh->key.fib_nh->fib_nh_flags |= RTNH_F_OFFLOAD;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4056
nh->key.fib_nh->fib_nh_flags &= ~RTNH_F_OFFLOAD;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4068
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4070
nh = mlxsw_sp_rt6_nexthop(nh_grp, mlxsw_sp_rt6);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4071
if (nh && nh->offloaded)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4095
const struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4098
struct mlxsw_sp_nexthop_group *nh_grp = nh->nhgi->nh_grp;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4101
if (nh->offloaded) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4102
if (nh->action == MLXSW_SP_NEXTHOP_ACTION_TRAP)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4138
struct mlxsw_sp_nexthop *nh = &nh_grp->nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4140
mlxsw_sp_nexthop_bucket_offload_refresh(mlxsw_sp, nh, i);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4167
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4178
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4180
if (nh->should_offload != nh->offloaded) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4182
if (nh->should_offload)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4183
nh->update = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4267
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4268
nh->offloaded = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4280
static void __mlxsw_sp_nexthop_neigh_update(struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4284
nh->action = MLXSW_SP_NEXTHOP_ACTION_FORWARD;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4285
nh->should_offload = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4286
} else if (nh->nhgi->is_resilient) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4287
nh->action = MLXSW_SP_NEXTHOP_ACTION_TRAP;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4288
nh->should_offload = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4290
nh->should_offload = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4292
nh->update = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4300
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4306
nh = list_first_entry(&neigh_entry->nexthop_list,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4308
dev = mlxsw_sp_nexthop_dev(nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4310
n = neigh_lookup(nh->neigh_tbl, &nh->gw_addr, dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4312
n = neigh_create(nh->neigh_tbl, &nh->gw_addr, dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4332
list_for_each_entry(nh, &neigh_entry->nexthop_list,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4334
__mlxsw_sp_nexthop_neigh_update(nh, !entry_connected);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4335
mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nhgi->nh_grp);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4352
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4367
list_for_each_entry(nh, &neigh_entry->nexthop_list,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4369
__mlxsw_sp_nexthop_neigh_update(nh, removing);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4370
mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nhgi->nh_grp);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4374
static void mlxsw_sp_nexthop_crif_init(struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4377
if (nh->crif)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4380
nh->crif = crif;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4381
list_add(&nh->crif_list_node, &crif->nexthop_list);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4384
static void mlxsw_sp_nexthop_crif_fini(struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4386
if (!nh->crif)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4389
list_del(&nh->crif_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4390
nh->crif = NULL;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4394
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4402
if (WARN_ON(!nh->crif->rif))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4405
if (!nh->nhgi->gateway || nh->neigh_entry)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4407
dev = mlxsw_sp_nexthop_dev(nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4414
n = neigh_lookup(nh->neigh_tbl, &nh->gw_addr, dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4416
n = neigh_create(nh->neigh_tbl, &nh->gw_addr, dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4442
nh->neigh_entry = neigh_entry;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4443
list_add_tail(&nh->neigh_list_node, &neigh_entry->nexthop_list);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4448
__mlxsw_sp_nexthop_neigh_update(nh, !(nud_state & NUD_VALID && !dead));
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4458
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4460
struct mlxsw_sp_neigh_entry *neigh_entry = nh->neigh_entry;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4465
__mlxsw_sp_nexthop_neigh_update(nh, true);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4466
list_del(&nh->neigh_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4467
nh->neigh_entry = NULL;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4493
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4499
if (!nh->nhgi->gateway || nh->ipip_entry)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4506
nh->ipip_entry = ipip_entry;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4508
__mlxsw_sp_nexthop_neigh_update(nh, removing);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4509
mlxsw_sp_nexthop_crif_init(nh, crif);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4513
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4515
struct mlxsw_sp_ipip_entry *ipip_entry = nh->ipip_entry;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4520
__mlxsw_sp_nexthop_neigh_update(nh, true);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4521
nh->ipip_entry = NULL;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4536
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4548
nh->type = MLXSW_SP_NEXTHOP_TYPE_IPIP;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4549
mlxsw_sp_nexthop_ipip_init(mlxsw_sp, nh, ipip_entry);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4554
nh->type = MLXSW_SP_NEXTHOP_TYPE_ETH;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4559
mlxsw_sp_nexthop_crif_init(nh, crif);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4564
err = mlxsw_sp_nexthop_neigh_init(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4571
mlxsw_sp_nexthop_crif_fini(nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4576
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4578
switch (nh->type) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4580
return mlxsw_sp_nexthop_neigh_init(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4589
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4591
switch (nh->type) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4593
mlxsw_sp_nexthop_neigh_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4596
mlxsw_sp_nexthop_ipip_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4602
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4604
mlxsw_sp_nexthop_type_rif_gone(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4605
mlxsw_sp_nexthop_crif_fini(nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4610
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4617
nh->nhgi = nh_grp->nhgi;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4618
nh->key.fib_nh = fib_nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4620
nh->nh_weight = fib_nh->fib_nh_weight;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4622
nh->nh_weight = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4624
memcpy(&nh->gw_addr, &fib_nh->fib_nh_gw4, sizeof(fib_nh->fib_nh_gw4));
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4625
nh->neigh_tbl = &arp_tbl;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4626
err = mlxsw_sp_nexthop_insert(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4630
err = mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4634
list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4638
nh->ifindex = dev->ifindex;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4649
err = mlxsw_sp_nexthop_type_init(mlxsw_sp, nh, dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4656
list_del(&nh->router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4657
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4659
mlxsw_sp_nexthop_remove(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4664
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4666
mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4667
list_del(&nh->router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4668
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4669
mlxsw_sp_nexthop_remove(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4676
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4679
nh = mlxsw_sp_nexthop_lookup(mlxsw_sp, key);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4680
if (!nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4685
mlxsw_sp_nexthop_type_init(mlxsw_sp, nh, fib_nh->fib_nh_dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4688
mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4692
mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nhgi->nh_grp);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4699
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4702
list_for_each_entry(nh, &rif->crif->nexthop_list, crif_list_node) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4703
switch (nh->type) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4715
__mlxsw_sp_nexthop_neigh_update(nh, removing);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4716
mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nhgi->nh_grp);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4723
struct mlxsw_sp_nexthop *nh, *tmp;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4727
list_for_each_entry_safe(nh, tmp, &rif->crif->nexthop_list,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4729
err = mlxsw_sp_nexthop_type_rif_made(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4732
mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nhgi->nh_grp);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4739
list_for_each_entry_safe(nh, tmp, &rif->crif->nexthop_list,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4743
mlxsw_sp_nexthop_type_rif_gone(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4744
mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nhgi->nh_grp);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4752
struct mlxsw_sp_nexthop *nh, *tmp;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4754
list_for_each_entry_safe(nh, tmp, &rif->crif->nexthop_list,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4756
mlxsw_sp_nexthop_type_rif_gone(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4757
mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nhgi->nh_grp);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4902
const struct nh_notifier_single_info *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4907
if (nh->is_fdb)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4909
else if (nh->has_encap)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4919
const struct nh_notifier_single_info *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4924
err = mlxsw_sp_nexthop_obj_single_validate(mlxsw_sp, nh, extack);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4931
if (!nh->gw_family && !nh->is_reject &&
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4932
!mlxsw_sp_netdev_ipip_type(mlxsw_sp, nh->dev, NULL)) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4953
const struct nh_notifier_single_info *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4956
nh = &nh_grp->nh_entries[i].nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
4957
err = mlxsw_sp_nexthop_obj_group_entry_validate(mlxsw_sp, nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5024
const struct nh_notifier_single_info *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5027
nh = &nh_res_table->nhs[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5028
err = mlxsw_sp_nexthop_obj_group_entry_validate(mlxsw_sp, nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5041
struct nh_notifier_single_info *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5050
return mlxsw_sp_nexthop_obj_single_validate(mlxsw_sp, info->nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5061
nh = &info->nh_res_bucket->new_nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5062
return mlxsw_sp_nexthop_obj_group_entry_validate(mlxsw_sp, nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5077
dev = info->nh->dev;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5078
return info->nh->gw_family || info->nh->is_reject ||
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5090
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5092
nh->action = MLXSW_SP_NEXTHOP_ACTION_DISCARD;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5093
nh->should_offload = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5098
nh->crif = mlxsw_sp->router->lb_crif;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5102
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5104
nh->crif = NULL;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5105
nh->should_offload = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5111
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5117
nh->nhgi = nh_grp->nhgi;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5118
nh->nh_weight = weight;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5122
memcpy(&nh->gw_addr, &nh_obj->ipv4, sizeof(nh_obj->ipv4));
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5123
nh->neigh_tbl = &arp_tbl;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5126
memcpy(&nh->gw_addr, &nh_obj->ipv6, sizeof(nh_obj->ipv6));
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5128
nh->neigh_tbl = &nd_tbl;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5133
list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5134
nh->ifindex = dev->ifindex;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5135
nh->id = nh_obj->id;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5137
err = mlxsw_sp_nexthop_type_init(mlxsw_sp, nh, dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5142
mlxsw_sp_nexthop_obj_blackhole_init(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5148
if (nh_grp->nhgi->is_resilient && !nh->should_offload) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5149
nh->action = MLXSW_SP_NEXTHOP_ACTION_TRAP;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5150
nh->should_offload = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5156
list_del(&nh->router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5161
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5163
if (nh->action == MLXSW_SP_NEXTHOP_ACTION_DISCARD)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5164
mlxsw_sp_nexthop_obj_blackhole_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5165
mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5166
list_del(&nh->router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5167
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5168
nh->should_offload = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5177
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5216
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5219
nh_obj = info->nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5223
nh_obj = &info->nh_grp->nh_entries[i].nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5234
err = mlxsw_sp_nexthop_obj_init(mlxsw_sp, nh_grp, nh, nh_obj,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5265
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5266
mlxsw_sp_nexthop_obj_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5288
struct mlxsw_sp_nexthop *nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5290
mlxsw_sp_nexthop_obj_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5455
struct mlxsw_sp_nexthop *nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5457
if (nh->offloaded)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5458
nh->update = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5550
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5568
adj_index = nh->nhgi->adj_index + bucket_index;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5569
err = mlxsw_sp_nexthop_update(mlxsw_sp, adj_index, nh, force, ratr_pl);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5590
nh->update = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5591
nh->offloaded = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5592
mlxsw_sp_nexthop_bucket_offload_refresh(mlxsw_sp, nh, bucket_index);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5605
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5621
nh = &nhgi->nexthops[bucket_index];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5622
mlxsw_sp_nexthop_obj_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5625
err = mlxsw_sp_nexthop_obj_init(mlxsw_sp, nh_grp, nh, nh_obj, 1);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5631
err = mlxsw_sp_nexthop_obj_bucket_adj_update(mlxsw_sp, nh, info);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5638
mlxsw_sp_nexthop_obj_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5641
mlxsw_sp_nexthop_obj_init(mlxsw_sp, nh_grp, nh, nh_obj, 1);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5643
nh->update = 0;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5644
nh->offloaded = 1;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5656
struct mlxsw_sp_nexthop *nh = &nhgi->nexthops[nhi];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5660
err = mlxsw_sp_nexthop_counter_get(mlxsw_sp, nh, &packets);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5677
struct mlxsw_sp_nexthop *nh = &nhgi->nexthops[bucket];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5681
if (nhi == -1 || info->stats[nhi].id != nh->id) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5683
if (info->stats[nhi].id == nh->id)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5691
err = mlxsw_sp_nexthop_counter_get(mlxsw_sp, nh, &packets);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5766
const struct fib_nh *nh = fib_info_nh(fi, 0);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5768
return nh->fib_nh_gw_family ||
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5769
mlxsw_sp_nexthop4_ipip_type(mlxsw_sp, nh, NULL);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5778
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5791
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5793
err = mlxsw_sp_nexthop4_init(mlxsw_sp, nh_grp, nh, fib_nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5812
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5813
mlxsw_sp_nexthop4_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5828
struct mlxsw_sp_nexthop *nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5830
mlxsw_sp_nexthop4_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5898
if (fi->nh) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5900
fi->nh->id);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5980
struct mlxsw_sp_nexthop *nh = &nh_grp->nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5981
struct net_device *dev = mlxsw_sp_nexthop_dev(nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5985
ipv6_addr_equal((const struct in6_addr *) &nh->gw_addr,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
5987
return nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6821
if (fen_info->fi->nh &&
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6822
!mlxsw_sp_nexthop_obj_group_lookup(mlxsw_sp, fen_info->fi->nh->id))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6937
if (!mlxsw_sp_rt6->rt->nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6974
struct mlxsw_sp_nexthop *nh,
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6980
nh->nhgi = nh_grp->nhgi;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6981
nh->nh_weight = rt->fib6_nh->fib_nh_weight;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6982
memcpy(&nh->gw_addr, &rt->fib6_nh->fib_nh_gw6, sizeof(nh->gw_addr));
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6984
nh->neigh_tbl = &nd_tbl;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6987
err = mlxsw_sp_nexthop_counter_enable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6991
list_add_tail(&nh->router_list_node, &mlxsw_sp->router->nexthop_list);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6995
nh->ifindex = dev->ifindex;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
6997
err = mlxsw_sp_nexthop_type_init(mlxsw_sp, nh, dev);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7004
list_del(&nh->router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7005
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7010
struct mlxsw_sp_nexthop *nh)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7012
mlxsw_sp_nexthop_type_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7013
list_del(&nh->router_list_node);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7014
mlxsw_sp_nexthop_counter_disable(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7031
struct mlxsw_sp_nexthop *nh;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7046
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7047
err = mlxsw_sp_nexthop6_init(mlxsw_sp, nh_grp, nh, rt);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7068
nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7069
mlxsw_sp_nexthop6_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7084
struct mlxsw_sp_nexthop *nh = &nhgi->nexthops[i];
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7086
mlxsw_sp_nexthop6_fini(mlxsw_sp, nh);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7151
if (rt->nh) {
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7153
rt->nh->id);
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
7519
if (rt->nh && !mlxsw_sp_nexthop_obj_group_lookup(mlxsw_sp, rt->nh->id))
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
9790
struct mlxsw_sp_nexthop *nh, *tmp;
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
9794
list_for_each_entry_safe(nh, tmp, &crif->nexthop_list, crif_list_node)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
9795
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
2258
const struct fib_nh *nh;
drivers/net/ethernet/rocker/rocker_ofdpa.c
2273
nh = fib_info_nh(fi, 0);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2274
nh_on_port = (nh->fib_nh_dev == ofdpa_port->dev);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2275
has_gw = !!nh->fib_nh_gw4;
drivers/net/ethernet/rocker/rocker_ofdpa.c
2279
nh->fib_nh_gw4, &index);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2712
struct fib_nh *nh;
drivers/net/ethernet/rocker/rocker_ofdpa.c
2717
nh = fib_info_nh(fen_info->fi, 0);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2718
ofdpa_port = ofdpa_port_dev_lower_find(nh->fib_nh_dev, rocker);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2726
nh->fib_nh_flags |= RTNH_F_OFFLOAD;
drivers/net/ethernet/rocker/rocker_ofdpa.c
2735
struct fib_nh *nh;
drivers/net/ethernet/rocker/rocker_ofdpa.c
2739
nh = fib_info_nh(fen_info->fi, 0);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2740
ofdpa_port = ofdpa_port_dev_lower_find(nh->fib_nh_dev, rocker);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2743
nh->fib_nh_flags &= ~RTNH_F_OFFLOAD;
drivers/net/ethernet/rocker/rocker_ofdpa.c
2763
struct fib_nh *nh;
drivers/net/ethernet/rocker/rocker_ofdpa.c
2768
nh = fib_info_nh(flow_entry->fi, 0);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2769
ofdpa_port = ofdpa_port_dev_lower_find(nh->fib_nh_dev, rocker);
drivers/net/ethernet/rocker/rocker_ofdpa.c
2772
nh->fib_nh_flags &= ~RTNH_F_OFFLOAD;
drivers/net/geneve.c
275
int nh, err = 0;
drivers/net/geneve.c
333
nh = skb_network_header(skb) - skb->head;
drivers/net/geneve.c
344
oiph = skb->head + nh;
drivers/net/geneve.c
822
void *nested, *nested2, *nh, *nh2;
drivers/net/geneve.c
852
nh = nested + gro_hint->nested_nh_offset;
drivers/net/geneve.c
855
struct ipv6hdr *iph = nh, *iph2 = nh2;
drivers/net/geneve.c
873
struct iphdr *iph = nh, *iph2 = nh2;
drivers/net/vxlan/vxlan_core.c
1352
if (rcu_access_pointer(f->nh)) {
drivers/net/vxlan/vxlan_core.c
1453
if (rcu_access_pointer(f->nh))
drivers/net/vxlan/vxlan_core.c
164
struct nexthop *nh;
drivers/net/vxlan/vxlan_core.c
1659
int nh;
drivers/net/vxlan/vxlan_core.c
1764
nh = skb_network_header(skb) - skb->head;
drivers/net/vxlan/vxlan_core.c
1778
oiph = skb->head + nh;
drivers/net/vxlan/vxlan_core.c
179
nh = rcu_dereference(fdb->nh);
drivers/net/vxlan/vxlan_core.c
180
if (nh) {
drivers/net/vxlan/vxlan_core.c
181
nh_family = nexthop_get_family(nh);
drivers/net/vxlan/vxlan_core.c
182
nh_id = nh->id;
drivers/net/vxlan/vxlan_core.c
190
} else if (nh) {
drivers/net/vxlan/vxlan_core.c
210
if (nh) {
drivers/net/vxlan/vxlan_core.c
2660
struct nexthop *nh;
drivers/net/vxlan/vxlan_core.c
2667
nh = rcu_dereference(f->nh);
drivers/net/vxlan/vxlan_core.c
2668
if (!nh)
drivers/net/vxlan/vxlan_core.c
2670
do_xmit = vxlan_fdb_nh_path_select(nh, hash, &nh_rdst);
drivers/net/vxlan/vxlan_core.c
2691
struct nexthop *nh;
drivers/net/vxlan/vxlan_core.c
2699
nh = nexthop_find_by_id(dev_net(dev), nhid);
drivers/net/vxlan/vxlan_core.c
2700
if (unlikely(!nh || !nexthop_is_fdb(nh) || !nexthop_is_multipath(nh))) {
drivers/net/vxlan/vxlan_core.c
2704
do_xmit = vxlan_fdb_nh_path_select(nh, hash, &nh_rdst);
drivers/net/vxlan/vxlan_core.c
2825
if (rcu_access_pointer(f->nh)) {
drivers/net/vxlan/vxlan_core.c
3006
struct nexthop *nh = rtnl_dereference(f->nh);
drivers/net/vxlan/vxlan_core.c
3008
return nh && nh->id == nhid;
drivers/net/vxlan/vxlan_core.c
4896
static void vxlan_fdb_nh_flush(struct nexthop *nh)
drivers/net/vxlan/vxlan_core.c
4902
list_for_each_entry_rcu(fdb, &nh->fdb_list, nh_list) {
drivers/net/vxlan/vxlan_core.c
4917
struct nexthop *nh;
drivers/net/vxlan/vxlan_core.c
4922
nh = nexthop_find_by_id(info->net, info->id);
drivers/net/vxlan/vxlan_core.c
4923
if (!nh)
drivers/net/vxlan/vxlan_core.c
4926
vxlan_fdb_nh_flush(nh);
drivers/net/vxlan/vxlan_core.c
788
f->nh = NULL;
drivers/net/vxlan/vxlan_core.c
800
struct nexthop *old_nh = rtnl_dereference(fdb->nh);
drivers/net/vxlan/vxlan_core.c
801
struct nexthop *nh;
drivers/net/vxlan/vxlan_core.c
807
nh = nexthop_find_by_id(vxlan->net, nhid);
drivers/net/vxlan/vxlan_core.c
808
if (!nh) {
drivers/net/vxlan/vxlan_core.c
813
if (!nexthop_get(nh)) {
drivers/net/vxlan/vxlan_core.c
815
nh = NULL;
drivers/net/vxlan/vxlan_core.c
818
if (!nexthop_is_fdb(nh)) {
drivers/net/vxlan/vxlan_core.c
823
if (!nexthop_is_multipath(nh)) {
drivers/net/vxlan/vxlan_core.c
831
if (!nexthop_has_v4(nh)) {
drivers/net/vxlan/vxlan_core.c
838
if (nexthop_has_v4(nh)) {
drivers/net/vxlan/vxlan_core.c
849
rcu_assign_pointer(fdb->nh, nh);
drivers/net/vxlan/vxlan_core.c
850
list_add_tail_rcu(&fdb->nh_list, &nh->fdb_list);
drivers/net/vxlan/vxlan_core.c
854
if (nh)
drivers/net/vxlan/vxlan_core.c
855
nexthop_put(nh);
drivers/net/vxlan/vxlan_core.c
899
if (rcu_access_pointer(f->nh)) {
drivers/net/vxlan/vxlan_core.c
901
nexthop_put(rtnl_dereference(f->nh));
drivers/net/vxlan/vxlan_core.c
915
struct nexthop *nh;
drivers/net/vxlan/vxlan_core.c
917
nh = rcu_dereference_raw(f->nh);
drivers/net/vxlan/vxlan_core.c
918
if (nh) {
drivers/net/vxlan/vxlan_core.c
919
rcu_assign_pointer(f->nh, NULL);
drivers/net/vxlan/vxlan_core.c
921
nexthop_put(nh);
drivers/net/vxlan/vxlan_core.c
947
if (rcu_access_pointer(f->nh))
drivers/net/vxlan/vxlan_core.c
987
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
804
struct bpf_nh_params nh;
include/linux/filter.h
843
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
136
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
355
if (a->nh || b->nh)
include/net/ip6_route.h
356
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
573
int fib_check_nh(struct net *net, struct fib_nh *nh, u32 table, u8 scope,
include/net/ip_fib.h
605
struct fib_nh *nh;
include/net/ip_fib.h
607
nh = container_of(nhc, struct fib_nh, nh_common);
include/net/ip_fib.h
608
*itag = nh->nh_tclassid << 16;
include/net/ip_fib.h
660
int fib_nexthop_info(struct sk_buff *skb, const struct fib_nh_common *nh,
include/net/ip_fib.h
662
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
565
static inline bool vxlan_fdb_nh_path_select(struct nexthop *nh,
include/net/vxlan.h
571
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
2214
struct net_device *dev, struct bpf_nh_params *nh)
net/core/filter.c
2239
if (!nh) {
net/core/filter.c
2244
nexthop = &nh->ipv6_nh;
net/core/filter.c
2268
struct bpf_nh_params *nh)
net/core/filter.c
2274
if (!nh) {
net/core/filter.c
2292
} else if (nh->nh_family != AF_INET6) {
net/core/filter.c
2296
err = bpf_out_neigh_v6(net, skb, dev, nh);
net/core/filter.c
2310
struct bpf_nh_params *nh)
net/core/filter.c
2319
struct net_device *dev, struct bpf_nh_params *nh)
net/core/filter.c
2340
if (!nh) {
net/core/filter.c
2344
} else if (nh->nh_family == AF_INET6) {
net/core/filter.c
2349
neigh = ip_neigh_gw6(dev, &nh->ipv6_nh);
net/core/filter.c
2351
} else if (nh->nh_family == AF_INET) {
net/core/filter.c
2352
neigh = ip_neigh_gw4(dev, nh->ipv4_nh);
net/core/filter.c
2377
struct bpf_nh_params *nh)
net/core/filter.c
2383
if (!nh) {
net/core/filter.c
2407
err = bpf_out_neigh_v4(net, skb, dev, nh);
net/core/filter.c
2421
struct bpf_nh_params *nh)
net/core/filter.c
2429
struct bpf_nh_params *nh)
net/core/filter.c
2444
return __bpf_redirect_neigh_v4(skb, dev, nh);
net/core/filter.c
2446
return __bpf_redirect_neigh_v6(skb, dev, nh);
net/core/filter.c
2546
&ri->nh : NULL) :
net/core/filter.c
2613
memcpy(&ri->nh, params, sizeof(ri->nh));
net/core/filter.c
6461
if (res.nh->fib_nh_lws)
net/core/filter.c
6464
if (res.nh->fib_nh_gw_family)
net/core/filter.c
6465
*dst = res.nh->fib_nh_gw6;
net/core/filter.c
6467
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
315
if (unlikely(fi->nh)) {
net/ipv4/fib_frontend.c
316
dev_match = nexthop_uses_dev(fi->nh, dev);
net/ipv4/fib_semantics.c
1005
&nh->fib_nh_gw6))
net/ipv4/fib_semantics.c
1018
if (nla_get_u32(nla) != nh->nh_tclassid)
net/ipv4/fib_semantics.c
1071
static int fib_check_nh_v6_gw(struct net *net, struct fib_nh *nh,
net/ipv4/fib_semantics.c
1076
.fc_flags = nh->fib_nh_flags | RTF_GATEWAY,
net/ipv4/fib_semantics.c
1077
.fc_ifindex = nh->fib_nh_oif,
net/ipv4/fib_semantics.c
1078
.fc_gateway = nh->fib_nh_gw6,
net/ipv4/fib_semantics.c
1085
nh->fib_nh_dev = fib6_nh.fib_nh_dev;
net/ipv4/fib_semantics.c
1086
netdev_hold(nh->fib_nh_dev, &nh->fib_nh_dev_tracker,
net/ipv4/fib_semantics.c
1088
nh->fib_nh_oif = nh->fib_nh_dev->ifindex;
net/ipv4/fib_semantics.c
1089
nh->fib_nh_scope = RT_SCOPE_LINK;
net/ipv4/fib_semantics.c
1140
static int fib_check_nh_v4_gw(struct net *net, struct fib_nh *nh, u32 table,
net/ipv4/fib_semantics.c
1147
if (nh->fib_nh_flags & RTNH_F_ONLINK) {
net/ipv4/fib_semantics.c
1154
dev = __dev_get_by_index(net, nh->fib_nh_oif);
net/ipv4/fib_semantics.c
1163
addr_type = inet_addr_type_dev_table(net, dev, nh->fib_nh_gw4);
net/ipv4/fib_semantics.c
1169
nh->fib_nh_flags |= RTNH_F_LINKDOWN;
net/ipv4/fib_semantics.c
1170
nh->fib_nh_dev = dev;
net/ipv4/fib_semantics.c
1171
netdev_hold(dev, &nh->fib_nh_dev_tracker, GFP_ATOMIC);
net/ipv4/fib_semantics.c
1172
nh->fib_nh_scope = RT_SCOPE_LINK;
net/ipv4/fib_semantics.c
1179
.daddr = nh->fib_nh_gw4,
net/ipv4/fib_semantics.c
1181
.flowi4_oif = nh->fib_nh_oif,
net/ipv4/fib_semantics.c
1217
nh->fib_nh_scope = res.scope;
net/ipv4/fib_semantics.c
1218
nh->fib_nh_oif = FIB_RES_OIF(res);
net/ipv4/fib_semantics.c
1219
nh->fib_nh_dev = dev = FIB_RES_DEV(res);
net/ipv4/fib_semantics.c
1225
netdev_hold(dev, &nh->fib_nh_dev_tracker, GFP_ATOMIC);
net/ipv4/fib_semantics.c
1227
nh->fib_nh_flags |= RTNH_F_LINKDOWN;
net/ipv4/fib_semantics.c
1234
static int fib_check_nh_nongw(struct net *net, struct fib_nh *nh,
net/ipv4/fib_semantics.c
1240
if (nh->fib_nh_flags & (RTNH_F_PERVASIVE | RTNH_F_ONLINK)) {
net/ipv4/fib_semantics.c
1249
in_dev = inetdev_by_index(net, nh->fib_nh_oif);
net/ipv4/fib_semantics.c
1258
nh->fib_nh_dev = in_dev->dev;
net/ipv4/fib_semantics.c
1259
netdev_hold(nh->fib_nh_dev, &nh->fib_nh_dev_tracker, GFP_ATOMIC);
net/ipv4/fib_semantics.c
1260
nh->fib_nh_scope = RT_SCOPE_HOST;
net/ipv4/fib_semantics.c
1261
if (!netif_carrier_ok(nh->fib_nh_dev))
net/ipv4/fib_semantics.c
1262
nh->fib_nh_flags |= RTNH_F_LINKDOWN;
net/ipv4/fib_semantics.c
1269
int fib_check_nh(struct net *net, struct fib_nh *nh, u32 table, u8 scope,
net/ipv4/fib_semantics.c
1274
if (nh->fib_nh_gw_family == AF_INET)
net/ipv4/fib_semantics.c
1275
err = fib_check_nh_v4_gw(net, nh, table, scope, extack);
net/ipv4/fib_semantics.c
1276
else if (nh->fib_nh_gw_family == AF_INET6)
net/ipv4/fib_semantics.c
1277
err = fib_check_nh_v6_gw(net, nh, table, extack);
net/ipv4/fib_semantics.c
1279
err = fib_check_nh_nongw(net, nh, extack);
net/ipv4/fib_semantics.c
1287
struct fib_nh *nh;
net/ipv4/fib_semantics.c
1293
nh = container_of(nhc, struct fib_nh, nh_common);
net/ipv4/fib_semantics.c
1294
saddr = inet_select_addr(nh->fib_nh_dev, nh->fib_nh_gw4, scope);
net/ipv4/fib_semantics.c
1296
WRITE_ONCE(nh->nh_saddr, saddr);
net/ipv4/fib_semantics.c
1297
WRITE_ONCE(nh->nh_saddr_genid, atomic_read(&net->ipv4.dev_addr_genid));
net/ipv4/fib_semantics.c
1310
struct fib_nh *nh;
net/ipv4/fib_semantics.c
1312
nh = container_of(nhc, struct fib_nh, nh_common);
net/ipv4/fib_semantics.c
1313
if (READ_ONCE(nh->nh_saddr_genid) ==
net/ipv4/fib_semantics.c
1315
return READ_ONCE(nh->nh_saddr);
net/ipv4/fib_semantics.c
1350
struct nexthop *nh = NULL;
net/ipv4/fib_semantics.c
1380
nh = nexthop_find_by_id(net, cfg->fc_nh_id);
net/ipv4/fib_semantics.c
1381
if (!nh) {
net/ipv4/fib_semantics.c
1421
if (nh) {
net/ipv4/fib_semantics.c
1422
if (!nexthop_get(nh)) {
net/ipv4/fib_semantics.c
1427
fi->nh = nh;
net/ipv4/fib_semantics.c
1470
if (fi->nh) {
net/ipv4/fib_semantics.c
1471
err = fib_check_nexthop(fi->nh, cfg->fc_scope, extack);
net/ipv4/fib_semantics.c
1475
struct fib_nh *nh = fi->fib_nh;
net/ipv4/fib_semantics.c
1483
if (nh->fib_nh_gw_family) {
net/ipv4/fib_semantics.c
1488
nh->fib_nh_scope = RT_SCOPE_NOWHERE;
net/ipv4/fib_semantics.c
1489
nh->fib_nh_dev = dev_get_by_index(net, nh->fib_nh_oif);
net/ipv4/fib_semantics.c
1491
if (!nh->fib_nh_dev)
net/ipv4/fib_semantics.c
1493
netdev_tracker_alloc(nh->fib_nh_dev, &nh->fib_nh_dev_tracker,
net/ipv4/fib_semantics.c
1516
if (!fi->nh) {
net/ipv4/fib_semantics.c
1549
if (fi->nh) {
net/ipv4/fib_semantics.c
1550
list_add(&fi->nh_list, &nh->fi_list);
net/ipv4/fib_semantics.c
1686
if (unlikely(fi->nh)) {
net/ipv4/fib_semantics.c
1687
if (nexthop_mpath_fill_node(skb, fi->nh, AF_INET) < 0)
net/ipv4/fib_semantics.c
1695
nh_tclassid = nh->nh_tclassid;
net/ipv4/fib_semantics.c
1697
if (fib_add_nexthop(skb, &nh->nh_common, nh->fib_nh_weight,
net/ipv4/fib_semantics.c
1759
if (fi->nh) {
net/ipv4/fib_semantics.c
1760
if (nla_put_u32(skb, RTA_NH_ID, fi->nh->id))
net/ipv4/fib_semantics.c
1762
if (nexthop_is_blackhole(fi->nh))
net/ipv4/fib_semantics.c
1778
struct fib_nh *nh;
net/ipv4/fib_semantics.c
1780
nh = container_of(nhc, struct fib_nh, nh_common);
net/ipv4/fib_semantics.c
1781
if (nh->nh_tclassid &&
net/ipv4/fib_semantics.c
1782
nla_put_u32(skb, RTA_FLOW, nh->nh_tclassid))
net/ipv4/fib_semantics.c
1838
static int call_fib_nh_notifiers(struct fib_nh *nh,
net/ipv4/fib_semantics.c
1841
bool ignore_link_down = ip_ignore_linkdown(nh->fib_nh_dev);
net/ipv4/fib_semantics.c
1843
.fib_nh = nh,
net/ipv4/fib_semantics.c
1848
if (nh->fib_nh_flags & RTNH_F_DEAD)
net/ipv4/fib_semantics.c
1850
if (ignore_link_down && nh->fib_nh_flags & RTNH_F_LINKDOWN)
net/ipv4/fib_semantics.c
1852
return call_fib4_notifiers(dev_net(nh->fib_nh_dev), event_type,
net/ipv4/fib_semantics.c
1855
if ((ignore_link_down && nh->fib_nh_flags & RTNH_F_LINKDOWN) ||
net/ipv4/fib_semantics.c
1856
(nh->fib_nh_flags & RTNH_F_DEAD))
net/ipv4/fib_semantics.c
1857
return call_fib4_notifiers(dev_net(nh->fib_nh_dev),
net/ipv4/fib_semantics.c
1908
struct fib_nh *nh;
net/ipv4/fib_semantics.c
1910
hlist_for_each_entry(nh, head, nh_hash) {
net/ipv4/fib_semantics.c
1911
DEBUG_NET_WARN_ON_ONCE(nh->fib_nh_dev != dev);
net/ipv4/fib_semantics.c
1912
fib_nhc_update_mtu(&nh->nh_common, dev->mtu, orig_mtu);
net/ipv4/fib_semantics.c
1929
struct fib_nh *nh;
net/ipv4/fib_semantics.c
1935
hlist_for_each_entry(nh, head, nh_hash) {
net/ipv4/fib_semantics.c
1936
struct fib_info *fi = nh->nh_parent;
net/ipv4/fib_semantics.c
1940
DEBUG_NET_WARN_ON_ONCE(nh->fib_nh_dev != dev);
net/ipv4/fib_semantics.c
2077
struct fib_nh *nh;
net/ipv4/fib_semantics.c
2094
hlist_for_each_entry(nh, head, nh_hash) {
net/ipv4/fib_semantics.c
2095
struct fib_info *fi = nh->nh_parent;
net/ipv4/fib_semantics.c
2099
DEBUG_NET_WARN_ON_ONCE(nh->fib_nh_dev != dev);
net/ipv4/fib_semantics.c
2133
static bool fib_good_nh(const struct fib_nh *nh)
net/ipv4/fib_semantics.c
2137
if (nh->fib_nh_scope == RT_SCOPE_LINK) {
net/ipv4/fib_semantics.c
2142
if (likely(nh->fib_nh_gw_family == AF_INET))
net/ipv4/fib_semantics.c
2143
n = __ipv4_neigh_lookup_noref(nh->fib_nh_dev,
net/ipv4/fib_semantics.c
2144
(__force u32)nh->fib_nh_gw4);
net/ipv4/fib_semantics.c
2146
nh->fib_nh_gw_family == AF_INET6)
net/ipv4/fib_semantics.c
2147
n = __ipv6_neigh_lookup_noref(nh->fib_nh_dev,
net/ipv4/fib_semantics.c
2148
&nh->fib_nh_gw6);
net/ipv4/fib_semantics.c
2169
if (unlikely(res->fi->nh)) {
net/ipv4/fib_semantics.c
225
if (fi->nh) {
net/ipv4/fib_semantics.c
226
nexthop_put(fi->nh);
net/ipv4/fib_semantics.c
258
if (fi->nh) {
net/ipv4/fib_semantics.c
277
if (fi->nh || ofi->nh)
net/ipv4/fib_semantics.c
278
return nexthop_cmp(fi->nh, ofi->nh) ? 0 : -1;
net/ipv4/fib_semantics.c
286
if (nh->fib_nh_oif != onh->fib_nh_oif ||
net/ipv4/fib_semantics.c
287
nh->fib_nh_gw_family != onh->fib_nh_gw_family ||
net/ipv4/fib_semantics.c
288
nh->fib_nh_scope != onh->fib_nh_scope ||
net/ipv4/fib_semantics.c
290
nh->fib_nh_weight != onh->fib_nh_weight ||
net/ipv4/fib_semantics.c
293
nh->nh_tclassid != onh->nh_tclassid ||
net/ipv4/fib_semantics.c
295
lwtunnel_cmp_encap(nh->fib_nh_lws, onh->fib_nh_lws) ||
net/ipv4/fib_semantics.c
296
((nh->fib_nh_flags ^ onh->fib_nh_flags) & ~RTNH_COMPARE_MASK))
net/ipv4/fib_semantics.c
299
if (nh->fib_nh_gw_family == AF_INET &&
net/ipv4/fib_semantics.c
300
nh->fib_nh_gw4 != onh->fib_nh_gw4)
net/ipv4/fib_semantics.c
303
if (nh->fib_nh_gw_family == AF_INET6 &&
net/ipv4/fib_semantics.c
304
ipv6_addr_cmp(&nh->fib_nh_gw6, &onh->fib_nh_gw6))
net/ipv4/fib_semantics.c
342
if (fi->nh) {
net/ipv4/fib_semantics.c
343
val ^= fi->nh->id;
net/ipv4/fib_semantics.c
346
val ^= nh->fib_nh_oif;
net/ipv4/fib_semantics.c
431
if (!fi->nh || fi->nh->id != cfg->fc_nh_id)
net/ipv4/fib_semantics.c
478
struct fib_nh *nh;
net/ipv4/fib_semantics.c
482
hlist_for_each_entry_rcu(nh, head, nh_hash) {
net/ipv4/fib_semantics.c
483
DEBUG_NET_WARN_ON_ONCE(nh->fib_nh_dev != dev);
net/ipv4/fib_semantics.c
484
if (nh->fib_nh_gw4 == gw &&
net/ipv4/fib_semantics.c
485
!(nh->fib_nh_flags & RTNH_F_DEAD)) {
net/ipv4/fib_semantics.c
506
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
642
int fib_nh_init(struct net *net, struct fib_nh *nh,
net/ipv4/fib_semantics.c
648
nh->fib_nh_family = AF_INET;
net/ipv4/fib_semantics.c
650
err = fib_nh_common_init(net, &nh->nh_common, cfg->fc_encap,
net/ipv4/fib_semantics.c
655
nh->fib_nh_oif = cfg->fc_oif;
net/ipv4/fib_semantics.c
656
nh->fib_nh_gw_family = cfg->fc_gw_family;
net/ipv4/fib_semantics.c
658
nh->fib_nh_gw4 = cfg->fc_gw4;
net/ipv4/fib_semantics.c
660
nh->fib_nh_gw6 = cfg->fc_gw6;
net/ipv4/fib_semantics.c
662
nh->fib_nh_flags = cfg->fc_flags;
net/ipv4/fib_semantics.c
665
nh->nh_tclassid = cfg->fc_flow;
net/ipv4/fib_semantics.c
666
if (nh->nh_tclassid)
net/ipv4/fib_semantics.c
670
nh->fib_nh_weight = nh_weight;
net/ipv4/fib_semantics.c
717
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
792
nh = fib_info_nh(fi, 0);
net/ipv4/fib_semantics.c
793
if (cfg->fc_oif && nh->fib_nh_oif != cfg->fc_oif) {
net/ipv4/fib_semantics.c
799
if (cfg->fc_gw_family != nh->fib_nh_gw_family ||
net/ipv4/fib_semantics.c
801
nh->fib_nh_gw4 != cfg->fc_gw4) ||
net/ipv4/fib_semantics.c
803
ipv6_addr_cmp(&nh->fib_nh_gw6, &cfg->fc_gw6))) {
net/ipv4/fib_semantics.c
810
if (cfg->fc_flow && nh->nh_tclassid != cfg->fc_flow) {
net/ipv4/fib_semantics.c
832
if (nh->fib_nh_flags & RTNH_F_DEAD)
net/ipv4/fib_semantics.c
835
if (ip_ignore_linkdown(nh->fib_nh_dev) &&
net/ipv4/fib_semantics.c
836
nh->fib_nh_flags & RTNH_F_LINKDOWN)
net/ipv4/fib_semantics.c
839
total += nh->fib_nh_weight;
net/ipv4/fib_semantics.c
877
const struct fib_nh *nh,
net/ipv4/fib_semantics.c
890
result = lwtunnel_cmp_encap(lwtstate, nh->fib_nh_lws);
net/ipv4/fib_semantics.c
909
if (fi->nh && cfg->fc_nh_id == fi->nh->id)
net/ipv4/fib_semantics.c
914
if (fi->nh) {
net/ipv4/fib_semantics.c
921
struct fib_nh *nh;
net/ipv4/fib_semantics.c
923
nh = fib_info_nh(fi, 0);
net/ipv4/fib_semantics.c
926
cfg->fc_encap, nh, cfg, extack))
net/ipv4/fib_semantics.c
931
cfg->fc_flow != nh->nh_tclassid)
net/ipv4/fib_semantics.c
934
if ((cfg->fc_oif && cfg->fc_oif != nh->fib_nh_oif) ||
net/ipv4/fib_semantics.c
936
cfg->fc_gw_family != nh->fib_nh_gw_family))
net/ipv4/fib_semantics.c
940
cfg->fc_gw4 != nh->fib_nh_gw4)
net/ipv4/fib_semantics.c
944
ipv6_addr_cmp(&cfg->fc_gw6, &nh->fib_nh_gw6))
net/ipv4/fib_semantics.c
963
if (rtnh->rtnh_ifindex && rtnh->rtnh_ifindex != nh->fib_nh_oif)
net/ipv4/fib_semantics.c
986
if (nh->fib_nh_gw_family != AF_INET ||
net/ipv4/fib_semantics.c
987
gw != nh->fib_nh_gw4)
net/ipv4/fib_semantics.c
996
switch (nh->fib_nh_gw_family) {
net/ipv4/fib_semantics.c
999
cfg2.fc_gw4 != nh->fib_nh_gw4)
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
1456
int nh;
net/ipv4/icmp.c
1467
nh = skb_network_offset(skb);
net/ipv4/icmp.c
1476
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
1006
static size_t nh_nlmsg_size_grp(struct nexthop *nh, u32 op_flags)
net/ipv4/nexthop.c
1008
struct nh_group *nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
1035
static size_t nh_nlmsg_size_single(struct nexthop *nh)
net/ipv4/nexthop.c
1037
struct nh_info *nhi = rtnl_dereference(nh->nh_info);
net/ipv4/nexthop.c
1066
static size_t nh_nlmsg_size(struct nexthop *nh, u32 op_flags)
net/ipv4/nexthop.c
1072
if (nh->is_group)
net/ipv4/nexthop.c
1073
sz += nh_nlmsg_size_grp(nh, op_flags) +
net/ipv4/nexthop.c
1077
sz += nh_nlmsg_size_single(nh);
net/ipv4/nexthop.c
1082
static void nexthop_notify(int event, struct nexthop *nh, struct nl_info *info)
net/ipv4/nexthop.c
1089
skb = nlmsg_new(nh_nlmsg_size(nh, 0), gfp_any());
net/ipv4/nexthop.c
1093
err = nh_fill_node(skb, nh, event, info->portid, seq, nlflags, 0);
net/ipv4/nexthop.c
114
const struct nexthop *nh)
net/ipv4/nexthop.c
1154
static int nh_fill_res_bucket(struct sk_buff *skb, struct nexthop *nh,
net/ipv4/nexthop.c
116
struct nh_info *nhi = rtnl_dereference(nh->nh_info);
net/ipv4/nexthop.c
1172
nhm->nh_protocol = nh->protocol;
net/ipv4/nexthop.c
1176
if (nla_put_u32(skb, NHA_ID, nh->id))
net/ipv4/nexthop.c
1184
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
120
if (!info->nh)
net/ipv4/nexthop.c
1206
struct nexthop *nh = nhge->nh_parent;
net/ipv4/nexthop.c
1214
err = nh_fill_res_bucket(skb, nh, bucket, bucket_index,
net/ipv4/nexthop.c
1222
rtnl_notify(skb, nh->net, 0, RTNLGRP_NEXTHOP, NULL, GFP_KERNEL);
net/ipv4/nexthop.c
1225
rtnl_set_sk_err(nh->net, RTNLGRP_NEXTHOP, err);
net/ipv4/nexthop.c
1228
static bool valid_group_nh(struct nexthop *nh, unsigned int npaths,
net/ipv4/nexthop.c
123
__nh_notifier_single_info_init(info->nh, nhi);
net/ipv4/nexthop.c
1231
if (nh->is_group) {
net/ipv4/nexthop.c
1232
struct nh_group *nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
1247
struct nh_info *nhi = rtnl_dereference(nh->nh_info);
net/ipv4/nexthop.c
1260
static int nh_check_attr_fdb_group(struct nexthop *nh, u8 *nh_family,
net/ipv4/nexthop.c
1265
nhi = rtnl_dereference(nh->nh_info);
net/ipv4/nexthop.c
130
kfree(info->nh);
net/ipv4/nexthop.c
1355
struct nexthop *nh;
net/ipv4/nexthop.c
1358
nh = nexthop_find_by_id(net, nhg[i].id);
net/ipv4/nexthop.c
1359
if (!nh) {
net/ipv4/nexthop.c
1363
if (!valid_group_nh(nh, len, &is_fdb_nh, extack))
net/ipv4/nexthop.c
1366
if (nhg_fdb && nh_check_attr_fdb_group(nh, &nh_family, extack))
net/ipv4/nexthop.c
1378
static bool ipv6_good_nh(const struct fib6_nh *nh)
net/ipv4/nexthop.c
1385
n = __ipv6_neigh_lookup_noref(nh->fib_nh_dev, &nh->fib_nh_gw6);
net/ipv4/nexthop.c
1394
static bool ipv4_good_nh(const struct fib_nh *nh)
net/ipv4/nexthop.c
1401
n = __ipv4_neigh_lookup_noref(nh->fib_nh_dev,
net/ipv4/nexthop.c
1402
(__force u32)nh->fib_nh_gw4);
net/ipv4/nexthop.c
1411
static bool nexthop_is_good_nh(const struct nexthop *nh)
net/ipv4/nexthop.c
1413
struct nh_info *nhi = rcu_dereference(nh->nh_info);
net/ipv4/nexthop.c
1436
return nhge->nh;
net/ipv4/nexthop.c
1457
if (!nexthop_is_good_nh(nhge->nh))
net/ipv4/nexthop.c
1467
return nhge->nh;
net/ipv4/nexthop.c
1473
return nhge0->nh;
net/ipv4/nexthop.c
1490
return nhge->nh;
net/ipv4/nexthop.c
1493
struct nexthop *nexthop_select_path(struct nexthop *nh, int hash)
net/ipv4/nexthop.c
1497
if (!nh->is_group)
net/ipv4/nexthop.c
1498
return nh;
net/ipv4/nexthop.c
1500
nhg = rcu_dereference(nh->nh_grp);
net/ipv4/nexthop.c
1511
int nexthop_for_each_fib6_nh(struct nexthop *nh,
net/ipv4/nexthop.c
1512
int (*cb)(struct fib6_nh *nh, void *arg),
net/ipv4/nexthop.c
1518
if (nh->is_group) {
net/ipv4/nexthop.c
152
nhi = rtnl_dereference(nhge->nh->nh_info);
net/ipv4/nexthop.c
1522
nhg = rcu_dereference_rtnl(nh->nh_grp);
net/ipv4/nexthop.c
1526
nhi = rcu_dereference_rtnl(nhge->nh->nh_info);
net/ipv4/nexthop.c
1532
nhi = rcu_dereference_rtnl(nh->nh_info);
net/ipv4/nexthop.c
154
__nh_notifier_single_info_init(&info->nh_grp->nh_entries[i].nh,
net/ipv4/nexthop.c
1552
int fib6_check_nexthop(struct nexthop *nh, struct fib6_config *cfg,
net/ipv4/nexthop.c
1567
if (nh->is_group) {
net/ipv4/nexthop.c
1570
nhg = rcu_dereference_rtnl(nh->nh_grp);
net/ipv4/nexthop.c
1575
nhi = rcu_dereference_rtnl(nh->nh_info);
net/ipv4/nexthop.c
1640
int fib_check_nexthop(struct nexthop *nh, u8 scope,
net/ipv4/nexthop.c
1646
if (nh->is_group) {
net/ipv4/nexthop.c
1649
nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
1663
nhi = rtnl_dereference(nhg->nh_entries[0].nh->nh_info);
net/ipv4/nexthop.c
1666
nhi = rtnl_dereference(nh->nh_info);
net/ipv4/nexthop.c
1820
old_nhge->nh,
net/ipv4/nexthop.c
1821
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
196
struct nh_group *nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
1967
u32 id = rtnl_dereference(bucket->nh_entry)->nh->id;
net/ipv4/nexthop.c
1974
if (nhge->nh->id == id) {
net/ipv4/nexthop.c
2033
struct nexthop *nh = nhge->nh;
net/ipv4/nexthop.c
2037
WARN_ON(!nh);
net/ipv4/nexthop.c
206
const struct nexthop *nh)
net/ipv4/nexthop.c
2060
if (nhg->nh_entries[i].nh == nh) {
net/ipv4/nexthop.c
2065
nhi = rtnl_dereference(nhges[i].nh->nh_info);
net/ipv4/nexthop.c
2072
new_nhges[j].nh = nhges[i].nh;
net/ipv4/nexthop.c
2074
list_add(&new_nhges[j].nh_list, &new_nhges[j].nh->grp_list);
net/ipv4/nexthop.c
208
struct nh_group *nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
2086
nexthop_put(nhge->nh);
net/ipv4/nexthop.c
2106
remove_nexthop_from_groups(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
2116
if (list_empty(&nh->grp_list))
net/ipv4/nexthop.c
2119
list_for_each_entry_safe(nhge, tmp, &nh->grp_list, nh_list)
net/ipv4/nexthop.c
2135
static void remove_nexthop_group(struct nexthop *nh, struct nl_info *nlinfo)
net/ipv4/nexthop.c
2137
struct nh_group *nhg = rcu_dereference_rtnl(nh->nh_grp);
net/ipv4/nexthop.c
2144
if (WARN_ON(!nhge->nh))
net/ipv4/nexthop.c
2158
struct nexthop *nh)
net/ipv4/nexthop.c
2160
bool need_flush = !list_empty(&nh->fi_list);
net/ipv4/nexthop.c
2164
list_for_each_entry(fi, &nh->fi_list, nh_list)
net/ipv4/nexthop.c
2167
spin_lock_bh(&nh->lock);
net/ipv4/nexthop.c
2169
nh->dead = true;
net/ipv4/nexthop.c
217
const struct nexthop *nh)
net/ipv4/nexthop.c
2171
while (!list_empty(&nh->f6i_list)) {
net/ipv4/nexthop.c
2172
f6i = list_first_entry(&nh->f6i_list, typeof(*f6i), nh_list);
net/ipv4/nexthop.c
2177
spin_unlock_bh(&nh->lock);
net/ipv4/nexthop.c
2181
spin_lock_bh(&nh->lock);
net/ipv4/nexthop.c
2184
spin_unlock_bh(&nh->lock);
net/ipv4/nexthop.c
2189
static bool __must_check __remove_nexthop(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
219
info->id = nh->id;
net/ipv4/nexthop.c
2192
bool need_flush = __remove_nexthop_fib(net, nh);
net/ipv4/nexthop.c
2194
if (nh->is_group) {
net/ipv4/nexthop.c
2195
remove_nexthop_group(nh, nlinfo);
net/ipv4/nexthop.c
2199
nhi = rtnl_dereference(nh->nh_info);
net/ipv4/nexthop.c
2203
need_flush |= remove_nexthop_from_groups(net, nh, nlinfo);
net/ipv4/nexthop.c
2209
static bool __must_check remove_nexthop(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
221
if (nh->is_group)
net/ipv4/nexthop.c
2214
call_nexthop_notifiers(net, NEXTHOP_EVENT_DEL, nh, NULL);
net/ipv4/nexthop.c
2217
rb_erase(&nh->rb_node, &net->nexthop.rb_root);
net/ipv4/nexthop.c
222
return nh_notifier_grp_info_init(info, nh);
net/ipv4/nexthop.c
2220
nexthop_notify(RTM_DELNEXTHOP, nh, nlinfo);
net/ipv4/nexthop.c
2222
need_flush = __remove_nexthop(net, nh, nlinfo);
net/ipv4/nexthop.c
2225
nexthop_put(nh);
net/ipv4/nexthop.c
2230
static void remove_one_nexthop(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
2233
if (remove_nexthop(net, nh, nlinfo))
net/ipv4/nexthop.c
224
return nh_notifier_single_info_init(info, nh);
net/ipv4/nexthop.c
2240
static void nh_rt_cache_flush(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
2247
if (!list_empty(&nh->fi_list))
net/ipv4/nexthop.c
2250
spin_lock_bh(&nh->lock);
net/ipv4/nexthop.c
2251
have_f6i = !list_empty(&nh->f6i_list);
net/ipv4/nexthop.c
2252
spin_unlock_bh(&nh->lock);
net/ipv4/nexthop.c
2265
struct nh_info *nhi = rtnl_dereference(nhge->nh->nh_info);
net/ipv4/nexthop.c
228
const struct nexthop *nh)
net/ipv4/nexthop.c
23
static bool __must_check 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
2369
nhi = rtnl_dereference(nhges[i].nh->nh_info);
net/ipv4/nexthop.c
238
struct nexthop *nh,
net/ipv4/nexthop.c
2392
if (nhge->nh == old) {
net/ipv4/nexthop.c
2410
if (nhge->nh == old)
net/ipv4/nexthop.c
252
err = nh_notifier_info_init(&info, nh);
net/ipv4/nexthop.c
2527
static void __nexthop_replace_notify(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
2532
if (!list_empty(&nh->fi_list)) {
net/ipv4/nexthop.c
2539
list_for_each_entry(fi, &nh->fi_list, nh_list)
net/ipv4/nexthop.c
2544
list_for_each_entry(fi, &nh->fi_list, nh_list)
net/ipv4/nexthop.c
2548
spin_lock_bh(&nh->lock);
net/ipv4/nexthop.c
2549
list_for_each_entry(f6i, &nh->f6i_list, nh_list)
net/ipv4/nexthop.c
2551
spin_unlock_bh(&nh->lock);
net/ipv4/nexthop.c
2558
static void nexthop_replace_notify(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
2563
__nexthop_replace_notify(net, nh, info);
net/ipv4/nexthop.c
2565
list_for_each_entry(nhge, &nh->grp_list, nh_list)
net/ipv4/nexthop.c
260
nh_notifier_info_fini(&info, nh);
net/ipv4/nexthop.c
2642
struct nexthop *nh;
net/ipv4/nexthop.c
2650
nh = rb_entry(parent, struct nexthop, rb_node);
net/ipv4/nexthop.c
2651
if (new_id < nh->id) {
net/ipv4/nexthop.c
2653
} else if (new_id > nh->id) {
net/ipv4/nexthop.c
2656
rc = replace_nexthop(net, nh, new_nh, cfg, extack);
net/ipv4/nexthop.c
2658
new_nh = nh; /* send notification with old nh */
net/ipv4/nexthop.c
271
struct nexthop *nh;
net/ipv4/nexthop.c
2753
struct nexthop *nh;
net/ipv4/nexthop.c
2756
nh = rb_entry(node, struct nexthop, rb_node);
net/ipv4/nexthop.c
2757
need_flush |= remove_nexthop(net, nh, NULL);
net/ipv4/nexthop.c
2771
struct nexthop *nh;
net/ipv4/nexthop.c
2775
nh = nexthop_alloc();
net/ipv4/nexthop.c
2776
if (!nh)
net/ipv4/nexthop.c
2779
nh->is_group = 1;
net/ipv4/nexthop.c
2783
kfree(nh);
net/ipv4/nexthop.c
2791
kfree(nh);
net/ipv4/nexthop.c
2817
nhg->nh_entries[i].nh = nhe;
net/ipv4/nexthop.c
2821
nhg->nh_entries[i].nh_parent = nh;
net/ipv4/nexthop.c
2853
rcu_assign_pointer(nh->nh_grp, nhg);
net/ipv4/nexthop.c
2855
return nh;
net/ipv4/nexthop.c
2861
nexthop_put(nhg->nh_entries[i].nh);
net/ipv4/nexthop.c
2866
kfree(nh);
net/ipv4/nexthop.c
2871
static int nh_create_ipv4(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
290
nh = nexthop_find_by_id(info->net, info->id);
net/ipv4/nexthop.c
2900
nh->nh_flags = fib_nh->fib_nh_flags;
net/ipv4/nexthop.c
291
if (!nh) {
net/ipv4/nexthop.c
2910
static int nh_create_ipv6(struct net *net, struct nexthop *nh,
net/ipv4/nexthop.c
2938
nh->nh_flags = fib6_nh->fib_nh_flags;
net/ipv4/nexthop.c
2948
struct nexthop *nh;
net/ipv4/nexthop.c
2951
nh = nexthop_alloc();
net/ipv4/nexthop.c
2952
if (!nh)
net/ipv4/nexthop.c
2957
kfree(nh);
net/ipv4/nexthop.c
296
nhg = rcu_dereference(nh->nh_grp);
net/ipv4/nexthop.c
2961
nh->nh_flags = cfg->nh_flags;
net/ipv4/nexthop.c
2962
nh->net = net;
net/ipv4/nexthop.c
2964
nhi->nh_parent = nh;
net/ipv4/nexthop.c
2978
err = nh_create_ipv4(net, nh, nhi, cfg, extack);
net/ipv4/nexthop.c
2981
err = nh_create_ipv6(net, nh, nhi, cfg, extack);
net/ipv4/nexthop.c
2987
kfree(nh);
net/ipv4/nexthop.c
2995
rcu_assign_pointer(nh->nh_info, nhi);
net/ipv4/nexthop.c
2997
return nh;
net/ipv4/nexthop.c
3004
struct nexthop *nh;
net/ipv4/nexthop.c
3016
nh = nexthop_create_group(net, cfg);
net/ipv4/nexthop.c
3018
nh = nexthop_create(net, cfg, extack);
net/ipv4/nexthop.c
3020
if (IS_ERR(nh))
net/ipv4/nexthop.c
3021
return nh;
net/ipv4/nexthop.c
3023
refcount_set(&nh->refcnt, 1);
net/ipv4/nexthop.c
3024
nh->id = cfg->nh_id;
net/ipv4/nexthop.c
3025
nh->protocol = cfg->nh_protocol;
net/ipv4/nexthop.c
3026
nh->net = net;
net/ipv4/nexthop.c
3028
err = insert_nexthop(net, nh, cfg, extack);
net/ipv4/nexthop.c
3030
WARN_ON_ONCE(__remove_nexthop(net, nh, NULL));
net/ipv4/nexthop.c
3031
nexthop_put(nh);
net/ipv4/nexthop.c
3032
nh = ERR_PTR(err);
net/ipv4/nexthop.c
3035
return nh;
net/ipv4/nexthop.c
3307
struct nexthop *nh;
net/ipv4/nexthop.c
3332
nh = nexthop_add(net, &cfg, extack);
net/ipv4/nexthop.c
3333
if (IS_ERR(nh))
net/ipv4/nexthop.c
3334
err = PTR_ERR(nh);
net/ipv4/nexthop.c
3381
struct nexthop *nh;
net/ipv4/nexthop.c
3397
nh = nexthop_find_by_id(net, id);
net/ipv4/nexthop.c
3398
if (nh)
net/ipv4/nexthop.c
3399
remove_one_nexthop(net, nh, &nlinfo);
net/ipv4/nexthop.c
3415
struct nexthop *nh;
net/ipv4/nexthop.c
3431
nh = nexthop_find_by_id(net, id);
net/ipv4/nexthop.c
3432
if (!nh)
net/ipv4/nexthop.c
3436
skb = nlmsg_new(nh_nlmsg_size(nh, op_flags), GFP_KERNEL);
net/ipv4/nexthop.c
3440
err = nh_fill_node(skb, nh, RTM_NEWNEXTHOP, NETLINK_CB(in_skb).portid,
net/ipv4/nexthop.c
3465
static bool nh_dump_filtered(struct nexthop *nh,
net/ipv4/nexthop.c
3471
if (filter->group_filter && !nh->is_group)
net/ipv4/nexthop.c
3477
if (nh->is_group)
net/ipv4/nexthop.c
3480
nhi = rtnl_dereference(nh->nh_info);
net/ipv4/nexthop.c
3574
struct nexthop *nh, void *data),
net/ipv4/nexthop.c
3596
struct nexthop *nh;
net/ipv4/nexthop.c
3598
nh = rb_entry(tmp, struct nexthop, rb_node);
net/ipv4/nexthop.c
3599
if (nh->id < s_idx) {
net/ipv4/nexthop.c
3615
struct nexthop *nh;
net/ipv4/nexthop.c
3617
nh = rb_entry(node, struct nexthop, rb_node);
net/ipv4/nexthop.c
3619
ctx->idx = nh->id;
net/ipv4/nexthop.c
3620
err = nh_cb(skb, cb, nh, data);
net/ipv4/nexthop.c
3629
struct nexthop *nh, void *data)
net/ipv4/nexthop.c
3634
if (nh_dump_filtered(nh, filter, nhm->nh_family))
net/ipv4/nexthop.c
3637
return nh_fill_node(skb, nh, RTM_NEWNEXTHOP,
net/ipv4/nexthop.c
3668
struct nexthop *nh;
net/ipv4/nexthop.c
3670
nh = nexthop_find_by_id(net, id);
net/ipv4/nexthop.c
3671
if (!nh)
net/ipv4/nexthop.c
3674
if (!nh->is_group) {
net/ipv4/nexthop.c
3679
nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
3685
return nh;
net/ipv4/nexthop.c
3746
struct rtm_dump_nh_ctx nh;
net/ipv4/nexthop.c
3766
struct nexthop *nh,
net/ipv4/nexthop.c
3776
nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
3786
if (nh_dump_filtered(nhge->nh, &dd->filter, nhm->nh_family))
net/ipv4/nexthop.c
3790
dd->filter.res_bucket_nh_id != nhge->nh->id)
net/ipv4/nexthop.c
3794
err = nh_fill_res_bucket(skb, nh, bucket, bucket_index,
net/ipv4/nexthop.c
3809
struct nexthop *nh, void *data)
net/ipv4/nexthop.c
3814
if (!nh->is_group)
net/ipv4/nexthop.c
3817
nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
3821
return rtm_dump_nexthop_bucket_nh(skb, cb, nh, dd);
net/ipv4/nexthop.c
3831
struct nexthop *nh;
net/ipv4/nexthop.c
3839
nh = nexthop_find_group_resilient(net, dd.filter.nh_id,
net/ipv4/nexthop.c
3841
if (IS_ERR(nh))
net/ipv4/nexthop.c
3842
return PTR_ERR(nh);
net/ipv4/nexthop.c
3843
err = rtm_dump_nexthop_bucket_nh(skb, cb, nh, &dd);
net/ipv4/nexthop.c
3847
err = rtm_dump_walk_nexthops(skb, cb, root, &ctx->nh,
net/ipv4/nexthop.c
3915
struct nexthop *nh;
net/ipv4/nexthop.c
3924
nh = nexthop_find_group_resilient(net, id, extack);
net/ipv4/nexthop.c
3925
if (IS_ERR(nh))
net/ipv4/nexthop.c
3926
return PTR_ERR(nh);
net/ipv4/nexthop.c
3928
nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
3939
err = nh_fill_res_bucket(skb, nh, &res_table->nh_buckets[bucket_index],
net/ipv4/nexthop.c
4010
struct nexthop *nh;
net/ipv4/nexthop.c
4012
nh = rb_entry(node, struct nexthop, rb_node);
net/ipv4/nexthop.c
4013
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
905
nla_put_nh_group_stats(skb, nh, op_flags))
net/ipv4/nexthop.c
914
static int nh_fill_node(struct sk_buff *skb, struct nexthop *nh,
net/ipv4/nexthop.c
930
nhm->nh_flags = nh->nh_flags;
net/ipv4/nexthop.c
931
nhm->nh_protocol = nh->protocol;
net/ipv4/nexthop.c
935
if (nla_put_u32(skb, NHA_ID, nh->id))
net/ipv4/nexthop.c
938
if (nh->is_group) {
net/ipv4/nexthop.c
939
struct nh_group *nhg = rtnl_dereference(nh->nh_grp);
net/ipv4/nexthop.c
944
if (nla_put_nh_group(skb, nh, op_flags, &resp_op_flags) ||
net/ipv4/nexthop.c
950
nhi = rtnl_dereference(nh->nh_info);
net/ipv4/route.c
1607
struct fib_nh *nh;
net/ipv4/route.c
1609
nh = container_of(nhc, struct fib_nh, nh_common);
net/ipv4/route.c
1610
rt->dst.tclassid = nh->nh_tclassid;
net/ipv6/addrconf.c
2530
if (rt->nh)
net/ipv6/addrconf.c
6713
struct fib6_nh *nh = ifa->rt->fib6_nh;
net/ipv6/addrconf.c
6718
if (nh->rt6i_pcpu) {
net/ipv6/addrconf.c
6722
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
637
unsigned char *nh = skb_network_header(skb);
net/ipv6/datagram.c
650
__be32 flowinfo = ip6_flowinfo((struct ipv6hdr *)nh);
net/ipv6/datagram.c
657
u8 *ptr = nh + sizeof(struct ipv6hdr);
net/ipv6/datagram.c
680
u8 *ptr = nh + off;
net/ipv6/datagram.c
733
u8 *ptr = nh + sizeof(struct ipv6hdr);
net/ipv6/datagram.c
740
u8 *ptr = nh + opt->dst0;
net/ipv6/datagram.c
747
struct ipv6_rt_hdr *rthdr = (struct ipv6_rt_hdr *)(nh + opt->srcrt);
net/ipv6/datagram.c
754
u8 *ptr = nh + opt->dst1;
net/ipv6/exthdrs.c
1001
nh[optoff+1]);
net/ipv6/exthdrs.c
1006
pkt_len = ntohl(*(__be32 *)(nh + optoff + 2));
net/ipv6/exthdrs.c
1038
const unsigned char *nh = skb_network_header(skb);
net/ipv6/exthdrs.c
1040
if (nh[optoff + 1] < 8)
net/ipv6/exthdrs.c
1043
if (nh[optoff + 6] * 4 + 8 > nh[optoff + 1])
net/ipv6/exthdrs.c
1046
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
197
switch (nh[off]) {
net/ipv6/exthdrs.c
214
nh = skb_network_header(skb);
net/ipv6/exthdrs.c
897
const unsigned char *nh = skb_network_header(skb);
net/ipv6/exthdrs.c
899
if (nh[optoff + 1] == 2) {
net/ipv6/exthdrs.c
901
memcpy(&IP6CB(skb)->ra, nh + optoff + 2, sizeof(IP6CB(skb)->ra));
net/ipv6/exthdrs.c
905
nh[optoff + 1]);
net/ipv6/exthdrs.c
995
const unsigned char *nh = skb_network_header(skb);
net/ipv6/exthdrs.c
999
if (nh[optoff + 1] != 4 || (optoff & 3) != 2) {
net/ipv6/exthdrs_core.c
121
const unsigned char *nh = skb_network_header(skb);
net/ipv6/exthdrs_core.c
128
hdr = (struct ipv6_opt_hdr *)(nh + offset);
net/ipv6/exthdrs_core.c
138
int opttype = nh[offset];
net/ipv6/exthdrs_core.c
151
optlen = nh[offset + 1] + 2;
net/ipv6/fib6_rules.c
196
res->nh->fib_nh_dev);
net/ipv6/icmp.c
1112
int nh;
net/ipv6/icmp.c
1123
nh = skb_network_offset(skb);
net/ipv6/icmp.c
1132
skb_set_network_header(skb, nh);
net/ipv6/ip6_fib.c
1012
static int fib6_nh_drop_pcpu_from(struct fib6_nh *nh, void *_arg)
net/ipv6/ip6_fib.c
1016
__fib6_drop_pcpu_from(nh, arg);
net/ipv6/ip6_fib.c
1028
if (f6i->nh) {
net/ipv6/ip6_fib.c
1030
nexthop_for_each_fib6_nh(f6i->nh, fib6_nh_drop_pcpu_from, f6i);
net/ipv6/ip6_fib.c
1049
if (rt->nh) {
net/ipv6/ip6_fib.c
1050
spin_lock(&rt->nh->lock);
net/ipv6/ip6_fib.c
1055
spin_unlock(&rt->nh->lock);
net/ipv6/ip6_fib.c
1151
(iter->nh || !iter->fib6_nh->fib_nh_gw_family)) {
net/ipv6/ip6_fib.c
1366
spin_lock(&rt->nh->lock);
net/ipv6/ip6_fib.c
1368
if (rt->nh->dead) {
net/ipv6/ip6_fib.c
1374
list_add(&rt->nh_list, &rt->nh->f6i_list);
net/ipv6/ip6_fib.c
1377
spin_unlock(&rt->nh->lock);
net/ipv6/ip6_fib.c
1532
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
2610
if (rt->nh)
net/ipv6/ip6_fib.c
2611
fib6_nh = nexthop_fib6_nh(rt->nh);
net/ipv6/ip6_tunnel.c
814
int nh, err;
net/ipv6/ip6_tunnel.c
855
nh = skb_network_header(skb) - skb->head;
net/ipv6/ip6_tunnel.c
866
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/netfilter/nft_fib_ipv6.c
163
static int nft_fib6_nh_match_dev_cb(struct fib6_nh *nh, void *arg)
net/ipv6/netfilter/nft_fib_ipv6.c
167
return nft_fib6_info_nh_dev_match(nh->fib_nh_dev, dev);
net/ipv6/netfilter/nft_fib_ipv6.c
177
if (rt->nh)
net/ipv6/netfilter/nft_fib_ipv6.c
178
return nexthop_for_each_fib6_nh(rt->nh,
net/ipv6/reassembly.c
144
const unsigned char *nh = skb_network_header(skb);
net/ipv6/reassembly.c
146
csum_partial(nh, (u8 *)(fhdr + 1) - nh,
net/ipv6/route.c
1061
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
1157
if (res->nh->fib_nh_lws) {
net/ipv6/route.c
1158
rt->dst.lwtstate = lwtstate_get(res->nh->fib_nh_lws);
net/ipv6/route.c
1176
const struct fib6_nh *nh = res->nh;
net/ipv6/route.c
1177
const struct net_device *dev = nh->fib_nh_dev;
net/ipv6/route.c
1185
if (nh->fib_nh_gw_family) {
net/ipv6/route.c
1186
rt->rt6i_gateway = nh->fib_nh_gw6;
net/ipv6/route.c
1232
struct net_device *dev = res->nh->fib_nh_dev;
net/ipv6/route.c
1432
if (f6i->nh)
net/ipv6/route.c
1448
pcpu_rt = this_cpu_read(*res->nh->rt6i_pcpu);
net/ipv6/route.c
1453
p = this_cpu_ptr(res->nh->rt6i_pcpu);
net/ipv6/route.c
1476
p = this_cpu_ptr(res->nh->rt6i_pcpu);
net/ipv6/route.c
1641
const struct fib6_nh *nh = res->nh;
net/ipv6/route.c
1647
struct net_device *dev = nh->fib_nh_dev;
net/ipv6/route.c
1662
return mtu - lwtunnel_headroom(nh->fib_nh_lws, mtu);
net/ipv6/route.c
1673
struct rt6_exception_bucket *fib6_nh_get_excptn_bucket(const struct fib6_nh *nh,
net/ipv6/route.c
1679
bucket = rcu_dereference_protected(nh->rt6i_exception_bucket,
net/ipv6/route.c
1682
bucket = rcu_dereference(nh->rt6i_exception_bucket);
net/ipv6/route.c
1703
static void fib6_nh_excptn_bucket_set_flushed(struct fib6_nh *nh,
net/ipv6/route.c
1709
bucket = rcu_dereference_protected(nh->rt6i_exception_bucket,
net/ipv6/route.c
1715
rcu_assign_pointer(nh->rt6i_exception_bucket, bucket);
net/ipv6/route.c
1726
struct fib6_nh *nh = res->nh;
net/ipv6/route.c
1732
bucket = rcu_dereference_protected(nh->rt6i_exception_bucket,
net/ipv6/route.c
1741
rcu_assign_pointer(nh->rt6i_exception_bucket, bucket);
net/ipv6/route.c
1802
static void fib6_nh_flush_exceptions(struct fib6_nh *nh, struct fib6_info *from)
net/ipv6/route.c
1811
bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
net/ipv6/route.c
1817
fib6_nh_excptn_bucket_set_flushed(nh, &rt6_exception_lock);
net/ipv6/route.c
1832
static int rt6_nh_flush_exceptions(struct fib6_nh *nh, void *arg)
net/ipv6/route.c
1836
fib6_nh_flush_exceptions(nh, f6i);
net/ipv6/route.c
1843
if (f6i->nh) {
net/ipv6/route.c
1845
nexthop_for_each_fib6_nh(f6i->nh, rt6_nh_flush_exceptions, f6i);
net/ipv6/route.c
1880
bucket = fib6_nh_get_excptn_bucket(res->nh, NULL);
net/ipv6/route.c
1898
static int fib6_nh_remove_exception(const struct fib6_nh *nh, int plen,
net/ipv6/route.c
1906
if (!rcu_access_pointer(nh->rt6i_exception_bucket))
net/ipv6/route.c
1910
bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
net/ipv6/route.c
1941
static int rt6_nh_remove_exception_rt(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
1946
err = fib6_nh_remove_exception(nh, arg->plen, arg->rt);
net/ipv6/route.c
1961
if (from->nh) {
net/ipv6/route.c
1969
rc = nexthop_for_each_fib6_nh(from->nh,
net/ipv6/route.c
1982
static void fib6_nh_update_exception(const struct fib6_nh *nh, int plen,
net/ipv6/route.c
1989
bucket = fib6_nh_get_excptn_bucket(nh, NULL);
net/ipv6/route.c
2012
static int fib6_nh_find_match(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
2016
if (arg->dev != nh->fib_nh_dev ||
net/ipv6/route.c
2017
(arg->gw && !nh->fib_nh_gw_family) ||
net/ipv6/route.c
2018
(!arg->gw && nh->fib_nh_gw_family) ||
net/ipv6/route.c
2019
(arg->gw && !ipv6_addr_equal(arg->gw, &nh->fib_nh_gw6)))
net/ipv6/route.c
2022
arg->match = nh;
net/ipv6/route.c
2039
if (from->nh) {
net/ipv6/route.c
2045
nexthop_for_each_fib6_nh(from->nh, fib6_nh_find_match, &arg);
net/ipv6/route.c
2083
const struct fib6_nh *nh, int mtu)
net/ipv6/route.c
2089
bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
net/ipv6/route.c
2111
static void fib6_nh_exceptions_clean_tohost(const struct fib6_nh *nh,
net/ipv6/route.c
2119
if (!rcu_access_pointer(nh->rt6i_exception_bucket))
net/ipv6/route.c
2123
bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
net/ipv6/route.c
2186
static void fib6_nh_age_exceptions(const struct fib6_nh *nh,
net/ipv6/route.c
2195
if (!rcu_access_pointer(nh->rt6i_exception_bucket))
net/ipv6/route.c
2200
bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
net/ipv6/route.c
2220
static int rt6_nh_age_exceptions(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
2224
fib6_nh_age_exceptions(nh, arg->gc_args, arg->now);
net/ipv6/route.c
2232
if (f6i->nh) {
net/ipv6/route.c
2238
nexthop_for_each_fib6_nh(f6i->nh, rt6_nh_age_exceptions,
net/ipv6/route.c
2297
oif == res.nh->fib_nh_dev->ifindex;
net/ipv6/route.c
2305
!res.nh->fib_nh_gw_family)) {
net/ipv6/route.c
2970
if (res.f6i->nh) {
net/ipv6/route.c
2976
nexthop_for_each_fib6_nh(res.f6i->nh,
net/ipv6/route.c
2985
res.nh = arg.match;
net/ipv6/route.c
2987
res.nh = res.f6i->fib6_nh;
net/ipv6/route.c
3073
const struct fib6_nh *nh = res->nh;
net/ipv6/route.c
3075
if (nh->fib_nh_flags & RTNH_F_DEAD || !nh->fib_nh_gw_family ||
net/ipv6/route.c
3076
fl6->flowi6_oif != nh->fib_nh_dev->ifindex)
net/ipv6/route.c
3084
if (!ipv6_addr_equal(gw, &nh->fib_nh_gw6)) {
net/ipv6/route.c
3105
static int fib6_nh_redirect_match(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
3109
arg->res->nh = nh;
net/ipv6/route.c
3156
if (unlikely(rt->nh)) {
net/ipv6/route.c
3157
if (nexthop_is_blackhole(rt->nh))
net/ipv6/route.c
3160
if (nexthop_for_each_fib6_nh(rt->nh,
net/ipv6/route.c
3165
res.nh = rt->fib6_nh;
net/ipv6/route.c
3186
res.nh = rt->fib6_nh;
net/ipv6/route.c
3306
const struct fib6_nh *nh = res->nh;
net/ipv6/route.c
3322
struct net_device *dev = nh->fib_nh_dev;
net/ipv6/route.c
3332
return mtu - lwtunnel_headroom(nh->fib_nh_lws, mtu);
net/ipv6/route.c
3462
res.nh->fib_nh_gw_family ||
net/ipv6/route.c
3463
(dev && dev != res.nh->fib_nh_dev))
net/ipv6/route.c
3475
res.nh->fib_nh_gw_family)
net/ipv6/route.c
3487
if (dev != res.nh->fib_nh_dev)
net/ipv6/route.c
3490
*_dev = dev = res.nh->fib_nh_dev;
net/ipv6/route.c
3886
struct nexthop *nh;
net/ipv6/route.c
3890
nh = nexthop_find_by_id(net, cfg->fc_nh_id);
net/ipv6/route.c
3891
if (!nh) {
net/ipv6/route.c
3897
err = fib6_check_nexthop(nh, cfg, extack);
net/ipv6/route.c
3901
if (!nexthop_get(nh)) {
net/ipv6/route.c
3907
rt->nh = nh;
net/ipv6/route.c
3908
fib6_nh = nexthop_fib6_nh(rt->nh);
net/ipv6/route.c
4103
struct fib6_nh *nh)
net/ipv6/route.c
4107
.nh = nh,
net/ipv6/route.c
4123
static int fib6_nh_del_cached_rt(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
4128
rc = ip6_del_cached_rt(arg->cfg, arg->f6i, nh);
net/ipv6/route.c
4139
return nexthop_for_each_fib6_nh(f6i->nh, fib6_nh_del_cached_rt, &arg);
net/ipv6/route.c
4165
struct fib6_nh *nh;
net/ipv6/route.c
4167
if (rt->nh && cfg->fc_nh_id &&
net/ipv6/route.c
4168
rt->nh->id != cfg->fc_nh_id)
net/ipv6/route.c
4174
if (rt->nh) {
net/ipv6/route.c
4179
nh = rt->fib6_nh;
net/ipv6/route.c
4180
rc = ip6_del_cached_rt(cfg, rt, nh);
net/ipv6/route.c
4195
if (rt->nh) {
net/ipv6/route.c
4205
nh = rt->fib6_nh;
net/ipv6/route.c
4207
(!nh->fib_nh_dev ||
net/ipv6/route.c
4208
nh->fib_nh_dev->ifindex != cfg->fc_ifindex))
net/ipv6/route.c
4211
!ipv6_addr_equal(&cfg->fc_gateway, &nh->fib_nh_gw6))
net/ipv6/route.c
4324
if (res.f6i->nh) {
net/ipv6/route.c
4330
nexthop_for_each_fib6_nh(res.f6i->nh,
net/ipv6/route.c
4338
res.nh = arg.match;
net/ipv6/route.c
4340
res.nh = res.f6i->fib6_nh;
net/ipv6/route.c
4395
if (rt->nh)
net/ipv6/route.c
446
if (!match->nh && (!match->fib6_nsiblings || have_oif_match))
net/ipv6/route.c
4460
struct fib6_nh *nh;
net/ipv6/route.c
4463
if (rt->nh)
net/ipv6/route.c
4466
nh = rt->fib6_nh;
net/ipv6/route.c
4467
if (dev == nh->fib_nh_dev &&
net/ipv6/route.c
4469
ipv6_addr_equal(&nh->fib_nh_gw6, addr))
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
4731
if (!rt->nh &&
net/ipv6/route.c
4759
struct fib6_nh *nh;
net/ipv6/route.c
4762
if (rt->nh)
net/ipv6/route.c
4765
nh = rt->fib6_nh;
net/ipv6/route.c
4767
nh->fib_nh_gw_family && ipv6_addr_equal(gateway, &nh->fib_nh_gw6))
net/ipv6/route.c
4774
fib6_nh_exceptions_clean_tohost(nh, gateway);
net/ipv6/route.c
481
const struct fib6_nh *nh = sibling->fib6_nh;
net/ipv6/route.c
487
nh_upper_bound = atomic_read(&nh->fib_nh_upper_bound);
net/ipv6/route.c
4891
if (rt != net->ipv6.fib6_null_entry && !rt->nh &&
net/ipv6/route.c
490
if (rt6_score_route(nh, sibling->fib6_flags, oif, strict) < 0)
net/ipv6/route.c
4977
if (rt == net->ipv6.fib6_null_entry || rt->nh)
net/ipv6/route.c
498
res->nh = match->fib6_nh;
net/ipv6/route.c
5044
static int fib6_nh_mtu_change(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
505
static bool __rt6_device_match(struct net *net, const struct fib6_nh *nh,
net/ipv6/route.c
5054
if (nh->fib_nh_dev == arg->dev) {
net/ipv6/route.c
5066
rt6_exceptions_update_pmtu(idev, nh, arg->mtu);
net/ipv6/route.c
5092
if (f6i->nh) {
net/ipv6/route.c
5094
return nexthop_for_each_fib6_nh(f6i->nh, fib6_nh_mtu_change,
net/ipv6/route.c
510
if (nh->fib_nh_flags & RTNH_F_DEAD)
net/ipv6/route.c
513
dev = nh->fib_nh_dev;
net/ipv6/route.c
531
struct fib6_nh *nh;
net/ipv6/route.c
534
static int __rt6_nh_dev_match(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
5344
struct rt6_nh *nh;
net/ipv6/route.c
5346
list_for_each_entry(nh, rt6_nh_list, list) {
net/ipv6/route.c
5348
if (rt6_duplicate_nexthop(nh->fib6_info, rt))
net/ipv6/route.c
5352
nh = kzalloc_obj(*nh);
net/ipv6/route.c
5353
if (!nh)
net/ipv6/route.c
5356
nh->fib6_info = rt;
net/ipv6/route.c
5357
memcpy(&nh->r_cfg, r_cfg, sizeof(*r_cfg));
net/ipv6/route.c
5358
list_add_tail(&nh->list, rt6_nh_list);
net/ipv6/route.c
538
arg->nh = nh;
net/ipv6/route.c
539
return __rt6_device_match(arg->net, nh, arg->saddr, arg->oif,
net/ipv6/route.c
5420
struct rt6_nh *nh, *nh_safe;
net/ipv6/route.c
544
static struct fib6_nh *rt6_nh_dev_match(struct net *net, struct nexthop *nh,
net/ipv6/route.c
5508
list_for_each_entry(nh, &rt6_nh_list, list) {
net/ipv6/route.c
5509
err = __ip6_ins_rt(nh->fib6_info, info, extack);
net/ipv6/route.c
5515
err_nh = nh;
net/ipv6/route.c
5519
rt_last = nh->fib6_info;
net/ipv6/route.c
5523
rt_notif = nh->fib6_info;
net/ipv6/route.c
556
if (nexthop_is_blackhole(nh))
net/ipv6/route.c
5576
list_for_each_entry(nh, &rt6_nh_list, list) {
net/ipv6/route.c
5577
if (err_nh == nh)
net/ipv6/route.c
5579
ip6_route_del(&nh->r_cfg, extack);
net/ipv6/route.c
5583
list_for_each_entry_safe(nh, nh_safe, &rt6_nh_list, list) {
net/ipv6/route.c
5584
fib6_info_release(nh->fib6_info);
net/ipv6/route.c
5585
list_del(&nh->list);
net/ipv6/route.c
5586
kfree(nh);
net/ipv6/route.c
559
if (nexthop_for_each_fib6_nh(nh, __rt6_nh_dev_match, &arg))
net/ipv6/route.c
560
return arg.nh;
net/ipv6/route.c
5681
static int rt6_nh_nlmsg_size(struct fib6_nh *nh, void *arg)
net/ipv6/route.c
5689
if (nh->fib_nh_lws) {
net/ipv6/route.c
5691
*nexthop_len += lwtunnel_get_encap_size(nh->fib_nh_lws);
net/ipv6/route.c
570
struct fib6_nh *nh;
net/ipv6/route.c
5702
struct fib6_nh *nh;
net/ipv6/route.c
5705
if (f6i->nh) {
net/ipv6/route.c
5707
nexthop_for_each_fib6_nh(f6i->nh, rt6_nh_nlmsg_size,
net/ipv6/route.c
5714
nh = f6i->fib6_nh;
net/ipv6/route.c
5717
rt6_nh_nlmsg_size(nh, &nexthop_len);
net/ipv6/route.c
5727
nexthop_len += lwtunnel_get_encap_size(nh->fib_nh_lws);
net/ipv6/route.c
573
if (unlikely(f6i->nh)) {
net/ipv6/route.c
574
nh = nexthop_fib6_nh(f6i->nh);
net/ipv6/route.c
5745
static int rt6_fill_node_nexthop(struct sk_buff *skb, struct nexthop *nh,
net/ipv6/route.c
5748
if (nexthop_is_multipath(nh)) {
net/ipv6/route.c
575
if (nexthop_is_blackhole(f6i->nh))
net/ipv6/route.c
5755
if (nexthop_mpath_fill_node(skb, nh, AF_INET6))
net/ipv6/route.c
5762
fib6_nh = nexthop_fib6_nh(nh);
net/ipv6/route.c
578
nh = f6i->fib6_nh;
net/ipv6/route.c
580
if (!(nh->fib_nh_flags & RTNH_F_DEAD))
net/ipv6/route.c
587
if (unlikely(spf6i->nh)) {
net/ipv6/route.c
588
nh = rt6_nh_dev_match(net, spf6i->nh, res, saddr,
net/ipv6/route.c
590
if (nh)
net/ipv6/route.c
5920
} else if (rt->nh) {
net/ipv6/route.c
5921
if (nla_put_u32(skb, RTA_NH_ID, rt->nh->id))
net/ipv6/route.c
5924
if (nexthop_is_blackhole(rt->nh))
net/ipv6/route.c
5928
rt6_fill_node_nexthop(skb, rt->nh, &nh_flags) < 0)
net/ipv6/route.c
593
nh = spf6i->fib6_nh;
net/ipv6/route.c
594
if (__rt6_device_match(net, nh, saddr, oif, flags))
net/ipv6/route.c
5969
static int fib6_info_nh_uses_dev(struct fib6_nh *nh, void *arg)
net/ipv6/route.c
5973
if (nh->fib_nh_dev == dev)
net/ipv6/route.c
5982
if (f6i->nh) {
net/ipv6/route.c
5985
return !!nexthop_for_each_fib6_nh(f6i->nh,
net/ipv6/route.c
6019
static int rt6_nh_dump_exceptions(struct fib6_nh *nh, void *arg)
net/ipv6/route.c
6027
bucket = fib6_nh_get_excptn_bucket(nh, NULL);
net/ipv6/route.c
605
nh = res->f6i->fib6_nh;
net/ipv6/route.c
609
if (unlikely(f6i->nh)) {
net/ipv6/route.c
610
nh = nexthop_fib6_nh(f6i->nh);
net/ipv6/route.c
611
if (nexthop_is_blackhole(f6i->nh))
net/ipv6/route.c
6122
if (rt->nh) {
net/ipv6/route.c
6123
err = nexthop_for_each_fib6_nh(rt->nh,
net/ipv6/route.c
614
nh = f6i->fib6_nh;
net/ipv6/route.c
617
if (nh->fib_nh_flags & RTNH_F_DEAD) {
net/ipv6/route.c
619
nh = res->f6i->fib6_nh;
net/ipv6/route.c
622
res->nh = nh;
net/ipv6/route.c
630
res->nh = nh;
net/ipv6/route.c
751
static int rt6_score_route(const struct fib6_nh *nh, u32 fib6_flags, int oif,
net/ipv6/route.c
756
if (!oif || nh->fib_nh_dev->ifindex == oif)
net/ipv6/route.c
765
!(fib6_flags & RTF_NONEXTHOP) && nh->fib_nh_gw_family) {
net/ipv6/route.c
766
int n = rt6_check_neigh(nh);
net/ipv6/route.c
773
static bool find_match(struct fib6_nh *nh, u32 fib6_flags,
net/ipv6/route.c
780
if (nh->fib_nh_flags & RTNH_F_DEAD)
net/ipv6/route.c
783
if (ip6_ignore_linkdown(nh->fib_nh_dev) &&
net/ipv6/route.c
784
nh->fib_nh_flags & RTNH_F_LINKDOWN &&
net/ipv6/route.c
788
m = rt6_score_route(nh, fib6_flags, oif, strict);
net/ipv6/route.c
797
rt6_probe(nh);
net/ipv6/route.c
815
struct fib6_nh *nh;
net/ipv6/route.c
818
static int rt6_nh_find_match(struct fib6_nh *nh, void *_arg)
net/ipv6/route.c
822
if (find_match(nh, arg->flags, arg->oif, arg->strict, arg->mpri,
net/ipv6/route.c
824
arg->nh = nh;
net/ipv6/route.c
840
struct fib6_nh *nh;
net/ipv6/route.c
850
if (unlikely(f6i->nh)) {
net/ipv6/route.c
859
if (nexthop_is_blackhole(f6i->nh)) {
net/ipv6/route.c
863
res->nh = nexthop_fib6_nh(f6i->nh);
net/ipv6/route.c
866
nexthop_for_each_fib6_nh(f6i->nh, rt6_nh_find_match,
net/ipv6/route.c
868
matched = !!arg.nh;
net/ipv6/route.c
869
nh = arg.nh;
net/ipv6/route.c
871
nh = f6i->fib6_nh;
net/ipv6/route.c
872
if (find_match(nh, f6i->fib6_flags, oif, strict,
net/ipv6/route.c
878
res->nh = nh;
net/ipv6/route.c
957
res->nh = res->f6i->fib6_nh;
net/ipv6/route.c
966
res->nh->fib_nh_gw_family;
net/mpls/af_mpls.c
118
static u8 *__mpls_nh_via(struct mpls_route *rt, struct mpls_nh *nh)
net/mpls/af_mpls.c
120
return (u8 *)nh + rt->rt_via_offset;
net/mpls/af_mpls.c
124
const struct mpls_nh *nh)
net/mpls/af_mpls.c
126
return __mpls_nh_via((struct mpls_route *)rt, (struct mpls_nh *)nh);
net/mpls/af_mpls.c
129
static unsigned int mpls_nh_header_size(const struct mpls_nh *nh)
net/mpls/af_mpls.c
132
return nh->nh_labels * sizeof(struct mpls_shim_hdr);
net/mpls/af_mpls.c
1544
if (!nh->nh_dev || nh->nh_dev == dev)
net/mpls/af_mpls.c
1546
if (nh->nh_dev == dev)
net/mpls/af_mpls.c
1568
unsigned int nh_flags = nh->nh_flags;
net/mpls/af_mpls.c
1570
if (nh->nh_dev != dev) {
net/mpls/af_mpls.c
1572
netdev_hold(nh->nh_dev, &nh->nh_dev_tracker,
net/mpls/af_mpls.c
1587
nh->nh_dev = NULL;
net/mpls/af_mpls.c
1589
if (nh->nh_flags != nh_flags)
net/mpls/af_mpls.c
1590
WRITE_ONCE(nh->nh_flags, nh_flags);
net/mpls/af_mpls.c
1620
unsigned int nh_flags = nh->nh_flags;
net/mpls/af_mpls.c
1626
if (nh->nh_dev != dev)
net/mpls/af_mpls.c
1630
WRITE_ONCE(nh->nh_flags, nh_flags);
net/mpls/af_mpls.c
2070
const struct mpls_nh *nh = rt->rt_nh;
net/mpls/af_mpls.c
2072
if (nh->nh_labels &&
net/mpls/af_mpls.c
2073
nla_put_labels(skb, RTA_NEWDST, nh->nh_labels,
net/mpls/af_mpls.c
2074
nh->nh_label))
net/mpls/af_mpls.c
2076
if (nh->nh_via_table != MPLS_NEIGH_TABLE_UNSPEC &&
net/mpls/af_mpls.c
2077
nla_put_via(skb, nh->nh_via_table, mpls_nh_via(rt, nh),
net/mpls/af_mpls.c
2078
nh->nh_via_alen))
net/mpls/af_mpls.c
2080
dev = nh->nh_dev;
net/mpls/af_mpls.c
2083
if (nh->nh_flags & RTNH_F_LINKDOWN)
net/mpls/af_mpls.c
2085
if (nh->nh_flags & RTNH_F_DEAD)
net/mpls/af_mpls.c
2098
dev = nh->nh_dev;
net/mpls/af_mpls.c
2107
if (nh->nh_flags & RTNH_F_LINKDOWN) {
net/mpls/af_mpls.c
2111
if (nh->nh_flags & RTNH_F_DEAD) {
net/mpls/af_mpls.c
2116
if (nh->nh_labels && nla_put_labels(skb, RTA_NEWDST,
net/mpls/af_mpls.c
2117
nh->nh_labels,
net/mpls/af_mpls.c
2118
nh->nh_label))
net/mpls/af_mpls.c
2120
if (nh->nh_via_table != MPLS_NEIGH_TABLE_UNSPEC &&
net/mpls/af_mpls.c
2121
nla_put_via(skb, nh->nh_via_table,
net/mpls/af_mpls.c
2122
mpls_nh_via(rt, nh),
net/mpls/af_mpls.c
2123
nh->nh_via_alen))
net/mpls/af_mpls.c
2213
struct mpls_nh *nh = rt->rt_nh;
net/mpls/af_mpls.c
2215
if (nh->nh_dev == dev)
net/mpls/af_mpls.c
2219
if (nh->nh_dev == dev)
net/mpls/af_mpls.c
2298
struct mpls_nh *nh = rt->rt_nh;
net/mpls/af_mpls.c
2300
if (nh->nh_dev)
net/mpls/af_mpls.c
2302
if (nh->nh_via_table != MPLS_NEIGH_TABLE_UNSPEC) /* RTA_VIA */
net/mpls/af_mpls.c
2303
payload += nla_total_size(2 + nh->nh_via_alen);
net/mpls/af_mpls.c
2304
if (nh->nh_labels) /* RTA_NEWDST */
net/mpls/af_mpls.c
2305
payload += nla_total_size(nh->nh_labels * 4);
net/mpls/af_mpls.c
2311
if (!nh->nh_dev)
net/mpls/af_mpls.c
2315
if (nh->nh_via_table != MPLS_NEIGH_TABLE_UNSPEC)
net/mpls/af_mpls.c
2316
nhsize += nla_total_size(2 + nh->nh_via_alen);
net/mpls/af_mpls.c
2317
if (nh->nh_labels)
net/mpls/af_mpls.c
2318
nhsize += nla_total_size(nh->nh_labels * 4);
net/mpls/af_mpls.c
2422
const struct mpls_nh *nh;
net/mpls/af_mpls.c
2520
nh = mpls_select_multipath(rt, skb);
net/mpls/af_mpls.c
2521
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
280
unsigned int nh_flags = READ_ONCE(nh->nh_flags);
net/mpls/af_mpls.c
285
return nh;
net/mpls/af_mpls.c
370
const struct mpls_nh *nh;
net/mpls/af_mpls.c
416
nh = mpls_select_multipath(rt, skb);
net/mpls/af_mpls.c
417
if (!nh)
net/mpls/af_mpls.c
436
out_dev = nh->nh_dev;
net/mpls/af_mpls.c
441
new_header_size = mpls_nh_header_size(nh);
net/mpls/af_mpls.c
470
for (i = nh->nh_labels - 1; i >= 0; i--) {
net/mpls/af_mpls.c
471
hdr[i] = mpls_entry_encode(nh->nh_label[i],
net/mpls/af_mpls.c
480
if (nh->nh_via_table == MPLS_NEIGH_TABLE_UNSPEC)
net/mpls/af_mpls.c
484
err = neigh_xmit(nh->nh_via_table, out_dev,
net/mpls/af_mpls.c
485
mpls_nh_via(rt, nh), skb);
net/mpls/af_mpls.c
563
netdev_put(nh->nh_dev, &nh->nh_dev_tracker);
net/mpls/af_mpls.c
622
struct mpls_nh *nh,
net/mpls/af_mpls.c
635
netdev_hold(dev, &nh->nh_dev_tracker, GFP_KERNEL);
net/mpls/af_mpls.c
642
struct mpls_nh *nh,
net/mpls/af_mpls.c
651
struct mpls_nh *nh,
net/mpls/af_mpls.c
665
netdev_hold(dev, &nh->nh_dev_tracker, GFP_KERNEL);
net/mpls/af_mpls.c
672
struct mpls_nh *nh,
net/mpls/af_mpls.c
681
struct mpls_nh *nh, int oif)
net/mpls/af_mpls.c
686
switch (nh->nh_via_table) {
net/mpls/af_mpls.c
688
dev = inet_fib_lookup_dev(net, nh, mpls_nh_via(rt, nh));
net/mpls/af_mpls.c
691
dev = inet6_fib_lookup_dev(net, nh, mpls_nh_via(rt, nh));
net/mpls/af_mpls.c
698
&nh->nh_dev_tracker, GFP_KERNEL);
net/mpls/af_mpls.c
707
nh->nh_dev = dev;
net/mpls/af_mpls.c
713
struct mpls_nh *nh, int oif)
net/mpls/af_mpls.c
718
dev = find_outdev(net, rt, nh, oif);
net/mpls/af_mpls.c
729
if ((nh->nh_via_table == NEIGH_LINK_TABLE) &&
net/mpls/af_mpls.c
730
(dev->addr_len != nh->nh_via_alen))
net/mpls/af_mpls.c
734
nh->nh_flags |= RTNH_F_DEAD;
net/mpls/af_mpls.c
740
nh->nh_flags |= RTNH_F_LINKDOWN;
net/mpls/af_mpls.c
746
netdev_put(nh->nh_dev, &nh->nh_dev_tracker);
net/mpls/af_mpls.c
747
nh->nh_dev = NULL;
net/mpls/af_mpls.c
804
struct mpls_nh *nh = rt->rt_nh;
net/mpls/af_mpls.c
808
if (!nh)
net/mpls/af_mpls.c
811
nh->nh_labels = cfg->rc_output_labels;
net/mpls/af_mpls.c
812
for (i = 0; i < nh->nh_labels; i++)
net/mpls/af_mpls.c
813
nh->nh_label[i] = cfg->rc_output_label[i];
net/mpls/af_mpls.c
815
nh->nh_via_table = cfg->rc_via_table;
net/mpls/af_mpls.c
816
memcpy(__mpls_nh_via(rt, nh), cfg->rc_via, cfg->rc_via_alen);
net/mpls/af_mpls.c
817
nh->nh_via_alen = cfg->rc_via_alen;
net/mpls/af_mpls.c
819
err = mpls_nh_assign_dev(net, rt, nh, cfg->rc_ifindex);
net/mpls/af_mpls.c
823
if (nh->nh_flags & (RTNH_F_DEAD | RTNH_F_LINKDOWN))
net/mpls/af_mpls.c
833
struct mpls_nh *nh, int oif, struct nlattr *via,
net/mpls/af_mpls.c
839
if (!nh)
net/mpls/af_mpls.c
843
err = nla_get_labels(newdst, max_labels, &nh->nh_labels,
net/mpls/af_mpls.c
844
nh->nh_label, extack);
net/mpls/af_mpls.c
850
err = nla_get_via(via, &nh->nh_via_alen, &nh->nh_via_table,
net/mpls/af_mpls.c
851
__mpls_nh_via(rt, nh), extack);
net/mpls/af_mpls.c
855
nh->nh_via_table = MPLS_NEIGH_TABLE_UNSPEC;
net/mpls/af_mpls.c
858
err = mpls_nh_assign_dev(net, rt, nh, oif);
net/mpls/af_mpls.c
951
err = mpls_nh_build(cfg->rc_nlinfo.nl_net, rt, nh,
net/mpls/af_mpls.c
957
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
185
unsigned char *nh;
net/netfilter/utils.c
189
nh = (unsigned char *)(ipv6_hdr(skb) + 1);
net/netfilter/utils.c
190
len = (nh[1] + 1) << 3;
net/netfilter/utils.c
194
nh = skb_network_header(skb);
net/netfilter/utils.c
201
if (nh[off] == IPV6_TLV_PAD1) {
net/netfilter/utils.c
208
optlen = nh[off + 1] + 2;
net/netfilter/utils.c
212
if (nh[off] == IPV6_TLV_JUMBO) {
net/netfilter/utils.c
215
if (nh[off + 1] != 4 || (off & 3) != 2)
net/netfilter/utils.c
217
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
1182
struct ipv6hdr *nh;
net/openvswitch/actions.c
1185
sizeof(*nh));
net/openvswitch/actions.c
1189
nh = ipv6_hdr(skb);
net/openvswitch/actions.c
1191
if (nh->hop_limit <= 1)
net/openvswitch/actions.c
1194
key->ip.ttl = --nh->hop_limit;
net/openvswitch/actions.c
1196
struct iphdr *nh;
net/openvswitch/actions.c
1200
sizeof(*nh));
net/openvswitch/actions.c
1204
nh = ip_hdr(skb);
net/openvswitch/actions.c
1205
if (nh->ttl <= 1)
net/openvswitch/actions.c
1208
old_ttl = nh->ttl--;
net/openvswitch/actions.c
1209
csum_replace2(&nh->check, htons(old_ttl << 8),
net/openvswitch/actions.c
1210
htons(nh->ttl << 8));
net/openvswitch/actions.c
1211
key->ip.ttl = nh->ttl;
net/openvswitch/actions.c
288
struct nshhdr *nh = (struct nshhdr *)buffer;
net/openvswitch/actions.c
291
err = nsh_hdr_from_nlattr(a, nh, NSH_HDR_MAX_LEN);
net/openvswitch/actions.c
295
err = nsh_push(skb, nh);
net/openvswitch/actions.c
322
static void update_ip_l4_checksum(struct sk_buff *skb, struct iphdr *nh,
net/openvswitch/actions.c
327
if (nh->frag_off & htons(IP_OFFSET))
net/openvswitch/actions.c
330
if (nh->protocol == IPPROTO_TCP) {
net/openvswitch/actions.c
334
} else if (nh->protocol == IPPROTO_UDP) {
net/openvswitch/actions.c
348
static void set_ip_addr(struct sk_buff *skb, struct iphdr *nh,
net/openvswitch/actions.c
351
update_ip_l4_checksum(skb, nh, *addr, new_addr);
net/openvswitch/actions.c
352
csum_replace4(&nh->check, *addr, new_addr);
net/openvswitch/actions.c
406
static void set_ipv6_dsfield(struct sk_buff *skb, struct ipv6hdr *nh, u8 ipv6_tclass, u8 mask)
net/openvswitch/actions.c
408
u8 old_ipv6_tclass = ipv6_get_dsfield(nh);
net/openvswitch/actions.c
416
ipv6_change_dsfield(nh, ~mask, ipv6_tclass);
net/openvswitch/actions.c
419
static void set_ipv6_fl(struct sk_buff *skb, struct ipv6hdr *nh, u32 fl, u32 mask)
net/openvswitch/actions.c
423
ofl = nh->flow_lbl[0] << 16 | nh->flow_lbl[1] << 8 | nh->flow_lbl[2];
net/openvswitch/actions.c
427
nh->flow_lbl[0] = (u8)(fl >> 16);
net/openvswitch/actions.c
428
nh->flow_lbl[1] = (u8)(fl >> 8);
net/openvswitch/actions.c
429
nh->flow_lbl[2] = (u8)fl;
net/openvswitch/actions.c
435
static void set_ipv6_ttl(struct sk_buff *skb, struct ipv6hdr *nh, u8 new_ttl, u8 mask)
net/openvswitch/actions.c
437
new_ttl = OVS_MASKED(nh->hop_limit, new_ttl, mask);
net/openvswitch/actions.c
440
csum_replace(&skb->csum, (__force __wsum)(nh->hop_limit << 8),
net/openvswitch/actions.c
442
nh->hop_limit = new_ttl;
net/openvswitch/actions.c
445
static void set_ip_ttl(struct sk_buff *skb, struct iphdr *nh, u8 new_ttl,
net/openvswitch/actions.c
448
new_ttl = OVS_MASKED(nh->ttl, new_ttl, mask);
net/openvswitch/actions.c
450
csum_replace2(&nh->check, htons(nh->ttl << 8), htons(new_ttl << 8));
net/openvswitch/actions.c
451
nh->ttl = new_ttl;
net/openvswitch/actions.c
458
struct iphdr *nh;
net/openvswitch/actions.c
467
nh = ip_hdr(skb);
net/openvswitch/actions.c
474
new_addr = OVS_MASKED(nh->saddr, key->ipv4_src, mask->ipv4_src);
net/openvswitch/actions.c
476
if (unlikely(new_addr != nh->saddr)) {
net/openvswitch/actions.c
477
set_ip_addr(skb, nh, &nh->saddr, new_addr);
net/openvswitch/actions.c
482
new_addr = OVS_MASKED(nh->daddr, key->ipv4_dst, mask->ipv4_dst);
net/openvswitch/actions.c
484
if (unlikely(new_addr != nh->daddr)) {
net/openvswitch/actions.c
485
set_ip_addr(skb, nh, &nh->daddr, new_addr);
net/openvswitch/actions.c
490
ipv4_change_dsfield(nh, ~mask->ipv4_tos, key->ipv4_tos);
net/openvswitch/actions.c
491
flow_key->ip.tos = nh->tos;
net/openvswitch/actions.c
494
set_ip_ttl(skb, nh, key->ipv4_ttl, mask->ipv4_ttl);
net/openvswitch/actions.c
495
flow_key->ip.ttl = nh->ttl;
net/openvswitch/actions.c
510
struct ipv6hdr *nh;
net/openvswitch/actions.c
518
nh = ipv6_hdr(skb);
net/openvswitch/actions.c
525
__be32 *saddr = (__be32 *)&nh->saddr;
net/openvswitch/actions.c
541
__be32 *daddr = (__be32 *)&nh->daddr;
net/openvswitch/actions.c
547
if (ipv6_ext_hdr(nh->nexthdr))
net/openvswitch/actions.c
560
set_ipv6_dsfield(skb, nh, key->ipv6_tclass, mask->ipv6_tclass);
net/openvswitch/actions.c
561
flow_key->ip.tos = ipv6_get_dsfield(nh);
net/openvswitch/actions.c
564
set_ipv6_fl(skb, nh, ntohl(key->ipv6_label),
net/openvswitch/actions.c
567
*(__be32 *)nh & htonl(IPV6_FLOWINFO_FLOWLABEL);
net/openvswitch/actions.c
570
set_ipv6_ttl(skb, nh, key->ipv6_hlimit, mask->ipv6_hlimit);
net/openvswitch/actions.c
571
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
103
rt = (struct ipv6_rt_hdr *)(nh + offset);
net/xfrm/xfrm_output.c
85
const unsigned char *nh = skb_network_header(skb);
net/xfrm/xfrm_output.c
90
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
348
struct fdt_node_header *nh;
scripts/dtc/libfdt/fdt_rw.c
373
nh = fdt_offset_ptr_w_(fdt, offset);
scripts/dtc/libfdt/fdt_rw.c
374
nodelen = sizeof(*nh) + FDT_TAGALIGN(namelen+1) + FDT_TAGSIZE;
scripts/dtc/libfdt/fdt_rw.c
376
err = fdt_splice_struct_(fdt, nh, 0, nodelen);
scripts/dtc/libfdt/fdt_rw.c
380
nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
scripts/dtc/libfdt/fdt_rw.c
381
memset(nh->name, 0, FDT_TAGALIGN(namelen+1));
scripts/dtc/libfdt/fdt_rw.c
382
memcpy(nh->name, name, namelen);
scripts/dtc/libfdt/fdt_rw.c
383
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
1013
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1017
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1029
req.nh.nlmsg_len = NLMSG_LENGTH(0);
tools/testing/selftests/net/ipsec.c
1030
req.nh.nlmsg_type = XFRM_MSG_GETSA;
tools/testing/selftests/net/ipsec.c
1031
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
tools/testing/selftests/net/ipsec.c
1032
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
1041
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_ADDRESS_FILTER,
tools/testing/selftests/net/ipsec.c
1045
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1055
if (answer.nh.nlmsg_type == NLMSG_ERROR) {
tools/testing/selftests/net/ipsec.c
1059
} else if (answer.nh.nlmsg_type == NLMSG_DONE) {
tools/testing/selftests/net/ipsec.c
1064
} else if (answer.nh.nlmsg_type == XFRM_MSG_NEWSA) {
tools/testing/selftests/net/ipsec.c
1106
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1114
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/ipsec.c
1115
req.nh.nlmsg_type = XFRM_MSG_NEWPOLICY;
tools/testing/selftests/net/ipsec.c
1116
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
1117
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
1146
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_TMPL, &tmpl, sizeof(tmpl)))
tools/testing/selftests/net/ipsec.c
1149
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1181
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1187
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.id));
tools/testing/selftests/net/ipsec.c
1188
req.nh.nlmsg_type = XFRM_MSG_DELPOLICY;
tools/testing/selftests/net/ipsec.c
1189
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
1190
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
1200
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1231
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1238
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.id));
tools/testing/selftests/net/ipsec.c
1239
req.nh.nlmsg_type = XFRM_MSG_DELSA;
tools/testing/selftests/net/ipsec.c
1240
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
1241
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
1250
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_SRCADDR, &saddr, sizeof(saddr)))
tools/testing/selftests/net/ipsec.c
1253
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1282
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1286
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1294
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.spi));
tools/testing/selftests/net/ipsec.c
1295
req.nh.nlmsg_type = XFRM_MSG_ALLOCSPI;
tools/testing/selftests/net/ipsec.c
1296
req.nh.nlmsg_flags = NLM_F_REQUEST;
tools/testing/selftests/net/ipsec.c
1297
req.nh.nlmsg_seq = (*seq)++;
tools/testing/selftests/net/ipsec.c
1304
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1312
} else if (answer.nh.nlmsg_type == XFRM_MSG_NEWSA) {
tools/testing/selftests/net/ipsec.c
1321
} else if (answer.nh.nlmsg_type != NLMSG_ERROR) {
tools/testing/selftests/net/ipsec.c
1322
printk("expected NLMSG_ERROR, got %d", (int)answer.nh.nlmsg_type);
tools/testing/selftests/net/ipsec.c
1372
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1387
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.acq));
tools/testing/selftests/net/ipsec.c
1388
req.nh.nlmsg_type = XFRM_MSG_ACQUIRE;
tools/testing/selftests/net/ipsec.c
1389
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
1390
req.nh.nlmsg_seq = (*seq)++;
tools/testing/selftests/net/ipsec.c
1399
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_TMPL, &xfrm_tmpl, sizeof(xfrm_tmpl)))
tools/testing/selftests/net/ipsec.c
1402
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1410
} else if (req.nh.nlmsg_type != NLMSG_ERROR) {
tools/testing/selftests/net/ipsec.c
1411
printk("expected NLMSG_ERROR, got %d", (int)req.nh.nlmsg_type);
tools/testing/selftests/net/ipsec.c
1443
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1465
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.expire));
tools/testing/selftests/net/ipsec.c
1466
req.nh.nlmsg_type = XFRM_MSG_EXPIRE;
tools/testing/selftests/net/ipsec.c
1467
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
1468
req.nh.nlmsg_seq = (*seq)++;
tools/testing/selftests/net/ipsec.c
1476
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1484
} else if (req.nh.nlmsg_type != NLMSG_ERROR) {
tools/testing/selftests/net/ipsec.c
1485
printk("expected NLMSG_ERROR, got %d", (int)req.nh.nlmsg_type);
tools/testing/selftests/net/ipsec.c
1515
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1540
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.expire));
tools/testing/selftests/net/ipsec.c
1541
req.nh.nlmsg_type = XFRM_MSG_POLEXPIRE;
tools/testing/selftests/net/ipsec.c
1542
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
1543
req.nh.nlmsg_seq = (*seq)++;
tools/testing/selftests/net/ipsec.c
1554
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1562
} else if (req.nh.nlmsg_type != NLMSG_ERROR) {
tools/testing/selftests/net/ipsec.c
1563
printk("expected NLMSG_ERROR, got %d", (int)req.nh.nlmsg_type);
tools/testing/selftests/net/ipsec.c
1596
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1606
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.unused));
tools/testing/selftests/net/ipsec.c
1607
req.nh.nlmsg_type = XFRM_MSG_NEWSPDINFO;
tools/testing/selftests/net/ipsec.c
1608
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
1609
req.nh.nlmsg_seq = (*seq)++;
tools/testing/selftests/net/ipsec.c
1613
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_SPD_IPV4_HTHRESH, &thresh, sizeof(thresh)))
tools/testing/selftests/net/ipsec.c
1618
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_SPD_IPV6_HTHRESH, &thresh, sizeof(thresh)))
tools/testing/selftests/net/ipsec.c
1623
if (rtattr_pack(&req.nh, sizeof(req), XFRMA_IF_ID, NULL, 0)) {
tools/testing/selftests/net/ipsec.c
1629
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1637
} else if (req.nh.nlmsg_type != NLMSG_ERROR) {
tools/testing/selftests/net/ipsec.c
1638
printk("expected NLMSG_ERROR, got %d", (int)req.nh.nlmsg_type);
tools/testing/selftests/net/ipsec.c
1653
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
1668
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.unused));
tools/testing/selftests/net/ipsec.c
1669
req.nh.nlmsg_type = XFRM_MSG_GETSPDINFO;
tools/testing/selftests/net/ipsec.c
1670
req.nh.nlmsg_flags = NLM_F_REQUEST;
tools/testing/selftests/net/ipsec.c
1671
req.nh.nlmsg_seq = (*seq)++;
tools/testing/selftests/net/ipsec.c
1672
if (send(xfrm_sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
1680
} else if (req.nh.nlmsg_type == XFRM_MSG_NEWSPDINFO) {
tools/testing/selftests/net/ipsec.c
1681
size_t len = NLMSG_PAYLOAD(&req.nh, sizeof(req.unused));
tools/testing/selftests/net/ipsec.c
1711
} else if (req.nh.nlmsg_type != NLMSG_ERROR) {
tools/testing/selftests/net/ipsec.c
1712
printk("expected NLMSG_ERROR, got %d", (int)req.nh.nlmsg_type);
tools/testing/selftests/net/ipsec.c
211
static inline struct rtattr *rtattr_hdr(struct nlmsghdr *nh)
tools/testing/selftests/net/ipsec.c
213
return (struct rtattr *)((char *)(nh) + RTA_ALIGN((nh)->nlmsg_len));
tools/testing/selftests/net/ipsec.c
216
static int rtattr_pack(struct nlmsghdr *nh, size_t req_sz,
tools/testing/selftests/net/ipsec.c
220
struct rtattr *attr = rtattr_hdr(nh);
tools/testing/selftests/net/ipsec.c
221
size_t nl_size = RTA_ALIGN(nh->nlmsg_len) + RTA_LENGTH(size);
tools/testing/selftests/net/ipsec.c
227
nh->nlmsg_len = nl_size;
tools/testing/selftests/net/ipsec.c
237
static struct rtattr *_rtattr_begin(struct nlmsghdr *nh, size_t req_sz,
tools/testing/selftests/net/ipsec.c
240
struct rtattr *ret = rtattr_hdr(nh);
tools/testing/selftests/net/ipsec.c
242
if (rtattr_pack(nh, req_sz, rta_type, payload, size))
tools/testing/selftests/net/ipsec.c
248
static inline struct rtattr *rtattr_begin(struct nlmsghdr *nh, size_t req_sz,
tools/testing/selftests/net/ipsec.c
251
return _rtattr_begin(nh, req_sz, rta_type, 0, 0);
tools/testing/selftests/net/ipsec.c
254
static inline void rtattr_end(struct nlmsghdr *nh, struct rtattr *attr)
tools/testing/selftests/net/ipsec.c
256
char *nlmsg_end = (char *)nh + nh->nlmsg_len;
tools/testing/selftests/net/ipsec.c
261
static int veth_pack_peerb(struct nlmsghdr *nh, size_t req_sz,
tools/testing/selftests/net/ipsec.c
271
peer_attr = _rtattr_begin(nh, req_sz, VETH_INFO_PEER, &pi, sizeof(pi));
tools/testing/selftests/net/ipsec.c
275
if (rtattr_pack(nh, req_sz, IFLA_IFNAME, peer, strlen(peer)))
tools/testing/selftests/net/ipsec.c
278
if (rtattr_pack(nh, req_sz, IFLA_NET_NS_FD, &ns, sizeof(ns)))
tools/testing/selftests/net/ipsec.c
281
rtattr_end(nh, peer_attr);
tools/testing/selftests/net/ipsec.c
314
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
322
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/ipsec.c
323
req.nh.nlmsg_type = RTM_NEWLINK;
tools/testing/selftests/net/ipsec.c
324
req.nh.nlmsg_flags = flags;
tools/testing/selftests/net/ipsec.c
325
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
329
if (rtattr_pack(&req.nh, sizeof(req), IFLA_IFNAME, peera, strlen(peera)))
tools/testing/selftests/net/ipsec.c
332
if (rtattr_pack(&req.nh, sizeof(req), IFLA_NET_NS_FD, &ns_a, sizeof(ns_a)))
tools/testing/selftests/net/ipsec.c
335
link_info = rtattr_begin(&req.nh, sizeof(req), IFLA_LINKINFO);
tools/testing/selftests/net/ipsec.c
339
if (rtattr_pack(&req.nh, sizeof(req), IFLA_INFO_KIND, veth_type, sizeof(veth_type)))
tools/testing/selftests/net/ipsec.c
342
info_data = rtattr_begin(&req.nh, sizeof(req), IFLA_INFO_DATA);
tools/testing/selftests/net/ipsec.c
346
if (veth_pack_peerb(&req.nh, sizeof(req), peerb, ns_b))
tools/testing/selftests/net/ipsec.c
349
rtattr_end(&req.nh, info_data);
tools/testing/selftests/net/ipsec.c
350
rtattr_end(&req.nh, link_info);
tools/testing/selftests/net/ipsec.c
352
if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
364
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
370
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/ipsec.c
371
req.nh.nlmsg_type = RTM_NEWADDR;
tools/testing/selftests/net/ipsec.c
372
req.nh.nlmsg_flags = flags;
tools/testing/selftests/net/ipsec.c
373
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
388
if (rtattr_pack(&req.nh, sizeof(req), IFA_LOCAL, &addr, sizeof(addr)))
tools/testing/selftests/net/ipsec.c
391
if (rtattr_pack(&req.nh, sizeof(req), IFA_ADDRESS, &addr, sizeof(addr)))
tools/testing/selftests/net/ipsec.c
394
if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
404
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
410
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/ipsec.c
411
req.nh.nlmsg_type = RTM_NEWLINK;
tools/testing/selftests/net/ipsec.c
412
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
413
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
420
if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
431
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
438
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.rt));
tools/testing/selftests/net/ipsec.c
439
req.nh.nlmsg_type = RTM_NEWROUTE;
tools/testing/selftests/net/ipsec.c
440
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE;
tools/testing/selftests/net/ipsec.c
441
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
449
if (rtattr_pack(&req.nh, sizeof(req), RTA_DST, &dst, sizeof(dst)))
tools/testing/selftests/net/ipsec.c
452
if (rtattr_pack(&req.nh, sizeof(req), RTA_PREFSRC, &src, sizeof(src)))
tools/testing/selftests/net/ipsec.c
455
if (rtattr_pack(&req.nh, sizeof(req), RTA_OIF, &index, sizeof(index)))
tools/testing/selftests/net/ipsec.c
458
if (send(sock, &req, req.nh.nlmsg_len, 0) < 0) {
tools/testing/selftests/net/ipsec.c
828
static int xfrm_state_pack_algo(struct nlmsghdr *nh, size_t req_sz,
tools/testing/selftests/net/ipsec.c
893
if (rtattr_pack(nh, req_sz, type, &alg, sizeof(alg)))
tools/testing/selftests/net/ipsec.c
908
if (rtattr_pack(nh, req_sz, type, &alg, sizeof(alg)))
tools/testing/selftests/net/ipsec.c
924
struct nlmsghdr nh;
tools/testing/selftests/net/ipsec.c
930
req.nh.nlmsg_len = NLMSG_LENGTH(sizeof(req.info));
tools/testing/selftests/net/ipsec.c
931
req.nh.nlmsg_type = XFRM_MSG_NEWSA;
tools/testing/selftests/net/ipsec.c
932
req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
tools/testing/selftests/net/ipsec.c
933
req.nh.nlmsg_seq = seq;
tools/testing/selftests/net/ipsec.c
959
if (xfrm_state_pack_algo(&req.nh, sizeof(req), desc))
tools/testing/selftests/net/ipsec.c
962
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
1082
static void print_addrs(struct nlmsghdr *nh, int pm_family, int total_len)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1086
for (; NLMSG_OK(nh, total_len); nh = NLMSG_NEXT(nh, total_len)) {
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1087
int len = nh->nlmsg_len;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1089
if (nh->nlmsg_type == NLMSG_DONE)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1091
if (nh->nlmsg_type == NLMSG_ERROR)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1092
nl_error(nh);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1093
if (nh->nlmsg_type != pm_family)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1097
attrs = (struct rtattr *) ((char *) NLMSG_DATA(nh) +
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1115
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1122
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1157
print_addrs(nh, pm_family, do_nl_req(fd, nh, off, sizeof(data)));
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1167
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1179
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1182
nh->nlmsg_flags |= NLM_F_DUMP;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1183
nh->nlmsg_seq = 1;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1184
nh->nlmsg_pid = pid;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1185
nh->nlmsg_len = off;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1196
print_addrs(nh, pm_family, do_nl_req(fd, nh, off, sizeof(data)));
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1205
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1209
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1213
do_nl_req(fd, nh, off, 0);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1217
static void print_limits(struct nlmsghdr *nh, int pm_family, int total_len)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1222
for (; NLMSG_OK(nh, total_len); nh = NLMSG_NEXT(nh, total_len)) {
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1223
int len = nh->nlmsg_len;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1225
if (nh->nlmsg_type == NLMSG_DONE)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1227
if (nh->nlmsg_type == NLMSG_ERROR)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1228
nl_error(nh);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1229
if (nh->nlmsg_type != pm_family)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1233
attrs = (struct rtattr *) ((char *) NLMSG_DATA(nh) +
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1259
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1272
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1294
len = do_nl_req(fd, nh, off, len);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1296
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
1354
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
1367
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
1530
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
220
void *data = nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
226
nh->nlmsg_flags |= NLM_F_ACK;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
230
nh->nlmsg_len = len;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
241
for (; NLMSG_OK(nh, rem); nh = NLMSG_NEXT(nh, rem)) {
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
242
if (nh->nlmsg_type == NLMSG_DONE)
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
245
if (nh->nlmsg_type == NLMSG_ERROR && nl_error(nh))
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
327
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
333
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
343
do_nl_req(fd, nh, off, sizeof(data));
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
354
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
365
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
454
do_nl_req(fd, nh, off, 0);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
466
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
480
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
588
do_nl_req(fd, nh, off, 0);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
598
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
606
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
638
do_nl_req(fd, nh, off, 0);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
651
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
658
nh = (void *)data;
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
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
764
do_nl_req(fd, nh, off, 0);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
775
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
784
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
900
do_nl_req(fd, nh, off, 0);
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
910
struct nlmsghdr *nh;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
917
nh = (void *)data;
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
968
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);