Lines Matching refs:fib4_rt

278 	struct nsim_fib4_rt *fib4_rt;  in nsim_fib4_rt_create()  local
280 fib4_rt = kzalloc(sizeof(*fib4_rt), GFP_KERNEL); in nsim_fib4_rt_create()
281 if (!fib4_rt) in nsim_fib4_rt_create()
284 nsim_fib_rt_init(data, &fib4_rt->common, &fen_info->dst, sizeof(u32), in nsim_fib4_rt_create()
287 fib4_rt->fi = fen_info->fi; in nsim_fib4_rt_create()
288 fib_info_hold(fib4_rt->fi); in nsim_fib4_rt_create()
289 fib4_rt->dscp = fen_info->dscp; in nsim_fib4_rt_create()
290 fib4_rt->type = fen_info->type; in nsim_fib4_rt_create()
292 return fib4_rt; in nsim_fib4_rt_create()
295 static void nsim_fib4_rt_destroy(struct nsim_fib4_rt *fib4_rt) in nsim_fib4_rt_destroy() argument
297 fib_info_put(fib4_rt->fi); in nsim_fib4_rt_destroy()
298 nsim_fib_rt_fini(&fib4_rt->common); in nsim_fib4_rt_destroy()
299 kfree(fib4_rt); in nsim_fib4_rt_destroy()
337 const struct nsim_fib4_rt *fib4_rt, in nsim_fib4_rt_hw_flags_set() argument
340 u32 *p_dst = (u32 *) fib4_rt->common.key.addr; in nsim_fib4_rt_hw_flags_set()
341 int dst_len = fib4_rt->common.key.prefix_len; in nsim_fib4_rt_hw_flags_set()
344 fri.fi = fib4_rt->fi; in nsim_fib4_rt_hw_flags_set()
345 fri.tb_id = fib4_rt->common.key.tb_id; in nsim_fib4_rt_hw_flags_set()
348 fri.dscp = fib4_rt->dscp; in nsim_fib4_rt_hw_flags_set()
349 fri.type = fib4_rt->type; in nsim_fib4_rt_hw_flags_set()
357 struct nsim_fib4_rt *fib4_rt) in nsim_fib4_rt_add() argument
363 &fib4_rt->common.ht_node, in nsim_fib4_rt_add()
370 nsim_fib4_rt_hw_flags_set(net, fib4_rt, true); in nsim_fib4_rt_add()
383 struct nsim_fib4_rt *fib4_rt, in nsim_fib4_rt_replace() argument
397 &fib4_rt->common.ht_node, in nsim_fib4_rt_replace()
403 nsim_fib4_rt_hw_flags_set(net, fib4_rt, true); in nsim_fib4_rt_replace()
414 struct nsim_fib4_rt *fib4_rt, *fib4_rt_old; in nsim_fib4_rt_insert() local
426 fib4_rt = nsim_fib4_rt_create(data, fen_info); in nsim_fib4_rt_insert()
427 if (!fib4_rt) in nsim_fib4_rt_insert()
432 err = nsim_fib4_rt_add(data, fib4_rt); in nsim_fib4_rt_insert()
434 err = nsim_fib4_rt_replace(data, fib4_rt, fib4_rt_old); in nsim_fib4_rt_insert()
437 nsim_fib4_rt_destroy(fib4_rt); in nsim_fib4_rt_insert()
445 struct nsim_fib4_rt *fib4_rt; in nsim_fib4_rt_remove() local
447 fib4_rt = nsim_fib4_rt_lookup(&data->fib_rt_ht, fen_info); in nsim_fib4_rt_remove()
448 if (!fib4_rt) in nsim_fib4_rt_remove()
451 rhashtable_remove_fast(&data->fib_rt_ht, &fib4_rt->common.ht_node, in nsim_fib4_rt_remove()
453 nsim_fib4_rt_destroy(fib4_rt); in nsim_fib4_rt_remove()
1053 struct nsim_fib4_rt *fib4_rt; in nsim_fib4_rt_free() local
1055 fib4_rt = container_of(fib_rt, struct nsim_fib4_rt, common); in nsim_fib4_rt_free()
1056 nsim_fib4_rt_hw_flags_set(devlink_net(devlink), fib4_rt, false); in nsim_fib4_rt_free()
1058 nsim_fib4_rt_destroy(fib4_rt); in nsim_fib4_rt_free()