Lines Matching refs:neigh_entry

1795 			struct mlxsw_sp_neigh_entry *neigh_entry)  in mlxsw_sp_rif_neigh_next()  argument
1797 if (!neigh_entry) { in mlxsw_sp_rif_neigh_next()
1802 typeof(*neigh_entry), in mlxsw_sp_rif_neigh_next()
1805 if (list_is_last(&neigh_entry->rif_list_node, &rif->neigh_list)) in mlxsw_sp_rif_neigh_next()
1807 return list_next_entry(neigh_entry, rif_list_node); in mlxsw_sp_rif_neigh_next()
1810 int mlxsw_sp_neigh_entry_type(struct mlxsw_sp_neigh_entry *neigh_entry) in mlxsw_sp_neigh_entry_type() argument
1812 return neigh_entry->key.n->tbl->family; in mlxsw_sp_neigh_entry_type()
1816 mlxsw_sp_neigh_entry_ha(struct mlxsw_sp_neigh_entry *neigh_entry) in mlxsw_sp_neigh_entry_ha() argument
1818 return neigh_entry->ha; in mlxsw_sp_neigh_entry_ha()
1821 u32 mlxsw_sp_neigh4_entry_dip(struct mlxsw_sp_neigh_entry *neigh_entry) in mlxsw_sp_neigh4_entry_dip() argument
1825 n = neigh_entry->key.n; in mlxsw_sp_neigh4_entry_dip()
1830 mlxsw_sp_neigh6_entry_dip(struct mlxsw_sp_neigh_entry *neigh_entry) in mlxsw_sp_neigh6_entry_dip() argument
1834 n = neigh_entry->key.n; in mlxsw_sp_neigh6_entry_dip()
1839 struct mlxsw_sp_neigh_entry *neigh_entry, in mlxsw_sp_neigh_counter_get() argument
1842 if (!neigh_entry->counter_valid) in mlxsw_sp_neigh_counter_get()
1845 return mlxsw_sp_flow_counter_get(mlxsw_sp, neigh_entry->counter_index, in mlxsw_sp_neigh_counter_get()
1853 struct mlxsw_sp_neigh_entry *neigh_entry; in mlxsw_sp_neigh_entry_alloc() local
1855 neigh_entry = kzalloc(sizeof(*neigh_entry), GFP_KERNEL); in mlxsw_sp_neigh_entry_alloc()
1856 if (!neigh_entry) in mlxsw_sp_neigh_entry_alloc()
1859 neigh_entry->key.n = n; in mlxsw_sp_neigh_entry_alloc()
1860 neigh_entry->rif = rif; in mlxsw_sp_neigh_entry_alloc()
1861 INIT_LIST_HEAD(&neigh_entry->nexthop_list); in mlxsw_sp_neigh_entry_alloc()
1863 return neigh_entry; in mlxsw_sp_neigh_entry_alloc()
1866 static void mlxsw_sp_neigh_entry_free(struct mlxsw_sp_neigh_entry *neigh_entry) in mlxsw_sp_neigh_entry_free() argument
1868 kfree(neigh_entry); in mlxsw_sp_neigh_entry_free()
1873 struct mlxsw_sp_neigh_entry *neigh_entry) in mlxsw_sp_neigh_entry_insert() argument
1876 &neigh_entry->ht_node, in mlxsw_sp_neigh_entry_insert()
1882 struct mlxsw_sp_neigh_entry *neigh_entry) in mlxsw_sp_neigh_entry_remove() argument
1885 &neigh_entry->ht_node, in mlxsw_sp_neigh_entry_remove()
1891 struct mlxsw_sp_neigh_entry *neigh_entry) in mlxsw_sp_neigh_counter_should_alloc() argument
1896 switch (mlxsw_sp_neigh_entry_type(neigh_entry)) { in mlxsw_sp_neigh_counter_should_alloc()
1914 struct mlxsw_sp_neigh_entry *neigh_entry) in mlxsw_sp_neigh_counter_alloc() argument
1916 if (!mlxsw_sp_neigh_counter_should_alloc(mlxsw_sp, neigh_entry)) in mlxsw_sp_neigh_counter_alloc()
1919 if (mlxsw_sp_flow_counter_alloc(mlxsw_sp, &neigh_entry->counter_index)) in mlxsw_sp_neigh_counter_alloc()
1922 neigh_entry->counter_valid = true; in mlxsw_sp_neigh_counter_alloc()
1927 struct mlxsw_sp_neigh_entry *neigh_entry) in mlxsw_sp_neigh_counter_free() argument
1929 if (!neigh_entry->counter_valid) in mlxsw_sp_neigh_counter_free()
1932 neigh_entry->counter_index); in mlxsw_sp_neigh_counter_free()
1933 neigh_entry->counter_valid = false; in mlxsw_sp_neigh_counter_free()
1939 struct mlxsw_sp_neigh_entry *neigh_entry; in mlxsw_sp_neigh_entry_create() local
1947 neigh_entry = mlxsw_sp_neigh_entry_alloc(mlxsw_sp, n, rif->rif_index); in mlxsw_sp_neigh_entry_create()
1948 if (!neigh_entry) in mlxsw_sp_neigh_entry_create()
1951 err = mlxsw_sp_neigh_entry_insert(mlxsw_sp, neigh_entry); in mlxsw_sp_neigh_entry_create()
1955 mlxsw_sp_neigh_counter_alloc(mlxsw_sp, neigh_entry); in mlxsw_sp_neigh_entry_create()
1956 list_add(&neigh_entry->rif_list_node, &rif->neigh_list); in mlxsw_sp_neigh_entry_create()
1958 return neigh_entry; in mlxsw_sp_neigh_entry_create()
1961 mlxsw_sp_neigh_entry_free(neigh_entry); in mlxsw_sp_neigh_entry_create()
1967 struct mlxsw_sp_neigh_entry *neigh_entry) in mlxsw_sp_neigh_entry_destroy() argument
1969 list_del(&neigh_entry->rif_list_node); in mlxsw_sp_neigh_entry_destroy()
1970 mlxsw_sp_neigh_counter_free(mlxsw_sp, neigh_entry); in mlxsw_sp_neigh_entry_destroy()
1971 mlxsw_sp_neigh_entry_remove(mlxsw_sp, neigh_entry); in mlxsw_sp_neigh_entry_destroy()
1972 mlxsw_sp_neigh_entry_free(neigh_entry); in mlxsw_sp_neigh_entry_destroy()
2184 struct mlxsw_sp_neigh_entry *neigh_entry; in mlxsw_sp_router_neighs_update_nh() local
2188 list_for_each_entry(neigh_entry, &mlxsw_sp->router->nexthop_neighs_list, in mlxsw_sp_router_neighs_update_nh()
2193 neigh_event_send(neigh_entry->key.n, NULL); in mlxsw_sp_router_neighs_update_nh()
2224 struct mlxsw_sp_neigh_entry *neigh_entry; in mlxsw_sp_router_probe_unresolved_nexthops() local
2238 list_for_each_entry(neigh_entry, &router->nexthop_neighs_list, in mlxsw_sp_router_probe_unresolved_nexthops()
2240 if (!neigh_entry->connected) in mlxsw_sp_router_probe_unresolved_nexthops()
2241 neigh_event_send(neigh_entry->key.n, NULL); in mlxsw_sp_router_probe_unresolved_nexthops()
2250 struct mlxsw_sp_neigh_entry *neigh_entry,
2261 struct mlxsw_sp_neigh_entry *neigh_entry, in mlxsw_sp_router_neigh_entry_op4() argument
2264 struct neighbour *n = neigh_entry->key.n; in mlxsw_sp_router_neigh_entry_op4()
2268 mlxsw_reg_rauht_pack4(rauht_pl, op, neigh_entry->rif, neigh_entry->ha, in mlxsw_sp_router_neigh_entry_op4()
2270 if (neigh_entry->counter_valid) in mlxsw_sp_router_neigh_entry_op4()
2272 neigh_entry->counter_index); in mlxsw_sp_router_neigh_entry_op4()
2278 struct mlxsw_sp_neigh_entry *neigh_entry, in mlxsw_sp_router_neigh_entry_op6() argument
2281 struct neighbour *n = neigh_entry->key.n; in mlxsw_sp_router_neigh_entry_op6()
2285 mlxsw_reg_rauht_pack6(rauht_pl, op, neigh_entry->rif, neigh_entry->ha, in mlxsw_sp_router_neigh_entry_op6()
2287 if (neigh_entry->counter_valid) in mlxsw_sp_router_neigh_entry_op6()
2289 neigh_entry->counter_index); in mlxsw_sp_router_neigh_entry_op6()
2293 bool mlxsw_sp_neigh_ipv6_ignore(struct mlxsw_sp_neigh_entry *neigh_entry) in mlxsw_sp_neigh_ipv6_ignore() argument
2295 struct neighbour *n = neigh_entry->key.n; in mlxsw_sp_neigh_ipv6_ignore()
2309 struct mlxsw_sp_neigh_entry *neigh_entry, in mlxsw_sp_neigh_entry_update() argument
2312 if (!adding && !neigh_entry->connected) in mlxsw_sp_neigh_entry_update()
2314 neigh_entry->connected = adding; in mlxsw_sp_neigh_entry_update()
2315 if (neigh_entry->key.n->tbl->family == AF_INET) { in mlxsw_sp_neigh_entry_update()
2316 mlxsw_sp_router_neigh_entry_op4(mlxsw_sp, neigh_entry, in mlxsw_sp_neigh_entry_update()
2318 } else if (neigh_entry->key.n->tbl->family == AF_INET6) { in mlxsw_sp_neigh_entry_update()
2319 if (mlxsw_sp_neigh_ipv6_ignore(neigh_entry)) in mlxsw_sp_neigh_entry_update()
2321 mlxsw_sp_router_neigh_entry_op6(mlxsw_sp, neigh_entry, in mlxsw_sp_neigh_entry_update()
2330 struct mlxsw_sp_neigh_entry *neigh_entry, in mlxsw_sp_neigh_entry_counter_update() argument
2334 mlxsw_sp_neigh_counter_alloc(mlxsw_sp, neigh_entry); in mlxsw_sp_neigh_entry_counter_update()
2336 mlxsw_sp_neigh_counter_free(mlxsw_sp, neigh_entry); in mlxsw_sp_neigh_entry_counter_update()
2337 mlxsw_sp_neigh_entry_update(mlxsw_sp, neigh_entry, true); in mlxsw_sp_neigh_entry_counter_update()
2351 struct mlxsw_sp_neigh_entry *neigh_entry; in mlxsw_sp_router_neigh_event_work() local
2371 neigh_entry = mlxsw_sp_neigh_entry_lookup(mlxsw_sp, n); in mlxsw_sp_router_neigh_event_work()
2372 if (!entry_connected && !neigh_entry) in mlxsw_sp_router_neigh_event_work()
2374 if (!neigh_entry) { in mlxsw_sp_router_neigh_event_work()
2375 neigh_entry = mlxsw_sp_neigh_entry_create(mlxsw_sp, n); in mlxsw_sp_router_neigh_event_work()
2376 if (IS_ERR(neigh_entry)) in mlxsw_sp_router_neigh_event_work()
2380 memcpy(neigh_entry->ha, ha, ETH_ALEN); in mlxsw_sp_router_neigh_event_work()
2381 mlxsw_sp_neigh_entry_update(mlxsw_sp, neigh_entry, entry_connected); in mlxsw_sp_router_neigh_event_work()
2382 mlxsw_sp_nexthop_neigh_update(mlxsw_sp, neigh_entry, !entry_connected); in mlxsw_sp_router_neigh_event_work()
2384 if (!neigh_entry->connected && list_empty(&neigh_entry->nexthop_list)) in mlxsw_sp_router_neigh_event_work()
2385 mlxsw_sp_neigh_entry_destroy(mlxsw_sp, neigh_entry); in mlxsw_sp_router_neigh_event_work()
2545 struct mlxsw_sp_neigh_entry *neigh_entry, *tmp; in mlxsw_sp_neigh_rif_gone_sync() local
2547 list_for_each_entry_safe(neigh_entry, tmp, &rif->neigh_list, in mlxsw_sp_neigh_rif_gone_sync()
2549 mlxsw_sp_neigh_entry_update(mlxsw_sp, neigh_entry, false); in mlxsw_sp_neigh_rif_gone_sync()
2550 mlxsw_sp_neigh_entry_destroy(mlxsw_sp, neigh_entry); in mlxsw_sp_neigh_rif_gone_sync()
2589 struct mlxsw_sp_neigh_entry *neigh_entry; member
2670 return nh->neigh_entry->ha; in mlxsw_sp_nexthop_ha()
2981 struct mlxsw_sp_neigh_entry *neigh_entry = nh->neigh_entry; in __mlxsw_sp_nexthop_update() local
2986 adj_index, neigh_entry->rif); in __mlxsw_sp_nexthop_update()
2987 mlxsw_reg_ratr_eth_entry_pack(ratr_pl, neigh_entry->ha); in __mlxsw_sp_nexthop_update()
3348 struct mlxsw_sp_neigh_entry *neigh_entry, in mlxsw_sp_nexthop_neigh_update() argument
3353 list_for_each_entry(nh, &neigh_entry->nexthop_list, in mlxsw_sp_nexthop_neigh_update()
3382 struct mlxsw_sp_neigh_entry *neigh_entry; in mlxsw_sp_nexthop_neigh_init() local
3387 if (!nh->nh_grp->gateway || nh->neigh_entry) in mlxsw_sp_nexthop_neigh_init()
3403 neigh_entry = mlxsw_sp_neigh_entry_lookup(mlxsw_sp, n); in mlxsw_sp_nexthop_neigh_init()
3404 if (!neigh_entry) { in mlxsw_sp_nexthop_neigh_init()
3405 neigh_entry = mlxsw_sp_neigh_entry_create(mlxsw_sp, n); in mlxsw_sp_nexthop_neigh_init()
3406 if (IS_ERR(neigh_entry)) { in mlxsw_sp_nexthop_neigh_init()
3415 if (list_empty(&neigh_entry->nexthop_list)) in mlxsw_sp_nexthop_neigh_init()
3416 list_add_tail(&neigh_entry->nexthop_neighs_list_node, in mlxsw_sp_nexthop_neigh_init()
3419 nh->neigh_entry = neigh_entry; in mlxsw_sp_nexthop_neigh_init()
3420 list_add_tail(&nh->neigh_list_node, &neigh_entry->nexthop_list); in mlxsw_sp_nexthop_neigh_init()
3437 struct mlxsw_sp_neigh_entry *neigh_entry = nh->neigh_entry; in mlxsw_sp_nexthop_neigh_fini() local
3440 if (!neigh_entry) in mlxsw_sp_nexthop_neigh_fini()
3442 n = neigh_entry->key.n; in mlxsw_sp_nexthop_neigh_fini()
3446 nh->neigh_entry = NULL; in mlxsw_sp_nexthop_neigh_fini()
3451 if (list_empty(&neigh_entry->nexthop_list)) in mlxsw_sp_nexthop_neigh_fini()
3452 list_del(&neigh_entry->nexthop_neighs_list_node); in mlxsw_sp_nexthop_neigh_fini()
3454 if (!neigh_entry->connected && list_empty(&neigh_entry->nexthop_list)) in mlxsw_sp_nexthop_neigh_fini()
3455 mlxsw_sp_neigh_entry_destroy(mlxsw_sp, neigh_entry); in mlxsw_sp_nexthop_neigh_fini()