| 4944 | } |
| 4945 | |
| 4946 | static void |
| 4947 | i40e_res_pool_destroy(struct i40e_res_pool_info *pool) |
| 4948 | { |
| 4949 | struct pool_entry *entry, *next_entry; |
| 4950 | |
| 4951 | if (pool == NULL) |
| 4952 | return; |
| 4953 | |
| 4954 | for (entry = LIST_FIRST(&pool->alloc_list); |
| 4955 | entry && (next_entry = LIST_NEXT(entry, next), 1); |
| 4956 | entry = next_entry) { |
| 4957 | LIST_REMOVE(entry, next); |
| 4958 | rte_free(entry); |
| 4959 | } |
| 4960 | |
| 4961 | for (entry = LIST_FIRST(&pool->free_list); |
| 4962 | entry && (next_entry = LIST_NEXT(entry, next), 1); |
| 4963 | entry = next_entry) { |
| 4964 | LIST_REMOVE(entry, next); |
| 4965 | rte_free(entry); |
| 4966 | } |
| 4967 | |
| 4968 | pool->num_free = 0; |
| 4969 | pool->num_alloc = 0; |
| 4970 | pool->base = 0; |
| 4971 | LIST_INIT(&pool->alloc_list); |
| 4972 | LIST_INIT(&pool->free_list); |
| 4973 | } |
| 4974 | |
| 4975 | static int |
| 4976 | i40e_res_pool_free(struct i40e_res_pool_info *pool, |
no test coverage detected