Lines Matching full:route

284 	struct mlxsw_sp_mr_tcam_route *route = route_priv;  in mlxsw_sp_mr_tcam_route_create()  local
288 route->key = route_params->key; in mlxsw_sp_mr_tcam_route_create()
289 route->irif_index = route_params->value.irif_index; in mlxsw_sp_mr_tcam_route_create()
290 route->min_mtu = route_params->value.min_mtu; in mlxsw_sp_mr_tcam_route_create()
291 route->action = route_params->value.route_action; in mlxsw_sp_mr_tcam_route_create()
294 mlxsw_sp_mr_erif_list_init(&route->erif_list); in mlxsw_sp_mr_tcam_route_create()
295 err = mlxsw_sp_mr_tcam_erif_populate(mlxsw_sp, &route->erif_list, in mlxsw_sp_mr_tcam_route_create()
301 err = mlxsw_sp_flow_counter_alloc(mlxsw_sp, &route->counter_index); in mlxsw_sp_mr_tcam_route_create()
306 route->afa_block = mlxsw_sp_mr_tcam_afa_block_create(mlxsw_sp, in mlxsw_sp_mr_tcam_route_create()
307 route->action, in mlxsw_sp_mr_tcam_route_create()
308 route->irif_index, in mlxsw_sp_mr_tcam_route_create()
309 route->counter_index, in mlxsw_sp_mr_tcam_route_create()
310 route->min_mtu, in mlxsw_sp_mr_tcam_route_create()
311 &route->erif_list); in mlxsw_sp_mr_tcam_route_create()
312 if (IS_ERR(route->afa_block)) { in mlxsw_sp_mr_tcam_route_create()
313 err = PTR_ERR(route->afa_block); in mlxsw_sp_mr_tcam_route_create()
317 route->priv = kzalloc(ops->route_priv_size, GFP_KERNEL); in mlxsw_sp_mr_tcam_route_create()
318 if (!route->priv) { in mlxsw_sp_mr_tcam_route_create()
323 /* Write the route to the TCAM */ in mlxsw_sp_mr_tcam_route_create()
324 err = ops->route_create(mlxsw_sp, mr_tcam->priv, route->priv, in mlxsw_sp_mr_tcam_route_create()
325 &route->key, route->afa_block, in mlxsw_sp_mr_tcam_route_create()
332 kfree(route->priv); in mlxsw_sp_mr_tcam_route_create()
334 mlxsw_sp_mr_tcam_afa_block_destroy(route->afa_block); in mlxsw_sp_mr_tcam_route_create()
336 mlxsw_sp_flow_counter_free(mlxsw_sp, route->counter_index); in mlxsw_sp_mr_tcam_route_create()
339 mlxsw_sp_mr_erif_list_flush(mlxsw_sp, &route->erif_list); in mlxsw_sp_mr_tcam_route_create()
347 struct mlxsw_sp_mr_tcam_route *route = route_priv; in mlxsw_sp_mr_tcam_route_destroy() local
350 ops->route_destroy(mlxsw_sp, mr_tcam->priv, route->priv, &route->key); in mlxsw_sp_mr_tcam_route_destroy()
351 kfree(route->priv); in mlxsw_sp_mr_tcam_route_destroy()
352 mlxsw_sp_mr_tcam_afa_block_destroy(route->afa_block); in mlxsw_sp_mr_tcam_route_destroy()
353 mlxsw_sp_flow_counter_free(mlxsw_sp, route->counter_index); in mlxsw_sp_mr_tcam_route_destroy()
354 mlxsw_sp_mr_erif_list_flush(mlxsw_sp, &route->erif_list); in mlxsw_sp_mr_tcam_route_destroy()
361 struct mlxsw_sp_mr_tcam_route *route = route_priv; in mlxsw_sp_mr_tcam_route_stats() local
363 return mlxsw_sp_flow_counter_get(mlxsw_sp, route->counter_index, in mlxsw_sp_mr_tcam_route_stats()
373 struct mlxsw_sp_mr_tcam_route *route = route_priv; in mlxsw_sp_mr_tcam_route_action_update() local
379 route->irif_index, in mlxsw_sp_mr_tcam_route_action_update()
380 route->counter_index, in mlxsw_sp_mr_tcam_route_action_update()
381 route->min_mtu, in mlxsw_sp_mr_tcam_route_action_update()
382 &route->erif_list); in mlxsw_sp_mr_tcam_route_action_update()
386 /* Update the TCAM route entry */ in mlxsw_sp_mr_tcam_route_action_update()
387 err = ops->route_update(mlxsw_sp, route->priv, &route->key, afa_block); in mlxsw_sp_mr_tcam_route_action_update()
392 mlxsw_sp_mr_tcam_afa_block_destroy(route->afa_block); in mlxsw_sp_mr_tcam_route_action_update()
393 route->afa_block = afa_block; in mlxsw_sp_mr_tcam_route_action_update()
394 route->action = route_action; in mlxsw_sp_mr_tcam_route_action_update()
405 struct mlxsw_sp_mr_tcam_route *route = route_priv; in mlxsw_sp_mr_tcam_route_min_mtu_update() local
411 route->action, in mlxsw_sp_mr_tcam_route_min_mtu_update()
412 route->irif_index, in mlxsw_sp_mr_tcam_route_min_mtu_update()
413 route->counter_index, in mlxsw_sp_mr_tcam_route_min_mtu_update()
415 &route->erif_list); in mlxsw_sp_mr_tcam_route_min_mtu_update()
419 /* Update the TCAM route entry */ in mlxsw_sp_mr_tcam_route_min_mtu_update()
420 err = ops->route_update(mlxsw_sp, route->priv, &route->key, afa_block); in mlxsw_sp_mr_tcam_route_min_mtu_update()
425 mlxsw_sp_mr_tcam_afa_block_destroy(route->afa_block); in mlxsw_sp_mr_tcam_route_min_mtu_update()
426 route->afa_block = afa_block; in mlxsw_sp_mr_tcam_route_min_mtu_update()
427 route->min_mtu = min_mtu; in mlxsw_sp_mr_tcam_route_min_mtu_update()
437 struct mlxsw_sp_mr_tcam_route *route = route_priv; in mlxsw_sp_mr_tcam_route_irif_update() local
439 if (route->action != MLXSW_SP_MR_ROUTE_ACTION_TRAP) in mlxsw_sp_mr_tcam_route_irif_update()
441 route->irif_index = irif_index; in mlxsw_sp_mr_tcam_route_irif_update()
448 struct mlxsw_sp_mr_tcam_route *route = route_priv; in mlxsw_sp_mr_tcam_route_erif_add() local
451 err = mlxsw_sp_mr_erif_list_add(mlxsw_sp, &route->erif_list, in mlxsw_sp_mr_tcam_route_erif_add()
456 /* Commit the action only if the route action is not TRAP */ in mlxsw_sp_mr_tcam_route_erif_add()
457 if (route->action != MLXSW_SP_MR_ROUTE_ACTION_TRAP) in mlxsw_sp_mr_tcam_route_erif_add()
459 &route->erif_list); in mlxsw_sp_mr_tcam_route_erif_add()
467 struct mlxsw_sp_mr_tcam_route *route = route_priv; in mlxsw_sp_mr_tcam_route_erif_del() local
476 list_for_each_entry(erif_sublist, &route->erif_list.erif_sublists, list) { in mlxsw_sp_mr_tcam_route_erif_del()
490 afa_block = mlxsw_sp_mr_tcam_afa_block_create(mlxsw_sp, route->action, in mlxsw_sp_mr_tcam_route_erif_del()
491 route->irif_index, in mlxsw_sp_mr_tcam_route_erif_del()
492 route->counter_index, in mlxsw_sp_mr_tcam_route_erif_del()
493 route->min_mtu, in mlxsw_sp_mr_tcam_route_erif_del()
500 /* Update the TCAM route entry */ in mlxsw_sp_mr_tcam_route_erif_del()
501 err = ops->route_update(mlxsw_sp, route->priv, &route->key, afa_block); in mlxsw_sp_mr_tcam_route_erif_del()
505 mlxsw_sp_mr_tcam_afa_block_destroy(route->afa_block); in mlxsw_sp_mr_tcam_route_erif_del()
506 mlxsw_sp_mr_erif_list_flush(mlxsw_sp, &route->erif_list); in mlxsw_sp_mr_tcam_route_erif_del()
507 route->afa_block = afa_block; in mlxsw_sp_mr_tcam_route_erif_del()
508 mlxsw_sp_mr_erif_list_move(&route->erif_list, &erif_list); in mlxsw_sp_mr_tcam_route_erif_del()
524 struct mlxsw_sp_mr_tcam_route *route = route_priv; in mlxsw_sp_mr_tcam_route_update() local
539 route->counter_index, in mlxsw_sp_mr_tcam_route_update()
547 /* Update the TCAM route entry */ in mlxsw_sp_mr_tcam_route_update()
548 err = ops->route_update(mlxsw_sp, route->priv, &route->key, afa_block); in mlxsw_sp_mr_tcam_route_update()
552 mlxsw_sp_mr_tcam_afa_block_destroy(route->afa_block); in mlxsw_sp_mr_tcam_route_update()
553 mlxsw_sp_mr_erif_list_flush(mlxsw_sp, &route->erif_list); in mlxsw_sp_mr_tcam_route_update()
554 route->afa_block = afa_block; in mlxsw_sp_mr_tcam_route_update()
555 mlxsw_sp_mr_erif_list_move(&route->erif_list, &erif_list); in mlxsw_sp_mr_tcam_route_update()
556 route->action = route_info->route_action; in mlxsw_sp_mr_tcam_route_update()
557 route->irif_index = route_info->irif_index; in mlxsw_sp_mr_tcam_route_update()
558 route->min_mtu = route_info->min_mtu; in mlxsw_sp_mr_tcam_route_update()