MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mlx5_l3t_destroy

Function mlx5_l3t_destroy

dpdk/drivers/net/mlx5/mlx5_utils.c:881–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

879}
880
881void
882mlx5_l3t_destroy(struct mlx5_l3t_tbl *tbl)
883{
884 struct mlx5_l3t_level_tbl *g_tbl, *m_tbl;
885 uint32_t i, j;
886
887 if (!tbl)
888 return;
889 g_tbl = tbl->tbl;
890 if (g_tbl) {
891 for (i = 0; i < MLX5_L3T_GT_SIZE; i++) {
892 m_tbl = g_tbl->tbl[i];
893 if (!m_tbl)
894 continue;
895 for (j = 0; j < MLX5_L3T_MT_SIZE; j++) {
896 if (!m_tbl->tbl[j])
897 continue;
898 MLX5_ASSERT(!((struct mlx5_l3t_entry_word *)
899 m_tbl->tbl[j])->ref_cnt);
900 mlx5_ipool_free(tbl->eip,
901 ((struct mlx5_l3t_entry_word *)
902 m_tbl->tbl[j])->idx);
903 m_tbl->tbl[j] = 0;
904 if (!(--m_tbl->ref_cnt))
905 break;
906 }
907 MLX5_ASSERT(!m_tbl->ref_cnt);
908 mlx5_free(g_tbl->tbl[i]);
909 g_tbl->tbl[i] = 0;
910 if (!(--g_tbl->ref_cnt))
911 break;
912 }
913 MLX5_ASSERT(!g_tbl->ref_cnt);
914 mlx5_free(tbl->tbl);
915 tbl->tbl = 0;
916 }
917 mlx5_ipool_destroy(tbl->eip);
918 mlx5_free(tbl);
919}
920
921static int32_t
922__l3t_get_entry(struct mlx5_l3t_tbl *tbl, uint32_t idx,

Callers 3

mlx5_flow_meter_flushFunction · 0.85
mlx5_dev_spawnFunction · 0.85
mlx5_dev_spawnFunction · 0.85

Calls 3

mlx5_ipool_freeFunction · 0.85
mlx5_freeFunction · 0.85
mlx5_ipool_destroyFunction · 0.85

Tested by

no test coverage detected