Lines Matching refs:crif

73 	struct mlxsw_sp_crif *crif; /* NULL for underlay RIF */  member
94 if (!rif->crif) in mlxsw_sp_rif_dev()
96 return rif->crif->key.dev; in mlxsw_sp_rif_dev()
1086 mlxsw_sp_crif_init(struct mlxsw_sp_crif *crif, struct net_device *dev) in mlxsw_sp_crif_init() argument
1088 crif->key.dev = dev; in mlxsw_sp_crif_init()
1089 INIT_LIST_HEAD(&crif->nexthop_list); in mlxsw_sp_crif_init()
1095 struct mlxsw_sp_crif *crif; in mlxsw_sp_crif_alloc() local
1097 crif = kzalloc(sizeof(*crif), GFP_KERNEL); in mlxsw_sp_crif_alloc()
1098 if (!crif) in mlxsw_sp_crif_alloc()
1101 mlxsw_sp_crif_init(crif, dev); in mlxsw_sp_crif_alloc()
1102 return crif; in mlxsw_sp_crif_alloc()
1105 static void mlxsw_sp_crif_free(struct mlxsw_sp_crif *crif) in mlxsw_sp_crif_free() argument
1107 if (WARN_ON(crif->rif)) in mlxsw_sp_crif_free()
1110 WARN_ON(!list_empty(&crif->nexthop_list)); in mlxsw_sp_crif_free()
1111 kfree(crif); in mlxsw_sp_crif_free()
1115 struct mlxsw_sp_crif *crif) in mlxsw_sp_crif_insert() argument
1117 return rhashtable_insert_fast(&router->crif_ht, &crif->ht_node, in mlxsw_sp_crif_insert()
1122 struct mlxsw_sp_crif *crif) in mlxsw_sp_crif_remove() argument
1124 rhashtable_remove_fast(&router->crif_ht, &crif->ht_node, in mlxsw_sp_crif_remove()
1736 struct mlxsw_sp_crif *crif = old_rif->crif; in mlxsw_sp_rif_migrate_destroy() local
1745 mlxsw_sp_crif_init(&mock_crif, crif->key.dev); in mlxsw_sp_rif_migrate_destroy()
1746 old_rif->crif = &mock_crif; in mlxsw_sp_rif_migrate_destroy()
3067 struct mlxsw_sp_crif *crif; member
3090 if (!nh->crif) in mlxsw_sp_nexthop_dev()
3092 return nh->crif->key.dev; in mlxsw_sp_nexthop_dev()
3117 struct mlxsw_sp_crif *crif = nhgi->nexthops[0].crif; in mlxsw_sp_nhgi_rif() local
3119 if (!crif) in mlxsw_sp_nhgi_rif()
3121 return crif->rif; in mlxsw_sp_nhgi_rif()
3245 if (WARN_ON(!nh->crif)) in mlxsw_sp_nexthop_rif()
3247 return nh->crif->rif; in mlxsw_sp_nexthop_rif()
4256 struct mlxsw_sp_crif *crif) in mlxsw_sp_nexthop_crif_init() argument
4258 if (nh->crif) in mlxsw_sp_nexthop_crif_init()
4261 nh->crif = crif; in mlxsw_sp_nexthop_crif_init()
4262 list_add(&nh->crif_list_node, &crif->nexthop_list); in mlxsw_sp_nexthop_crif_init()
4267 if (!nh->crif) in mlxsw_sp_nexthop_crif_fini()
4271 nh->crif = NULL; in mlxsw_sp_nexthop_crif_fini()
4283 if (WARN_ON(!nh->crif->rif)) in mlxsw_sp_nexthop_neigh_init()
4376 struct mlxsw_sp_crif *crif; in mlxsw_sp_nexthop_ipip_init() local
4382 crif = mlxsw_sp_crif_lookup(mlxsw_sp->router, ipip_entry->ol_dev); in mlxsw_sp_nexthop_ipip_init()
4383 if (WARN_ON(!crif)) in mlxsw_sp_nexthop_ipip_init()
4389 mlxsw_sp_nexthop_crif_init(nh, crif); in mlxsw_sp_nexthop_ipip_init()
4421 struct mlxsw_sp_crif *crif; in mlxsw_sp_nexthop_type_init() local
4435 crif = mlxsw_sp_crif_lookup(mlxsw_sp->router, dev); in mlxsw_sp_nexthop_type_init()
4436 if (!crif) in mlxsw_sp_nexthop_type_init()
4439 mlxsw_sp_nexthop_crif_init(nh, crif); in mlxsw_sp_nexthop_type_init()
4441 if (!crif->rif) in mlxsw_sp_nexthop_type_init()
4578 list_for_each_entry(nh, &rif->crif->nexthop_list, crif_list_node) { in mlxsw_sp_nexthop_rif_update()
4603 list_for_each_entry_safe(nh, tmp, &rif->crif->nexthop_list, in mlxsw_sp_nexthop_rif_made_sync()
4615 list_for_each_entry_safe(nh, tmp, &rif->crif->nexthop_list, in mlxsw_sp_nexthop_rif_made_sync()
4630 list_for_each_entry_safe(nh, tmp, &rif->crif->nexthop_list, in mlxsw_sp_nexthop_rif_gone_sync()
4974 nh->crif = mlxsw_sp->router->lb_crif; in mlxsw_sp_nexthop_obj_blackhole_init()
4980 nh->crif = NULL; in mlxsw_sp_nexthop_obj_blackhole_fini()
8011 rif->crif->rif = NULL; in mlxsw_sp_router_rif_gone_sync()
8122 struct mlxsw_sp_crif *crif) in mlxsw_sp_rif_alloc() argument
8124 struct net_device *l3_dev = crif ? crif->key.dev : NULL; in mlxsw_sp_rif_alloc()
8138 if (crif) { in mlxsw_sp_rif_alloc()
8139 rif->crif = crif; in mlxsw_sp_rif_alloc()
8140 crif->rif = rif; in mlxsw_sp_rif_alloc()
8150 if (rif->crif) in mlxsw_sp_rif_free()
8151 rif->crif->rif = NULL; in mlxsw_sp_rif_free()
8386 struct mlxsw_sp_crif *crif; in mlxsw_sp_rif_create() local
8406 crif = mlxsw_sp_crif_lookup(mlxsw_sp->router, params->dev); in mlxsw_sp_rif_create()
8407 if (WARN_ON(!crif)) { in mlxsw_sp_rif_create()
8412 rif = mlxsw_sp_rif_alloc(ops->rif_size, rif_index, vr->id, crif); in mlxsw_sp_rif_create()
8490 struct mlxsw_sp_crif *crif = rif->crif; in mlxsw_sp_rif_destroy() local
8522 if (crif->can_destroy) in mlxsw_sp_rif_destroy()
8523 mlxsw_sp_crif_free(crif); in mlxsw_sp_rif_destroy()
8545 struct mlxsw_sp_crif *crif; in mlxsw_sp_rif_destroy_vlan_upper() local
8554 crif = mlxsw_sp_crif_lookup(mlxsw_sp->router, upper_dev); in mlxsw_sp_rif_destroy_vlan_upper()
8555 if (!crif || !crif->rif) in mlxsw_sp_rif_destroy_vlan_upper()
8558 mlxsw_sp_rif_destroy(crif->rif); in mlxsw_sp_rif_destroy_vlan_upper()
9549 struct mlxsw_sp_crif *crif; in mlxsw_sp_crif_register() local
9555 crif = mlxsw_sp_crif_alloc(dev); in mlxsw_sp_crif_register()
9556 if (!crif) in mlxsw_sp_crif_register()
9559 err = mlxsw_sp_crif_insert(router, crif); in mlxsw_sp_crif_register()
9563 return crif; in mlxsw_sp_crif_register()
9566 mlxsw_sp_crif_free(crif); in mlxsw_sp_crif_register()
9571 struct mlxsw_sp_crif *crif) in mlxsw_sp_crif_unregister() argument
9575 mlxsw_sp_crif_remove(router, crif); in mlxsw_sp_crif_unregister()
9577 list_for_each_entry_safe(nh, tmp, &crif->nexthop_list, crif_list_node) in mlxsw_sp_crif_unregister()
9580 if (crif->rif) in mlxsw_sp_crif_unregister()
9581 crif->can_destroy = true; in mlxsw_sp_crif_unregister()
9583 mlxsw_sp_crif_free(crif); in mlxsw_sp_crif_unregister()
9589 struct mlxsw_sp_crif *crif; in mlxsw_sp_netdevice_register() local
9594 crif = mlxsw_sp_crif_register(router, dev); in mlxsw_sp_netdevice_register()
9595 return PTR_ERR_OR_ZERO(crif); in mlxsw_sp_netdevice_register()
9601 struct mlxsw_sp_crif *crif; in mlxsw_sp_netdevice_unregister() local
9612 crif = mlxsw_sp_crif_lookup(router, dev); in mlxsw_sp_netdevice_unregister()
9614 if (!WARN_ON(crif)) in mlxsw_sp_netdevice_unregister()
9617 if (WARN_ON(!crif)) in mlxsw_sp_netdevice_unregister()
9620 mlxsw_sp_crif_unregister(router, crif); in mlxsw_sp_netdevice_unregister()
9802 struct mlxsw_sp_crif *crif; in mlxsw_sp_router_replay_inetaddr_up() local
9808 crif = mlxsw_sp_crif_lookup(ctx->mlxsw_sp->router, dev); in mlxsw_sp_router_replay_inetaddr_up()
9809 if (!crif || crif->rif) in mlxsw_sp_router_replay_inetaddr_up()
9812 if (!mlxsw_sp_rif_should_config(crif->rif, dev, NETDEV_UP)) in mlxsw_sp_router_replay_inetaddr_up()
9829 struct mlxsw_sp_crif *crif; in mlxsw_sp_router_unreplay_inetaddr_up() local
9837 crif = mlxsw_sp_crif_lookup(ctx->mlxsw_sp->router, dev); in mlxsw_sp_router_unreplay_inetaddr_up()
9838 if (!crif || !crif->rif) in mlxsw_sp_router_unreplay_inetaddr_up()
9842 if (!mlxsw_sp_rif_should_config(crif->rif, dev, NETDEV_UP)) in mlxsw_sp_router_unreplay_inetaddr_up()