Lines Matching refs:blockpool
1097 static void __vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool *blockpool) in __vxge_hw_blockpool_destroy() argument
1102 if (!blockpool) in __vxge_hw_blockpool_destroy()
1105 hldev = blockpool->hldev; in __vxge_hw_blockpool_destroy()
1107 list_for_each_safe(p, n, &blockpool->free_block_list) { in __vxge_hw_blockpool_destroy()
1119 blockpool->pool_size--; in __vxge_hw_blockpool_destroy()
1122 list_for_each_safe(p, n, &blockpool->free_entry_list) { in __vxge_hw_blockpool_destroy()
1135 struct __vxge_hw_blockpool *blockpool, in __vxge_hw_blockpool_create() argument
1147 if (blockpool == NULL) { in __vxge_hw_blockpool_create()
1152 blockpool->hldev = hldev; in __vxge_hw_blockpool_create()
1153 blockpool->block_size = VXGE_HW_BLOCK_SIZE; in __vxge_hw_blockpool_create()
1154 blockpool->pool_size = 0; in __vxge_hw_blockpool_create()
1155 blockpool->pool_max = pool_max; in __vxge_hw_blockpool_create()
1156 blockpool->req_out = 0; in __vxge_hw_blockpool_create()
1158 INIT_LIST_HEAD(&blockpool->free_block_list); in __vxge_hw_blockpool_create()
1159 INIT_LIST_HEAD(&blockpool->free_entry_list); in __vxge_hw_blockpool_create()
1165 __vxge_hw_blockpool_destroy(blockpool); in __vxge_hw_blockpool_create()
1169 list_add(&entry->item, &blockpool->free_entry_list); in __vxge_hw_blockpool_create()
1179 __vxge_hw_blockpool_destroy(blockpool); in __vxge_hw_blockpool_create()
1189 __vxge_hw_blockpool_destroy(blockpool); in __vxge_hw_blockpool_create()
1194 if (!list_empty(&blockpool->free_entry_list)) in __vxge_hw_blockpool_create()
1196 list_first_entry(&blockpool->free_entry_list, in __vxge_hw_blockpool_create()
1212 &blockpool->free_block_list); in __vxge_hw_blockpool_create()
1213 blockpool->pool_size++; in __vxge_hw_blockpool_create()
1215 __vxge_hw_blockpool_destroy(blockpool); in __vxge_hw_blockpool_create()
2259 struct __vxge_hw_blockpool *blockpool; in vxge_hw_blockpool_block_add() local
2263 blockpool = &devh->block_pool; in vxge_hw_blockpool_block_add()
2266 blockpool->req_out--; in vxge_hw_blockpool_block_add()
2275 blockpool->req_out--; in vxge_hw_blockpool_block_add()
2279 if (!list_empty(&blockpool->free_entry_list)) in vxge_hw_blockpool_block_add()
2281 list_first_entry(&blockpool->free_entry_list, in vxge_hw_blockpool_block_add()
2296 list_add(&entry->item, &blockpool->free_block_list); in vxge_hw_blockpool_block_add()
2297 blockpool->pool_size++; in vxge_hw_blockpool_block_add()
2300 blockpool->req_out--; in vxge_hw_blockpool_block_add()
2319 void __vxge_hw_blockpool_blocks_add(struct __vxge_hw_blockpool *blockpool) in __vxge_hw_blockpool_blocks_add() argument
2323 if ((blockpool->pool_size + blockpool->req_out) < in __vxge_hw_blockpool_blocks_add()
2326 blockpool->req_out += nreq; in __vxge_hw_blockpool_blocks_add()
2331 (blockpool->hldev)->pdev, in __vxge_hw_blockpool_blocks_add()
2332 blockpool->hldev, VXGE_HW_BLOCK_SIZE); in __vxge_hw_blockpool_blocks_add()
2344 struct __vxge_hw_blockpool *blockpool; in __vxge_hw_blockpool_malloc() local
2347 blockpool = &devh->block_pool; in __vxge_hw_blockpool_malloc()
2349 if (size != blockpool->block_size) { in __vxge_hw_blockpool_malloc()
2370 if (!list_empty(&blockpool->free_block_list)) in __vxge_hw_blockpool_malloc()
2372 list_first_entry(&blockpool->free_block_list, in __vxge_hw_blockpool_malloc()
2384 &blockpool->free_entry_list); in __vxge_hw_blockpool_malloc()
2385 blockpool->pool_size--; in __vxge_hw_blockpool_malloc()
2389 __vxge_hw_blockpool_blocks_add(blockpool); in __vxge_hw_blockpool_malloc()
2399 __vxge_hw_blockpool_blocks_remove(struct __vxge_hw_blockpool *blockpool) in __vxge_hw_blockpool_blocks_remove() argument
2403 list_for_each_safe(p, n, &blockpool->free_block_list) { in __vxge_hw_blockpool_blocks_remove()
2405 if (blockpool->pool_size < blockpool->pool_max) in __vxge_hw_blockpool_blocks_remove()
2408 dma_unmap_single(&(blockpool->hldev)->pdev->dev, in __vxge_hw_blockpool_blocks_remove()
2414 (blockpool->hldev)->pdev, in __vxge_hw_blockpool_blocks_remove()
2420 list_add(p, &blockpool->free_entry_list); in __vxge_hw_blockpool_blocks_remove()
2422 blockpool->pool_size--; in __vxge_hw_blockpool_blocks_remove()
2436 struct __vxge_hw_blockpool *blockpool; in __vxge_hw_blockpool_free() local
2439 blockpool = &devh->block_pool; in __vxge_hw_blockpool_free()
2441 if (size != blockpool->block_size) { in __vxge_hw_blockpool_free()
2447 if (!list_empty(&blockpool->free_entry_list)) in __vxge_hw_blockpool_free()
2449 list_first_entry(&blockpool->free_entry_list, in __vxge_hw_blockpool_free()
2466 &blockpool->free_block_list); in __vxge_hw_blockpool_free()
2467 blockpool->pool_size++; in __vxge_hw_blockpool_free()
2473 __vxge_hw_blockpool_blocks_remove(blockpool); in __vxge_hw_blockpool_free()
4758 struct __vxge_hw_blockpool *blockpool; in __vxge_hw_blockpool_block_allocate() local
4760 blockpool = &devh->block_pool; in __vxge_hw_blockpool_block_allocate()
4762 if (size == blockpool->block_size) { in __vxge_hw_blockpool_block_allocate()
4764 if (!list_empty(&blockpool->free_block_list)) in __vxge_hw_blockpool_block_allocate()
4766 list_first_entry(&blockpool->free_block_list, in __vxge_hw_blockpool_block_allocate()
4772 blockpool->pool_size--; in __vxge_hw_blockpool_block_allocate()
4777 __vxge_hw_blockpool_blocks_add(blockpool); in __vxge_hw_blockpool_block_allocate()
4940 struct __vxge_hw_blockpool *blockpool; in __vxge_hw_blockpool_block_free() local
4942 blockpool = &devh->block_pool; in __vxge_hw_blockpool_block_free()
4944 if (entry->length == blockpool->block_size) { in __vxge_hw_blockpool_block_free()
4945 list_add(&entry->item, &blockpool->free_block_list); in __vxge_hw_blockpool_block_free()
4946 blockpool->pool_size++; in __vxge_hw_blockpool_block_free()
4949 __vxge_hw_blockpool_blocks_remove(blockpool); in __vxge_hw_blockpool_block_free()