Lines Matching defs:pool

775  * ibmvfc_init_event_pool - Allocates and initializes the event pool for a host
776 * @vhost: ibmvfc host who owns the event pool
778 * @size: pool size
787 struct ibmvfc_event_pool *pool = &queue->evt_pool;
793 pool->size = size;
794 pool->events = kcalloc(size, sizeof(*pool->events), GFP_KERNEL);
795 if (!pool->events)
798 pool->iu_storage = dma_alloc_coherent(vhost->dev,
799 size * sizeof(*pool->iu_storage),
800 &pool->iu_token, 0);
802 if (!pool->iu_storage) {
803 kfree(pool->events);
812 struct ibmvfc_event *evt = &pool->events[i];
823 evt->crq.ioba = cpu_to_be64(pool->iu_token + (sizeof(*evt->xfer_iu) * i));
824 evt->xfer_iu = pool->iu_storage + i;
836 * ibmvfc_free_event_pool - Frees memory of the event pool of a host
837 * @vhost: ibmvfc host who owns the event pool
845 struct ibmvfc_event_pool *pool = &queue->evt_pool;
848 for (i = 0; i < pool->size; ++i) {
849 list_del(&pool->events[i].queue_list);
850 BUG_ON(atomic_read(&pool->events[i].free) != 1);
851 if (pool->events[i].ext_list)
853 pool->events[i].ext_list,
854 pool->events[i].ext_list_token);
857 kfree(pool->events);
859 pool->size * sizeof(*pool->iu_storage),
860 pool->iu_storage, pool->iu_token);
1002 * @pool: event_pool that contains the event
1008 static int ibmvfc_valid_event(struct ibmvfc_event_pool *pool,
1011 int index = evt - pool->events;
1012 if (index < 0 || index >= pool->size) /* outside of bounds */
1014 if (evt != pool->events + index) /* unaligned */
1026 struct ibmvfc_event_pool *pool = &evt->queue->evt_pool;
1029 BUG_ON(!ibmvfc_valid_event(pool, evt));
1510 * ibmvfc_get_event - Gets the next free event in pool
1513 * Returns a free event from the pool.
1522 ibmvfc_log(queue->vhost, 4, "empty event pool on queue:%ld\n", queue->hwq_id);
5792 dev_err(dev, "Couldn't initialize event pool.\n");
6102 dev_err(dev, "Failed to allocate sg pool\n");
6134 dev_err(dev, "Couldn't allocate target memory pool\n");