drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action_ste_pool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action_ste_pool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action_ste_pool.c- Extension
.c- Size
- 12557 bytes
- Lines
- 468
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
internal.h
Detected Declarations
function hws_pool_opt_to_strfunction hws_action_ste_table_create_poolfunction hws_action_ste_table_create_single_rtcfunction hws_action_ste_table_create_rtcsfunction hws_action_ste_table_destroy_rtcsfunction hws_action_ste_table_create_stcfunction hws_action_ste_table_allocfunction hws_action_ste_table_destroyfunction hws_action_ste_pool_element_initfunction hws_action_ste_pool_element_destroyfunction hws_action_ste_pool_initfunction hws_action_ste_pool_destroyfunction hws_action_ste_pool_element_collect_stalefunction list_for_each_entry_safefunction hws_action_ste_table_cleanup_listfunction hws_action_ste_pool_cleanupfunction mlx5hws_action_ste_pool_initfunction mlx5hws_action_ste_pool_uninitfunction hws_action_ste_choose_elemfunction hws_action_ste_table_chunk_allocfunction mlx5hws_action_ste_chunk_allocfunction mlx5hws_action_ste_chunk_free
Annotated Snippet
if (!hws_action_ste_table_chunk_alloc(action_tbl, chunk)) {
found = true;
break;
}
}
if (!found) {
action_tbl = hws_action_ste_table_alloc(elem);
if (IS_ERR(action_tbl)) {
err = PTR_ERR(action_tbl);
goto out;
}
err = hws_action_ste_table_chunk_alloc(action_tbl, chunk);
if (err)
goto out;
}
if (mlx5hws_pool_empty(action_tbl->pool))
list_move(&action_tbl->list_node, &elem->full);
err = 0;
out:
mutex_unlock(&pool->lock);
return err;
}
void mlx5hws_action_ste_chunk_free(struct mlx5hws_action_ste_chunk *chunk)
{
struct mutex *lock = &chunk->action_tbl->parent_elem->parent_pool->lock;
mlx5hws_dbg(chunk->action_tbl->pool->ctx,
"Freeing action STEs offset %d order %d\n",
chunk->ste.offset, chunk->ste.order);
mutex_lock(lock);
mlx5hws_pool_chunk_free(chunk->action_tbl->pool, &chunk->ste);
chunk->action_tbl->last_used = jiffies;
list_move(&chunk->action_tbl->list_node,
&chunk->action_tbl->parent_elem->available);
mutex_unlock(lock);
}
Annotation
- Immediate include surface: `internal.h`.
- Detected declarations: `function hws_pool_opt_to_str`, `function hws_action_ste_table_create_pool`, `function hws_action_ste_table_create_single_rtc`, `function hws_action_ste_table_create_rtcs`, `function hws_action_ste_table_destroy_rtcs`, `function hws_action_ste_table_create_stc`, `function hws_action_ste_table_alloc`, `function hws_action_ste_table_destroy`, `function hws_action_ste_pool_element_init`, `function hws_action_ste_pool_element_destroy`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.