| /linux/net/xdp/ |
| H A D | xsk_buff_pool.c | 15 void xp_add_xsk(struct xsk_buff_pool *pool, struct xdp_sock *xs) in xp_add_xsk() argument 20 spin_lock(&pool->xsk_tx_list_lock); in xp_add_xsk() 21 list_add_rcu(&xs->tx_list, &pool->xsk_tx_list); in xp_add_xsk() 22 spin_unlock(&pool->xsk_tx_list_lock); in xp_add_xsk() 25 void xp_del_xsk(struct xsk_buff_pool *pool, struct xdp_sock *xs) in xp_del_xsk() argument 30 spin_lock(&pool->xsk_tx_list_lock); in xp_del_xsk() 32 spin_unlock(&pool->xsk_tx_list_lock); in xp_del_xsk() 35 void xp_destroy(struct xsk_buff_pool *pool) in xp_destroy() argument 37 if (!pool) in xp_destroy() 40 kvfree(pool->tx_descs); in xp_destroy() [all …]
|
| /linux/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/ |
| H A D | pool.c | 9 switch (resource->pool->type) { in hws_pool_free_one_resource() 11 mlx5hws_cmd_ste_destroy(resource->pool->ctx->mdev, resource->base_id); in hws_pool_free_one_resource() 14 mlx5hws_cmd_stc_destroy(resource->pool->ctx->mdev, resource->base_id); in hws_pool_free_one_resource() 23 static void hws_pool_resource_free(struct mlx5hws_pool *pool) in hws_pool_resource_free() argument 25 hws_pool_free_one_resource(pool->resource); in hws_pool_resource_free() 26 pool->resource = NULL; in hws_pool_resource_free() 28 if (pool->tbl_type == MLX5HWS_TABLE_TYPE_FDB) { in hws_pool_resource_free() 29 hws_pool_free_one_resource(pool->mirror_resource); in hws_pool_resource_free() 30 pool->mirror_resource = NULL; in hws_pool_resource_free() 35 hws_pool_create_one_resource(struct mlx5hws_pool *pool, u32 log_range, in hws_pool_create_one_resource() argument [all …]
|
| /linux/drivers/net/ethernet/ti/ |
| H A D | k3-cppi-desc-pool.c | 2 /* TI K3 CPPI5 descriptors pool API 15 #include "k3-cppi-desc-pool.h" 28 void k3_cppi_desc_pool_destroy(struct k3_cppi_desc_pool *pool) in k3_cppi_desc_pool_destroy() argument 30 if (!pool) in k3_cppi_desc_pool_destroy() 33 WARN(gen_pool_size(pool->gen_pool) != gen_pool_avail(pool->gen_pool), in k3_cppi_desc_pool_destroy() 35 gen_pool_size(pool->gen_pool), in k3_cppi_desc_pool_destroy() 36 gen_pool_avail(pool->gen_pool)); in k3_cppi_desc_pool_destroy() 37 if (pool->cpumem) in k3_cppi_desc_pool_destroy() 38 dma_free_coherent(pool->dev, pool->mem_size, pool->cpumem, in k3_cppi_desc_pool_destroy() 39 pool->dma_addr); in k3_cppi_desc_pool_destroy() [all …]
|
| /linux/net/core/ |
| H A D | page_pool.c | 46 #define alloc_stat_inc(pool, __stat) (pool->alloc_stats.__stat++) argument 48 #define recycle_stat_inc(pool, __stat) \ argument 50 struct page_pool_recycle_stats __percpu *s = pool->recycle_stats; \ 54 #define recycle_stat_add(pool, __stat, val) \ argument 56 struct page_pool_recycle_stats __percpu *s = pool->recycle_stats; \ 75 * page_pool_get_stats() - fetch page pool stats 76 * @pool: pool from which page was allocated 79 * Deprecated driver API for querying stats. Page pool stats can be queried 88 void page_pool_get_stats(const struct page_pool *pool, in page_pool_get_stats() argument 94 stats->alloc_stats.fast += pool->alloc_stats.fast; in page_pool_get_stats() [all …]
|
| /linux/drivers/gpu/drm/xe/ |
| H A D | xe_mem_pool.c | 19 * struct xe_mem_pool - DRM MM pool for sub-allocating memory from a BO on an 22 * The XE memory pool is a DRM MM manager that provides sub-allocation of memory 27 * The memory pool maintains a primary BO that is pinned in the GGTT and mapped 31 * The API provided by the memory pool allows clients to allocate and free memory 38 /** @bo: Active pool BO (GGTT-pinned, CPU-mapped). */ 55 static struct xe_tile *pool_to_tile(struct xe_mem_pool *pool) in pool_to_tile() argument 57 return pool->bo->tile; in pool_to_tile() 62 struct xe_mem_pool *pool = arg; in fini_pool_action() local 64 if (pool->is_iomem) in fini_pool_action() 65 kvfree(pool->cpu_addr); in fini_pool_action() [all …]
|
| /linux/drivers/md/ |
| H A D | dm-thin.c | 42 * The block size of the device holding pool data must be 194 * A pool device ties together a metadata device and a data device. It 201 * The pool runs in various modes. Ordered in degraded order for comparisons. 232 struct pool { struct 234 struct dm_target *ti; /* Only set if a pool target is bound */ argument 290 static void metadata_operation_failed(struct pool *pool, const char *op, int r); argument 292 static enum pool_mode get_pool_mode(struct pool *pool) in get_pool_mode() argument 294 return pool->pf.mode; in get_pool_mode() 297 static void notify_of_pool_mode_change(struct pool *pool) in notify_of_pool_mode_change() argument 307 enum pool_mode mode = get_pool_mode(pool); in notify_of_pool_mode_change() [all …]
|
| /linux/include/net/ |
| H A D | xdp_sock_drv.h | 27 void xsk_tx_completed(struct xsk_buff_pool *pool, u32 nb_entries); 28 bool xsk_tx_peek_desc(struct xsk_buff_pool *pool, struct xdp_desc *desc); 29 u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, u32 max); 30 void xsk_tx_release(struct xsk_buff_pool *pool); 33 void xsk_set_rx_need_wakeup(struct xsk_buff_pool *pool); 34 void xsk_set_tx_need_wakeup(struct xsk_buff_pool *pool); 35 void xsk_clear_rx_need_wakeup(struct xsk_buff_pool *pool); 36 void xsk_clear_tx_need_wakeup(struct xsk_buff_pool *pool); 37 bool xsk_uses_need_wakeup(struct xsk_buff_pool *pool); 39 static inline u32 xsk_pool_get_headroom(struct xsk_buff_pool *pool) in xsk_pool_get_headroom() argument [all …]
|
| H A D | xsk_buff_pool.h | 30 struct xsk_buff_pool *pool; member 66 /* For performance reasons, each buff pool has its own array of dma_pages 110 int xp_assign_dev(struct xsk_buff_pool *pool, struct net_device *dev, 112 int xp_assign_dev_shared(struct xsk_buff_pool *pool, struct xdp_sock *umem_xs, 114 int xp_alloc_tx_descs(struct xsk_buff_pool *pool, struct xdp_sock *xs, 116 void xp_destroy(struct xsk_buff_pool *pool); 117 void xp_get_pool(struct xsk_buff_pool *pool); 118 bool xp_put_pool(struct xsk_buff_pool *pool); 119 void xp_clear_dev(struct xsk_buff_pool *pool); 120 void xp_add_xsk(struct xsk_buff_pool *pool, struct xdp_sock *xs); [all …]
|
| /linux/sound/core/seq/ |
| H A D | seq_memory.c | 22 static inline int snd_seq_pool_available(struct snd_seq_pool *pool) in snd_seq_pool_available() argument 24 return pool->total_elements - atomic_read(&pool->counter); in snd_seq_pool_available() 27 static inline int snd_seq_output_ok(struct snd_seq_pool *pool) in snd_seq_output_ok() argument 29 return snd_seq_pool_available(pool) >= pool->room; in snd_seq_output_ok() 225 static inline void free_cell(struct snd_seq_pool *pool, in free_cell() argument 228 cell->next = pool->free; in free_cell() 229 pool->free = cell; in free_cell() 230 atomic_dec(&pool->counter); in free_cell() 235 struct snd_seq_pool *pool; in snd_seq_cell_free() local 239 pool = cell->pool; in snd_seq_cell_free() [all …]
|
| H A D | seq_memory.h | 34 struct snd_seq_pool *pool; /* used pool */ member 38 /* design note: the pool is a contiguous block of memory, if we dynamicly 39 want to add additional cells to the pool be better store this in another 40 pool as we need to know the base address of the pool when releasing 47 int total_elements; /* pool size actually allocated */ 50 int size; /* pool size to be allocated */ 64 /* Pool lock */ 70 int snd_seq_event_dup(struct snd_seq_pool *pool, struct snd_seq_event *event, 75 static inline int snd_seq_unused_cells(struct snd_seq_pool *pool) in snd_seq_unused_cells() argument 77 return pool ? pool->total_elements - atomic_read(&pool->counter) : 0; in snd_seq_unused_cells() [all …]
|
| /linux/kernel/cgroup/ |
| H A D | dmem.c | 113 static void dmemcg_pool_get(struct dmem_cgroup_pool_state *pool) in dmemcg_pool_get() argument 115 refcount_inc(&pool->ref); in dmemcg_pool_get() 118 static bool dmemcg_pool_tryget(struct dmem_cgroup_pool_state *pool) in dmemcg_pool_tryget() argument 120 return refcount_inc_not_zero(&pool->ref); in dmemcg_pool_tryget() 123 static void dmemcg_pool_put(struct dmem_cgroup_pool_state *pool) in dmemcg_pool_put() argument 125 if (!refcount_dec_and_test(&pool->ref)) in dmemcg_pool_put() 128 call_rcu(&pool->rcu, dmemcg_pool_free_rcu); in dmemcg_pool_put() 133 struct dmem_cgroup_pool_state *pool = container_of(rcu, typeof(*pool), rcu); in dmemcg_pool_free_rcu() local 135 if (pool->parent) in dmemcg_pool_free_rcu() 136 dmemcg_pool_put(pool->parent); in dmemcg_pool_free_rcu() [all …]
|
| /linux/net/ceph/ |
| H A D | msgpool.c | 14 struct ceph_msgpool *pool = arg; in msgpool_alloc() local 17 msg = ceph_msg_new2(pool->type, pool->front_len, pool->max_data_items, in msgpool_alloc() 20 dout("msgpool_alloc %s failed\n", pool->name); in msgpool_alloc() 22 dout("msgpool_alloc %s %p\n", pool->name, msg); in msgpool_alloc() 23 msg->pool = pool; in msgpool_alloc() 30 struct ceph_msgpool *pool = arg; in msgpool_free() local 33 dout("msgpool_release %s %p\n", pool->name, msg); in msgpool_free() 34 msg->pool = NULL; in msgpool_free() 38 int ceph_msgpool_init(struct ceph_msgpool *pool, int type, in ceph_msgpool_init() argument 43 pool->type = type; in ceph_msgpool_init() [all …]
|
| /linux/lib/ |
| H A D | genalloc.c | 16 * available. If new memory is added to the pool a lock has to be 146 * gen_pool_create - create a new special memory pool 148 * @nid: node id of the node the pool structure should be allocated on, or -1 150 * Create a new special memory pool that can be used to manage special purpose 155 struct gen_pool *pool; in gen_pool_create() local 157 pool = kmalloc_node(sizeof(struct gen_pool), GFP_KERNEL, nid); in gen_pool_create() 158 if (pool != NULL) { in gen_pool_create() 159 spin_lock_init(&pool->lock); in gen_pool_create() 160 INIT_LIST_HEAD(&pool->chunks); in gen_pool_create() 161 pool->min_alloc_order = min_alloc_order; in gen_pool_create() [all …]
|
| H A D | objpool.c | 19 objpool_init_percpu_slot(struct objpool_head *pool, in objpool_init_percpu_slot() argument 24 void *obj = (void *)&slot->entries[pool->capacity]; in objpool_init_percpu_slot() 28 slot->mask = pool->capacity - 1; in objpool_init_percpu_slot() 37 obj = obj + pool->obj_size; in objpool_init_percpu_slot() 40 pool->nr_objs++; in objpool_init_percpu_slot() 48 objpool_init_percpu_slots(struct objpool_head *pool, int nr_objs, in objpool_init_percpu_slots() argument 63 nodes = nr_objs / pool->nr_possible_cpus; in objpool_init_percpu_slots() 64 if (cpu_count < (nr_objs % pool->nr_possible_cpus)) in objpool_init_percpu_slots() 68 size = struct_size(slot, entries, pool->capacity) + in objpool_init_percpu_slots() 69 pool->obj_size * nodes; in objpool_init_percpu_slots() [all …]
|
| /linux/drivers/net/ethernet/mellanox/mlx5/core/lib/ |
| H A D | crypto.c | 13 * (for example, TLS) after last revalidation in a pool or a bulk. 19 #define MLX5_CRYPTO_DEK_POOL_CALC_FREED(pool) MLX5_CRYPTO_DEK_CALC_FREED(pool) argument 33 int num_deks; /* the total number of keys in this pool */ 34 int avail_deks; /* the number of available keys in this pool */ 35 int in_use_deks; /* the number of being used keys in this pool */ 288 mlx5_crypto_dek_bulk_create(struct mlx5_crypto_dek_pool *pool) in mlx5_crypto_dek_bulk_create() argument 290 struct mlx5_crypto_dek_priv *dek_priv = pool->mdev->mlx5e_res.dek_priv; in mlx5_crypto_dek_bulk_create() 291 struct mlx5_core_dev *mdev = pool->mdev; in mlx5_crypto_dek_bulk_create() 313 err = mlx5_crypto_create_dek_bulk(mdev, pool->key_purpose, in mlx5_crypto_dek_bulk_create() 334 mlx5_crypto_dek_pool_add_bulk(struct mlx5_crypto_dek_pool *pool) in mlx5_crypto_dek_pool_add_bulk() argument [all …]
|
| /linux/tools/testing/selftests/drivers/net/mlxsw/ |
| H A D | sharedbuffer_configuration.py | 16 objects, pool, tcbind and portpool. Provide an interface to get random 18 1. Pool: 22 - random pool number 30 for pool in pools: 31 self._pools.append(pool) 47 def _get_th(self, pool): argument 50 if pool["thtype"] == "dynamic": 58 for pool in self._pools: 59 if pool["type"] == "ingress": 60 ing_pools.append(pool) [all …]
|
| /linux/include/linux/ |
| H A D | genalloc.h | 16 * available. If new memory is added to the pool a lock has to be 46 * @pool: the pool being allocated from 53 void *data, struct gen_pool *pool, 57 * General purpose special memory pool descriptor. 61 struct list_head chunks; /* list of chunks in this pool */ 71 * General purpose special memory pool chunk descriptor. 74 struct list_head next_chunk; /* next chunk in pool */ 98 extern phys_addr_t gen_pool_virt_to_phys(struct gen_pool *pool, unsigned long); 102 static inline int gen_pool_add_virt(struct gen_pool *pool, unsigned long addr, in gen_pool_add_virt() argument 105 return gen_pool_add_owner(pool, addr, phys, size, nid, NULL); in gen_pool_add_virt() [all …]
|
| /linux/drivers/gpu/drm/amd/display/dc/resource/dce60/ |
| H A D | dce60_resource.c | 825 static void dce60_resource_destruct(struct dce110_resource_pool *pool) in dce60_resource_destruct() argument 829 for (i = 0; i < pool->base.pipe_count; i++) { in dce60_resource_destruct() 830 if (pool->base.opps[i] != NULL) in dce60_resource_destruct() 831 dce110_opp_destroy(&pool->base.opps[i]); in dce60_resource_destruct() 833 if (pool->base.transforms[i] != NULL) in dce60_resource_destruct() 834 dce60_transform_destroy(&pool->base.transforms[i]); in dce60_resource_destruct() 836 if (pool->base.ipps[i] != NULL) in dce60_resource_destruct() 837 dce_ipp_destroy(&pool->base.ipps[i]); in dce60_resource_destruct() 839 if (pool->base.mis[i] != NULL) { in dce60_resource_destruct() 840 kfree(TO_DCE_MEM_INPUT(pool->base.mis[i])); in dce60_resource_destruct() [all …]
|
| /linux/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/ |
| H A D | dr_arg.c | 8 /* modify-header arg pool */ 18 /* argument pool area */ 23 struct mutex mutex; /* protect arg pool */ 31 static int dr_arg_pool_alloc_objs(struct dr_arg_pool *pool) in dr_arg_pool_alloc_objs() argument 43 pool->dmn->info.caps.log_header_modify_argument_granularity; in dr_arg_pool_alloc_objs() 46 max_t(u32, pool->dmn->info.caps.log_header_modify_argument_granularity, in dr_arg_pool_alloc_objs() 49 min_t(u32, pool->dmn->info.caps.log_header_modify_argument_max_alloc, in dr_arg_pool_alloc_objs() 52 if (pool->log_chunk_size > object_range) { in dr_arg_pool_alloc_objs() 53 mlx5dr_err(pool->dmn, "Required chunk size (%d) is not supported\n", in dr_arg_pool_alloc_objs() 54 pool->log_chunk_size); in dr_arg_pool_alloc_objs() [all …]
|
| /linux/drivers/net/ethernet/mellanox/mlxsw/ |
| H A D | spectrum_cnt.c | 24 spinlock_t counter_pool_lock; /* Protects counter pool allocations */ 54 struct mlxsw_sp_counter_pool *pool = mlxsw_sp->counter_pool; in mlxsw_sp_counter_sub_pools_init() local 62 for (i = 0; i < pool->sub_pools_count; i++) { in mlxsw_sp_counter_sub_pools_init() 63 sub_pool = &pool->sub_pools[i]; in mlxsw_sp_counter_sub_pools_init() 89 sub_pool = &pool->sub_pools[i]; in mlxsw_sp_counter_sub_pools_init() 99 struct mlxsw_sp_counter_pool *pool = mlxsw_sp->counter_pool; in mlxsw_sp_counter_sub_pools_fini() local 104 for (i = 0; i < pool->sub_pools_count; i++) { in mlxsw_sp_counter_sub_pools_fini() 105 sub_pool = &pool->sub_pools[i]; in mlxsw_sp_counter_sub_pools_fini() 115 const struct mlxsw_sp_counter_pool *pool = priv; in mlxsw_sp_counter_pool_occ_get() local 117 return atomic_read(&pool->active_entries_count); in mlxsw_sp_counter_pool_occ_get() [all …]
|
| /linux/drivers/net/ethernet/mellanox/mlx5/core/ |
| H A D | alloc.c | 61 struct mlx5_dma_pool *pool; member 102 static void mlx5_dma_pool_destroy(struct mlx5_dma_pool *pool) in mlx5_dma_pool_destroy() argument 104 mutex_destroy(&pool->lock); in mlx5_dma_pool_destroy() 105 kfree(pool); in mlx5_dma_pool_destroy() 111 struct mlx5_dma_pool *pool; in mlx5_dma_pool_create() local 113 pool = kzalloc_obj(*pool); in mlx5_dma_pool_create() 114 if (!pool) in mlx5_dma_pool_create() 117 INIT_LIST_HEAD(&pool->page_list); in mlx5_dma_pool_create() 118 mutex_init(&pool->lock); in mlx5_dma_pool_create() 119 pool->dev = dev; in mlx5_dma_pool_create() [all …]
|
| /linux/arch/mips/include/asm/octeon/ |
| H A D | cvmx-fpa.h | 31 * Interface to the hardware Free Pool Allocator. 79 * Structure describing the current state of a FPA pool. 88 /* The number of elements in the pool at creation */ 101 * Return the name of the pool 103 * @pool: Pool to get the name of 106 static inline const char *cvmx_fpa_get_name(uint64_t pool) in cvmx_fpa_get_name() argument 108 return cvmx_fpa_pool_info[pool].name; in cvmx_fpa_get_name() 112 * Return the base of the pool 114 * @pool: Pool to get the base of 117 static inline void *cvmx_fpa_get_base(uint64_t pool) in cvmx_fpa_get_base() argument [all …]
|
| /linux/drivers/gpu/drm/i915/gt/ |
| H A D | intel_gt_buffer_pool.c | 15 bucket_for_size(struct intel_gt_buffer_pool *pool, size_t sz) in bucket_for_size() argument 25 if (n >= ARRAY_SIZE(pool->cache_list)) in bucket_for_size() 26 n = ARRAY_SIZE(pool->cache_list) - 1; in bucket_for_size() 28 return &pool->cache_list[n]; in bucket_for_size() 38 static bool pool_free_older_than(struct intel_gt_buffer_pool *pool, long keep) in pool_free_older_than() argument 45 for (n = 0; n < ARRAY_SIZE(pool->cache_list); n++) { in pool_free_older_than() 46 struct list_head *list = &pool->cache_list[n]; in pool_free_older_than() 51 if (spin_trylock_irq(&pool->lock)) { in pool_free_older_than() 74 spin_unlock_irq(&pool->lock); in pool_free_older_than() 90 struct intel_gt_buffer_pool *pool = in pool_free_work() local [all …]
|
| /linux/net/rds/ |
| H A D | ib_rdma.c | 194 struct rds_ib_mr *rds_ib_reuse_mr(struct rds_ib_mr_pool *pool) in rds_ib_reuse_mr() argument 200 spin_lock_irqsave(&pool->clean_lock, flags); in rds_ib_reuse_mr() 201 ret = llist_del_first(&pool->clean_list); in rds_ib_reuse_mr() 202 spin_unlock_irqrestore(&pool->clean_lock, flags); in rds_ib_reuse_mr() 205 if (pool->pool_type == RDS_IB_MR_8K_POOL) in rds_ib_reuse_mr() 269 struct rds_ib_mr_pool *pool = ibmr->pool; in rds_ib_teardown_mr() local 271 atomic_sub(pinned, &pool->free_pinned); in rds_ib_teardown_mr() 275 static inline unsigned int rds_ib_flush_goal(struct rds_ib_mr_pool *pool, int free_all) in rds_ib_flush_goal() argument 279 item_count = atomic_read(&pool->item_count); in rds_ib_flush_goal() 331 * Flush our pool of MRs. [all …]
|
| /linux/drivers/staging/media/ipu3/ |
| H A D | ipu3-css-pool.c | 7 #include "ipu3-css-pool.h" 25 void imgu_css_pool_cleanup(struct imgu_device *imgu, struct imgu_css_pool *pool) in imgu_css_pool_cleanup() argument 30 imgu_dmamap_free(imgu, &pool->entry[i].param); in imgu_css_pool_cleanup() 33 int imgu_css_pool_init(struct imgu_device *imgu, struct imgu_css_pool *pool, in imgu_css_pool_init() argument 39 pool->entry[i].valid = false; in imgu_css_pool_init() 41 pool->entry[i].param.vaddr = NULL; in imgu_css_pool_init() 45 if (!imgu_dmamap_alloc(imgu, &pool->entry[i].param, size)) in imgu_css_pool_init() 49 pool->last = IPU3_CSS_POOL_SIZE; in imgu_css_pool_init() 54 imgu_css_pool_cleanup(imgu, pool); in imgu_css_pool_init() 59 * Allocate a new parameter via recycling the oldest entry in the pool. [all …]
|